/* =====================================================================
   DOVYR HEALTH · menu recolhível e versão de celular
   Carregado por último: só ajusta o que as outras folhas definem.
   ===================================================================== */

/* ---------- Botões do menu (computador) ---------- */
.sb .brand { position: relative; }
.sb-toggle, .sb-close { position: absolute; right: 14px; top: 0; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--ink-4); -webkit-app-region: no-drag; transition: background .2s, color .2s; }
.sb-toggle:hover, .sb-close:hover { background: var(--hover); color: var(--ink); }
.sb-toggle svg, .sb-close svg { width: 17px; height: 17px; }
.sb-close { display: none; }
.nt-mback { display: none !important; }
@media (max-width: 820px) { .nt-mback { display: grid !important; } }
.mtop, .sb-veil { display: none; }

/* ---------- Menu recolhido: só os ícones ---------- */
.shell { transition: grid-template-columns .3s var(--ease); }
.shell.sb-mini { grid-template-columns: 72px minmax(0, 1fr); }
.shell.sb-mini .sb .brand { padding: 4px 0 18px; justify-content: center; }
.shell.sb-mini .sb .brand .wordmark,
.shell.sb-mini .sb .brand small { display: none; }
.shell.sb-mini .sb-toggle { position: static; margin: 0 auto; }
.shell.sb-mini .sb nav { padding: 4px 10px 16px; }
.shell.sb-mini .sb .grp { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule-2); }
.shell.sb-mini .sb .grp:first-child { border-top: 0; padding-top: 0; }
.shell.sb-mini .sb .grp-h { display: none; }
.shell.sb-mini .sb .grp-b { grid-template-rows: 1fr !important; }
.shell.sb-mini .sb .it { justify-content: center; padding: 0; height: 40px; }
.shell.sb-mini .sb .it span, .shell.sb-mini .sb .it .soon { display: none; }
.shell.sb-mini .sb .it[aria-current="page"]::before { left: -10px; }
.shell.sb-mini .sb-foot { padding: 12px 10px; }
.shell.sb-mini .me { justify-content: center; padding: 6px 0; }
.shell.sb-mini .me > span:nth-child(2), .shell.sb-mini .me > svg { display: none; }
.shell.sb-mini .menu { left: 10px; right: auto; width: 240px; }

/* =====================================================================
   Celular e telas estreitas (até 820 px)
   ===================================================================== */
@media (max-width: 820px) {
  body.dvh-lock { overflow: hidden; }

  /* casca: barra no topo + menu em gaveta */
  .shell, .shell.sb-mini { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); }
  .mtop { display: flex; align-items: center; gap: 10px; padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); border-bottom: 1px solid var(--rule-2); background: color-mix(in srgb, var(--shell) 92%, transparent); backdrop-filter: blur(12px); position: relative; z-index: 4; }
  .shell { grid-template-rows: calc(56px + env(safe-area-inset-top)) minmax(0, 1fr); }
  .mtop-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--ink-2); flex: none; }
  .mtop-btn:active { background: var(--hover); }
  .mtop-btn svg { width: 22px; height: 22px; }
  .mtop-brand { display: flex; align-items: baseline; gap: 6px; flex: none; }
  .mtop-brand .wordmark { width: 70px; }
  .mtop-brand small { font-size: 9px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-4); }
  .mtop-title { flex: 1; min-width: 0; text-align: right; font-size: 13px; font-weight: 550; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mtop-me { width: 34px !important; height: 34px !important; flex: none; font-size: 13px; }

  aside.sb { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .32s var(--ease); box-shadow: var(--shadow); padding-top: env(safe-area-inset-top); }
  .shell.sb-open aside.sb { transform: none; }
  .sb-veil { display: block; position: fixed; inset: 0; z-index: 55; background: var(--veil, rgba(0, 0, 0, .55)); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  .shell.sb-open .sb-veil { opacity: 1; pointer-events: auto; }
  .sb-top { height: 14px; }
  .sb-toggle { display: none; }
  .sb-close { display: grid; }
  /* dentro da gaveta o menu aparece sempre completo */
  .shell.sb-mini .sb .brand { justify-content: flex-start; padding: 4px 22px 22px; }
  .shell.sb-mini .sb .brand .wordmark, .shell.sb-mini .sb .brand small { display: block; }
  .shell.sb-mini .sb .grp-h { display: flex; }
  .shell.sb-mini .sb .grp { border-top: 0; padding-top: 0; margin-top: 16px; }
  .shell.sb-mini .sb .it { justify-content: flex-start; padding: 0 10px; height: 44px; }
  .shell.sb-mini .sb .it span { display: inline; }
  .shell.sb-mini .me { justify-content: flex-start; padding: 8px 10px; }
  .shell.sb-mini .me > span:nth-child(2) { display: block; }
  .shell.sb-mini .me > svg { display: block; }
  .shell.sb-mini .menu { left: 12px; right: 12px; width: auto; }
  .sb .it { height: 44px; font-size: 14.5px; }
  .main-drag { display: none; }

  /* página */
  .page { padding: 20px 16px calc(72px + env(safe-area-inset-bottom)); }
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 24px; }
  .page-head .side { flex-wrap: wrap; padding-bottom: 0; }
  .h-page { font-size: 27px; }
  .h-display { font-size: 32px; }
  .lead { font-size: 14px; }
  .sec { margin-top: 32px; }
  .sec-h { flex-wrap: wrap; gap: 10px; }

  /* controles: alvos de toque maiores e campos que não dão zoom no iPhone */
  input, select, textarea { font-size: 16px !important; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; }
  .tabs { overflow-x: auto; scrollbar-width: none; margin-bottom: 24px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; white-space: nowrap; }
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }

  /* tabelas: rolam para o lado */
  .tbl, .an-tbl, .bd2-htbl { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* janelas (modais) quase em tela cheia, presas embaixo */
  .modal-veil { place-items: end center; }
  .modal, .modal.wide, .modal.hbm, .modal.wf { width: calc(100vw - 16px) !important; max-height: calc(100dvh - 24px); padding: 22px 16px calc(18px + env(safe-area-inset-bottom)) !important; border-radius: 20px 20px 16px 16px; margin-bottom: 8px; }
  .modal.wide .acts { margin: 18px -16px calc(-18px - env(safe-area-inset-bottom)) !important; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)) !important; bottom: calc(-18px - env(safe-area-inset-bottom)) !important; }
  .modal .acts { flex-wrap: wrap; }
  .modal { overflow-x: hidden; }
  .modal div:has(> [data-due]) { flex-wrap: wrap; }
  /* nas janelas, as opções quebram linha em vez de sumir pela direita */
  .modal .seg:not(.ck-seg):not(.ck-words) { flex-wrap: wrap; overflow: visible; max-width: 100%; }
  /* dias da semana (formulários): os 7 cabem na largura */
  .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; width: 100%; }
  .days button { width: auto; height: 42px; font-size: 12.5px; padding: 0; }
  .modal .acts .btn { flex: 1 1 auto; }

  /* ----- Grades: duas colunas viram uma ----- */
  .cols, .pn-grid.two, .pn-grid.two-r, .pn-grid.hb3-top,
  .dr-star, .pn.dr-star, .dr2-ov, .dr-row, .dr2-sv, .pn.dr2-hero, .dr2-hz, .dr-frow, .dr-madd,
  .bd-hero, .bd-hero.bd2-top, .bd2-mid, .bd2-hero, .bd2-comp,
  .sl-hero, .ck-grid,
  .hb-today, .hb2-top, .hb-crow, .hb3-cm,
  .ag2-top, .ag2-low, .ag2-dial, .ag2-up, .ag-frow,
  .an-row, .an2-hl,
  .pub, .theme-tiles, .ob-sum > div, .dl > div, .cols .dl > div, .pub .rows > div,
  .set .ob-q .range-row, .ob-q .range-row { grid-template-columns: minmax(0, 1fr) !important; }
  .dl > div, .ob-sum > div, .pub .rows > div { gap: 4px; }
  .cols { gap: 28px; }
  .dr-row { gap: 10px; }

  /* ----- Faixas de números: duas por linha ----- */
  .day, .an-cov, .an2-cov, .an-sum, .an-sum.three, .an2-sum, .sl-stats dl, .bd-side, .bd-comp, .bd-circ,
  .dr-hero, .dr2-hf, .dr2-sf, .hb3-kpi, .dr-star-side, .hb2-kpi, .bd2-facts, .bd2-pace, .ag2-dsum, .dial-times {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .day > div { padding: 18px 14px 20px; border-left: 0; border-top: 1px solid var(--rule); }
  .day > div:nth-child(-n+2) { border-top: 0; }
  .day > div:nth-child(2n) { border-left: 1px solid var(--rule); }
  .day > div:nth-child(2n+1) { padding-left: 0; }
  .day .v { font-size: 26px; white-space: normal; }
  .day .v.word { font-size: 20px; }
  .dr-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* ----- Peças específicas ----- */
  .dial, .dial-svg { width: 272px; } .dial-svg { height: 272px; } .dial-mid { top: 136px; }
  .ck-grid { justify-items: center; }
  .ck-grid > *:not(.dial) { justify-self: stretch; }
  .ck-date { width: 100%; }
  .ck-head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 14px; }
  .ck-head h3 { font-size: 22px; }
  .ck-q > b { flex-wrap: wrap; row-gap: 2px; }
  .ck-seg, .ck-words { overflow: visible; display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
  .ck-seg button, .ck-words button { font-size: 12px; padding: 0 2px; white-space: normal; line-height: 1.15; height: 44px; justify-content: center; text-align: center; }
  /* aviso rápido aparece em cima (embaixo ficam os botões) */
  .toast { bottom: auto; top: calc(66px + env(safe-area-inset-top)); max-width: calc(100vw - 32px); transform: translate(-50%, -12px); }
  .toast.on { transform: translate(-50%, 0); }
  .dr-pick { width: 100%; }
  .dr-star h2 { font-size: 26px; }
  .hb-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .hb-row > :nth-child(4) { grid-column: 2 / -1; }
  .hb-mrow { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .hb-mrow > :nth-child(4) { display: none; }
  .hb-crow dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .hb-mini, .hb-mini.hb3-mini { max-width: 100%; overflow-x: auto; }
  .an2-hr { grid-template-columns: minmax(0, 1fr) 46px; }
  .an2-hr > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .dr2-scl { grid-template-columns: minmax(0, 1fr); }
  .dr2-cg { gap: 3px; }
  .sl-obs { max-width: 140px; }

  /* Hoje */
  .pn { padding: 16px 16px 18px; border-radius: 16px; }
  .pn-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .hj-ck { padding: 4px 16px; }
  .ck-row { grid-template-columns: minmax(0, 1fr); }
  .ck-row > button { padding: 14px 0; }
  .ck-row > button + button { border-left: 0 !important; border-top: 1px solid var(--rule); padding-left: 0; }
  .hj-rings { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; row-gap: 14px; }
  .hj-wb { grid-template-columns: minmax(0, 1fr) !important; }

  /* Cabeçalho dos painéis: ações quebram linha */
  .pn-h { flex-wrap: wrap; gap: 10px; }

  /* Nutrição */
  .nu-fastbody { grid-template-columns: minmax(0, 1fr) !important; justify-items: center; }
  .nu-fastbody > * { justify-self: stretch; }
  .nu-fastbody .nu-ring { justify-self: center; }
  /* água: copo ao lado do número */
  .nu-wbody { grid-template-columns: 64px minmax(0, 1fr) !important; gap: 16px; align-items: center; }
  .nu-wbody .nu-big { font-size: 32px; }
  /* 30 dias cabem na largura (quadradinhos menores, sem rolar) */
  .ht { grid-template-columns: 58px repeat(var(--n), minmax(0, 1fr)); gap: 2px; }
  .ht-c { border-radius: 2px; }
  .ht-l { padding-right: 4px; }
  .ht-l b { font-size: 11.5px; }
  .ht-x { overflow: visible; white-space: nowrap; font-size: 10px; }

  .nu-date { gap: 6px; }
  .nu-date .muted { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nu-plansel { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .nu-plansel select { flex: 1; min-width: 0; max-width: none; width: 100%; }

  /* Tarefas e foco */
  .tk-onepick { grid-template-columns: minmax(0, 1fr) !important; gap: 8px; }
  .tk2-proj { grid-template-columns: minmax(0, 1fr) !important; justify-items: center; gap: 16px; }
  .tk2-proj > .tk2-pl { justify-self: stretch; }
  .tk2-pr { grid-template-columns: minmax(0, 1fr) 70px 86px !important; }
  /* tarefa: título inteiro; ações embaixo */
  .tk-row { grid-template-columns: 34px 8px minmax(0, 1fr) !important; row-gap: 6px; align-items: start; }
  .tk-row > .tk-chk { margin-top: 0; }
  .tk-row > .tk-pr { margin-top: 12px; }
  .tk-row .tk-mi b { white-space: normal; overflow: visible; text-overflow: clip; display: block; }
  .tk-row .tk-mi small { white-space: normal; }
  .tk-row > .tk-act { grid-column: 3; justify-self: start; margin-left: -10px; opacity: 1 !important; visibility: visible !important; }
  .tk-row > .tk-act:empty { display: none; }
  .tk-one h2, .tk-one .tk-oneq { font-size: 24px; }
  .tk2-t { padding: 4px 10px; border-left: 0; flex-direction: column; align-items: flex-start; gap: 4px; }
  .tk2-t dd { font-size: 22px; }

  .tk2-fwrap { grid-template-columns: minmax(0, 1fr) !important; justify-items: center; }
  .tk2-fside { justify-self: stretch; }
  .tk2-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; row-gap: 12px; }

  /* Treino: a semana rola para o lado */
  .tr2-strip { overflow-x: auto; grid-template-columns: repeat(7, minmax(112px, 1fr)) !important; scrollbar-width: none; scroll-snap-type: x proximity; }
  .tr2-strip > * { scroll-snap-align: start; }
  .tr2-day b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }

  /* Direção */
  .dr2-cg { overflow-x: auto; }

  /* Anotações: lista ou anotação aberta, uma de cada vez */
  .page.nt-page { height: calc(100dvh - 56px - env(safe-area-inset-top)); padding: 16px 12px 12px; }
  .nt-head { margin-bottom: 14px; }
  .nt-head .side { flex-wrap: wrap; }
  .nt, .nt.focus { grid-template-columns: minmax(0, 1fr) !important; border-radius: 14px; }
  .nt .nt-doc { display: none; }
  .nt.m-doc .nt-list { display: none; }
  .nt.m-doc .nt-doc { display: block; }
  .nt.focus .nt-list { visibility: visible; }
  .nt-dh { padding: 10px 12px 6px; gap: 8px; }
  .nt-paper { padding: 18px 16px 100px !important; }
  .nt-title { font-size: 26px !important; }
  .nt-keys { display: none; }
  .nt-blank { padding: 24px 16px; }
  .nt-dh [data-focus] { display: none; }

  /* ----- Sono ----- */
  /* última noite: relógio em cima, detalhes embaixo */
  .sl2-lastbody { grid-template-columns: minmax(0, 1fr) !important; gap: 18px; justify-items: center; }
  .sl2-dial { width: min(240px, 100%); }
  .sl2-lastinfo { width: 100%; }
  .sl2-vs { text-align: center; font-size: 14px; margin-bottom: 16px; }
  .sl2-facts { justify-content: center; gap: 40px; padding: 14px 0; margin: 0 0 14px; border-top: 1px solid var(--panel-line); border-bottom: 1px solid var(--panel-line); }
  .sl2-facts > div { text-align: center; }
  .sl2-facts dd { font-size: 28px; }
  .sl2-q { justify-content: center; }
  .sl2-woke > div { grid-template-columns: 70px minmax(0, 1fr) 36px; }
  .sl2-lastinfo > .btn { width: 100%; justify-content: center; }
  .sl2-qr { grid-template-columns: 76px minmax(0, 1fr) 64px; gap: 10px; }
  .sl2-need { grid-template-columns: minmax(0, 1fr) 40px; }
  .sl2-need > :first-child { grid-column: 1 / -1; }

  /* blocos de números (Sono, Corpo, Agenda): número em cima, gráfico embaixo */
  .sl2-t { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 10px; padding: 14px 12px 14px 0; }
  .sl2-t:nth-child(2n) { padding-left: 12px; }
  .sl2-t > div:first-child { min-width: 0; }
  .sl2-t dd { font-size: 23px; white-space: normal; }
  .sl2-t p { font-size: 11.5px; }
  .sl2-tv { width: 100%; }
  .sl2-tv > svg, .sl2-strip, .sl2-debt { width: 100% !important; max-width: 170px; height: auto; }
  /* anel pequeno continua ao lado do número */
  .sl2-t:has(.mring) { flex-direction: row; align-items: center; justify-content: space-between; }
  .sl2-t:has(.mring) .sl2-tv { width: auto; flex: none; }
  .sl2-tv > svg.mring { width: 44px !important; height: 44px !important; }

  /* ----- Nutrição: refeição em três linhas (nome e alimentos · macros · Feita/Com ajuste/Pulei) ----- */
  .nu-meal, .nu-pmeals .nu-meal { grid-template-columns: 46px minmax(0, 1fr) !important; gap: 4px 12px; align-items: start; padding: 14px 0 14px 12px; }
  .nu-meal .nu-time { padding-top: 2px; font-size: 14px; }
  .nu-meal .nu-mi { grid-column: 2; }
  .nu-meal .nu-opts { grid-column: 2; grid-row: auto; justify-self: start; margin-top: 8px; }
  .nu-meal > span:empty { display: none; }
  .nu-meal .nu-st { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin-top: 10px; }
  .nu-meal .nu-st button { justify-content: center; height: 38px; }
  .nu-meal.extra { grid-template-columns: 46px minmax(0, 1fr) auto !important; }
  .nu-mi .nu-mac { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; }
  .nu-mi .nu-mac .mch { margin: 0; }
  .nu-pm { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; }
  .nu-pm small.nu-mac { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
  .nu-row2 { grid-template-columns: minmax(0, 1fr) !important; }
  .nu-mac-row { grid-template-columns: 82px minmax(0, 1fr) !important; gap: 6px 12px; }
  .nu-mac-row > :nth-child(3) { grid-column: 1 / -1; text-align: left; }
  .nu-macbody { grid-template-columns: minmax(0, 1fr) !important; justify-items: center; }
  .nu-macbody > * { justify-self: stretch; }
  .nu-targets { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* cardápios: a semana mostra só o dia e a cor do cardápio (os nomes ficam logo abaixo) */
  .nu-week { gap: 4px !important; overflow: visible; }
  .nu-wd { padding: 9px 4px 11px !important; align-items: center; text-align: center; }
  .nu-wd b { display: none; }
  .nu-wd small { white-space: normal; font-size: 10.5px; line-height: 1.2; }
  .nu-ptabs { flex-wrap: wrap; }
  .nu-phead { flex-direction: column; align-items: stretch; gap: 10px; }
  .nu-pacts { flex-wrap: wrap; justify-content: flex-start; margin-left: -8px; }
  .nu-ftbl th:nth-child(5), .nu-ftbl td:nth-child(5) { display: none; }
  .nu-donut { max-width: 230px; margin-inline: auto; }
  .nu-donut svg { width: 100%; height: auto; }
  .nu-week { overflow-x: auto; scrollbar-width: none; }
  .it-head { display: none; }
  .it-row { grid-template-columns: minmax(0, 1fr) 124px 34px !important; row-gap: 8px; column-gap: 8px; }
  .it-row > :nth-child(3) { grid-column: 1 / 2; grid-row: 2; }

  /* ----- Treino ----- */
  .tr2-exrow, .tr2-top, .tr2-mid { grid-template-columns: minmax(0, 1fr) !important; }
  .tr-g, .tr2-gwrap .tr-g { grid-template-columns: 104px minmax(0, 1fr) 34px; gap: 10px; }
  .tr2-exlist { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* aviso de treino ao vivo em andamento */
  .tr-live { flex-wrap: wrap; gap: 10px 12px; }
  .tr-live > div { flex: 1 1 calc(100% - 30px); min-width: 0; }
  .tr-live > .btn { flex: 1 1 0; justify-content: center; }
  /* treino salvo: nome e botões em cima, exercícios embaixo */
  .tr-plan { grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "h" "l" "f" !important; row-gap: 12px; }
  .tr-plan ol li { gap: 10px; }
  .tr-plan-f { margin-top: 0; }
  .tr2-gwrap { grid-template-columns: minmax(0, 1fr) !important; justify-items: center; gap: 14px; }
  .tr2-gwrap > .tr-groups { justify-self: stretch; }
  .tr2-gdonut { width: 180px; }
  .tr2-gdonut svg { width: 100%; height: auto; }
  .tr2-gwrap .tr-g { grid-template-columns: minmax(0, 1fr) 90px 34px; }
  .tr2-weekbody { grid-template-columns: 112px minmax(0, 1fr); gap: 18px; }
  .tr2-ring svg { width: 112px; height: 112px; }
  .tr2-ringc { height: 112px; }
  .tr2-ringc b { font-size: 30px; }
  .tr2-day .btn, .tr2-today .btn { width: 100%; justify-content: center; }

  /* ----- Análise: nome inteiro das contagens ----- */
  .an-cov dt, .an2-cov dt { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.3; }
  .an2-cov > div { gap: 10px; align-items: flex-start; }
  .an2-cov svg { width: 40px; height: 40px; flex: none; }
  /* constância semana a semana: um por linha, anel ao lado do número */
  .an-sum.three.an2-three { grid-template-columns: minmax(0, 1fr) !important; }
  .an2-three > div { border-left: 0 !important; padding-left: 0 !important; padding-block: 10px; border-top: 1px solid var(--panel-line); }
  .an2-three > div:first-child { border-top: 0; }
  /* mini-gráfico vai para baixo do número */
  .an2-sum dd.num { flex-wrap: wrap; row-gap: 6px; }
  .an2-sp { flex-basis: 100%; margin-left: 0 !important; }
  .an2-sp svg { width: 100%; max-width: 130px; height: 24px; }

  /* ----- Medidas: composição com a rosca ao lado dos números ----- */
  .bd2-comp { grid-template-columns: 116px minmax(0, 1fr) !important; gap: 18px; align-items: center; display: grid; }
  .bd2-comp .bd2-donut { width: 116px; height: auto; }
  .bd2-comp .bd-comp { display: flex; flex-direction: column; gap: 10px; }
  .bd2-comp .bd-comp > div { padding: 0 !important; border: 0 !important; }

  /* ----- Editor de treino: exercício em cima; séries, alvo e descanso embaixo ----- */
  .wf-top { grid-template-columns: minmax(0, 1fr) !important; }
  .wf-top .seg { width: 100%; }
  .wf-head, .wf-row { grid-template-columns: 20px 54px minmax(0, 1fr) 92px 34px !important; gap: 8px; }
  .wf-head > :nth-child(2) { display: none; }
  .wf-head > :nth-child(1) { grid-column: 1; } .wf-head > :nth-child(3) { grid-column: 2; }
  .wf-head > :nth-child(4) { grid-column: 3; } .wf-head > :nth-child(5) { grid-column: 4; } .wf-head > :nth-child(6) { grid-column: 5; }
  .wf-row { row-gap: 8px; }
  .wf-row > .grip { grid-row: 1 / 3; grid-column: 1; }
  .wf-row > .wf-ex { grid-row: 1; grid-column: 2 / 5; margin-left: 0; padding-left: 0; }
  .wf-row > .wf-x { grid-row: 1; grid-column: 5; }
  .wf-row > .inp.num { grid-row: 2; grid-column: 2; }
  .wf-row > .inp:not(.num):not(.wf-note):not(select) { grid-row: 2; grid-column: 3; }
  .wf-row > select.inp { grid-row: 2; grid-column: 4; }
  .wf-row > .wf-note { grid-row: 3; grid-column: 2 / -1; }
  .wf-ex b { white-space: normal; }

  /* ----- Treino ao vivo / registrar treino (tela cheia) ----- */
  .ts { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .ts-top { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; min-height: 60px; }
  .ts-top > .btn { font-size: 0; gap: 0; width: 40px; height: 40px; padding: 0; justify-content: center; }
  .ts-top > .btn svg { width: 20px; height: 20px; }
  .ts-title { text-align: left; min-width: 0; }
  .ts-title b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ts-title small { font-size: 11.5px; }
  .ts-clock { font-size: 22px; }
  /* registrar treino feito: data e duração numa linha própria */
  .ts-right:has(.ts-mini) { grid-column: 1 / -1; justify-self: stretch; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ts-mini { flex-direction: column; align-items: stretch; gap: 4px; }
  .ts-mini select.inp, .ts-mini .inp-unit { width: 100%; }
  /* exercícios: faixa que rola para o lado */
  .ts-rail { border-right: 0; border-bottom: 1px solid var(--rule-2); padding: 8px 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .ts-rail::-webkit-scrollbar { display: none; }
  .ts-rk { display: none; }
  .ts-rail ol { display: flex; gap: 6px; }
  .ts-rail li { flex: none; max-width: 180px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; }
  .ts-rail li.ok { border-color: var(--acid-line); }
  .ts-main { padding: 14px 14px 32px; }
  .ts-ex { padding: 18px 0 16px; }
  .ts-ex header { flex-direction: column; gap: 8px; position: relative; margin-bottom: 12px; }
  .ts-ex header > div:first-child { padding-right: 36px; }
  .ts-ex h3 { font-size: 18px; }
  .ts-ex-r { text-align: left; width: 100%; }
  .ts-ex-r [data-rmex] { position: absolute; top: -4px; right: -6px; }
  .ts-last { max-width: none; }
  .ts-sh, .ts-set { grid-template-columns: 28px repeat(var(--cols), minmax(0, 1fr)) auto; gap: 8px; }
  .ts-in .inp { height: 46px; font-size: 17px !important; }
  .ts-check { width: 46px; height: 46px; }
  .ts-act { padding-left: 0; gap: 6px; }
  .ts-act .rec { font-size: 10px; padding: 2px 5px; }
  .ts-ex-foot { margin-left: 0; flex-wrap: wrap; }
  .ts-add { padding: 18px 0; }
  .ts-add .btn { width: 100%; justify-content: center; }
  .ts-foot { flex-wrap: wrap; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); min-height: 64px; }
  .ts-rest { flex: 1 1 100%; order: -1; gap: 10px; padding: 8px 8px 8px 12px; }
  .ts-rest-k { max-width: 110px; }
  .ts-rest-bar { flex: 1; width: auto; }
  .ts-sum { margin-left: 0; gap: 2px; font-size: 12px; flex-direction: column; flex: 1; min-width: 0; }
  .ts-foot > .btn { margin-left: auto; }
  .ts-res { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* treino explicado: passo a passo, semanas A/B, circuito */
  .tr3-t { flex-direction: column; align-items: flex-start; gap: 3px; }
  .tr3-p { text-align: left; max-width: none; font-size: 16px; }
  .tr3-steps li { grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
  .tr3-rot .seg { width: 100%; } .tr3-rot .seg button { flex: 1; }
  .tr3-plan .tr-plan-a { flex-wrap: wrap; }
  .tr3-exhow { -webkit-line-clamp: 3; }
  .wf-circ { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .wf-top .seg[data-week] button, .wf-top .seg[data-format] button { flex: 1; }
  .modal.wf.circ .wf-head { display: none; }
  .modal.wf.circ .wf-row > .wf-tgt { grid-row: 2; grid-column: 2 / 6; }
  .ts-ex header p.ts-tell { font-size: 14.5px; }
  .ts-in.tgt span { height: 46px; font-size: 15px; }
  .ts-rrow { grid-template-columns: minmax(0, 1fr) 46px; gap: 8px 10px; padding: 10px 8px; }
  .ts-rname { grid-column: 1 / -1; }
  .ts-rin { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }

  /* ----- Hábitos: resumo do dia empilhado ----- */
  .hb2-sum { grid-template-columns: minmax(0, 1fr) !important; justify-items: center; }
  .hb2-sum > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .hb2-sum > .pn-h, .hb2-sum > .hb2-areas, .hb2-sum > .hb2-kpi { justify-self: stretch; }
  .hb2-ringw { width: 150px; }
  .hb2-msg { text-align: center; margin: 4px 0 0; }
  .hb2-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--panel-line); }
  .hb2-kpi > div { padding: 0 12px 0 0; border: 0 !important; }
  .hb2-kpi > div + div { padding: 0 0 0 14px; border-left: 1px solid var(--panel-line) !important; }

  /* ----- Hábitos: cada hábito em duas linhas (nome em cima, os 7 dias embaixo) ----- */
  .hb3-weekpn .hb-week, .hb3-weekpn .hb-week thead, .hb3-weekpn .hb-week tbody { display: block; width: 100%; }
  .hb3-weekpn .hb-week tr { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: center; }
  .hb3-weekpn .hb-week thead th:first-child, .hb3-weekpn .hb-week thead th:nth-last-child(-n+2) { display: none; }
  .hb3-weekpn .hb-week thead th { padding: 0 0 8px; }
  .hb3-weekpn .hb-week thead th .num { display: block; }
  .hb3-weekpn .hb-week tbody tr { padding: 12px 0 10px; border-bottom: 1px solid var(--panel-line); row-gap: 8px; }
  .hb3-weekpn .hb-week tbody tr > * { border-bottom: 0 !important; padding: 0 !important; }
  .hb3-weekpn .hb-week tbody th { grid-row: 1; grid-column: 1 / 6; min-width: 0; }
  .hb3-weekpn .hb-week tbody th b { display: inline; }
  .hb3-weekpn .hb-week tbody th small { display: inline; margin-left: 6px; }
  .hb3-weekpn .hb-week td.hb-wr { grid-row: 1; grid-column: 6 / 7; text-align: right; font-size: 12px; color: var(--ink-3); }
  .hb3-weekpn .hb-week td.hb3-c { grid-row: 1; grid-column: 7 / 8; width: auto; text-align: right; }
  .hb3-weekpn .hb-week td { text-align: center; }
  .hb3-weekpn .hb-week .hb-cell { width: 36px; height: 36px; margin: 0 auto; }

  /* Agenda: a semana rola para o lado em vez de espremer as colunas */
  .ag-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ag-grid.ag-vweek > * { min-width: 620px; }
  .ag-bar { flex-wrap: wrap; }
  .ag-mg { grid-auto-rows: minmax(64px, auto); }
  .ag-uprow, .ag2-ud .ag-uprow { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }

  /* Cadastro de personalização */
  .ob { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .ob-top { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
  .ob-rail { display: none; }
  .ob-main { padding: 24px 16px 40px; }
  .ob-step h1 { font-size: 29px; }
  .ob-step > .lead { margin-bottom: 24px; }
  .ob-q > .q { flex-wrap: wrap; gap: 6px; }
  .ob-foot { grid-column: 1; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); gap: 10px; flex-wrap: wrap; }
  .ob-foot .r { flex: 1; justify-content: flex-end; }
  .ob-ridge { display: none; }
  .avail { grid-template-columns: 52px repeat(7, minmax(0, 1fr)); gap: 4px; }

  /* Entrar / criar conta */
  .auth { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 22px; padding: calc(28px + env(safe-area-inset-top)) 16px 28px; overflow-y: auto; }
  .auth-hero .brand { margin-bottom: 22px; }
  .auth-hero h1 { font-size: 40px; margin-bottom: 14px; }
  .auth { align-items: start; }
  .auth-hero { max-width: none; }
  .auth-hero p { display: none; }
  .auth-card { padding: 24px 18px 20px; max-height: none; }
  .auth-card .pair { grid-template-columns: minmax(0, 1fr); }
  .auth-foot { position: static; justify-content: center; }
  .auth-bg { background-position: 70% 30%; }
}

/* telefones bem estreitos */
@media (max-width: 380px) {
  .day, .an2-sum, .bd-side, .hb3-kpi { grid-template-columns: minmax(0, 1fr) !important; }
  .day > div { border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid var(--rule) !important; }
  .day > div:first-child { border-top: 0 !important; }
  .mtop-brand small { display: none; }
  .sl2-t:has(.mring) { flex-direction: column; align-items: flex-start; }
  .tr2-weekbody { grid-template-columns: minmax(0, 1fr) !important; justify-items: center; }
  .tr2-weekbody > :not(.tr2-ring) { justify-self: stretch; }
}
