/* RotiNana · biblioteca de componentes (estilo pelúcia). As decisões de desenho estão em tokens.css; aqui só as peças.
   Todas as telas do app usam: cada uma só acrescenta o que é dela (home.css, reports.css, settings.css).
   Vitrine com tudo funcionando: /dev/biblioteca.html. Comportamentos: /js/components.js.

   Movimento, igual em toda peça:
   - só transform e opacity se movem; cor troca com "ease";
   - apertar afunda rápido (--t-press, --ease-out) e solta macio (--t-spring, --ease-spring);
   - o que entra e sai usa transição, não @keyframes: dá para interromper no meio;
   - hover só em aparelho com mouse; com "reduzir movimento" ligado ficam só cor e opacidade. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* min-height: no iPhone, app instalado, a tela abre com a altura descontada da barra de status e tudo que é
   fixo embaixo (abas, avisos, folhas) sobe; somar a área de cima devolve a altura inteira */
html { -webkit-text-size-adjust: 100%; background: var(--bg); min-height: calc(100% + env(safe-area-inset-top, 0px)); }
/* céu: fica parado atrás de tudo. No html (e não no body) porque o body::before já é a faixa da barra de status do iPhone */
html::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--sky); }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font: 400 var(--fs-3)/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
input:focus-visible { outline-offset: 0; }
.ic { width: 22px; height: 22px; flex: none; stroke-width: 2; }
.num { font-variant-numeric: tabular-nums; }
.dg { display: inline-block; width: .62em; text-align: center; } /* dígito de largura fixa: o cronômetro não treme */
.muted { color: var(--muted); }

/* ---------- Pelúcia: o enchimento de tudo que é principal ou está marcado ----------
   Uma receita só, que pede --tone (a cor) e --tone-ink (a tinta por cima):
   feltro (ruído) + luz no alto + o próprio tom mais fundo embaixo (multiply) + fio de luz + brilho colorido. */
.btn-primary, .icon-btn.is-plush, .bubble, .progress > i, .steps > .is-done, .seg.seg-accent::before,
.chip[aria-pressed]::before, .choice > button::before, .st::before, .switch::before {
  background-color: var(--tone);
  background-image: var(--fuzz),
    radial-gradient(120% 80% at 28% 0%, rgb(255 255 255 / var(--shine)), transparent 62%),
    linear-gradient(180deg, transparent 38%, color-mix(in srgb, var(--tone) var(--shade), transparent));
  background-blend-mode: normal, normal, multiply; /* o feltro não depende de mistura; se o multiply falhar, só some a sombra */
  box-shadow: inset 0 1.5px 0 rgb(255 255 255 / .4),
    0 12px 26px -12px color-mix(in srgb, var(--tone) 75%, transparent),
    0 2px 5px -1px rgb(8 0 24 / .3);
}
/* Tom de cada peça quando ninguém escolhe. Dentro de :where() pesa zero: qualquer .tone-* (no fim do arquivo) troca. */
:where(.btn-primary, .seg-accent) { --tone: var(--accent); --tone-ink: var(--accent-ink); }
:where(.bubble, .switch, .progress, .steps) { --tone: var(--sleep); --tone-ink: var(--sleep-ink); }
:where(.chip[aria-pressed], .choice) { --tone: var(--pick); --tone-ink: var(--pick-ink); }
:where(.icon-btn.is-plush) { --tone: var(--text); --tone-ink: var(--bg); }
/* Opção marcada: a pelúcia fica numa camada atrás do texto e só a opacidade dela muda (troca suave, sem repintar) */
.chip[aria-pressed], .choice > button, .st { position: relative; isolation: isolate; }
.chip[aria-pressed]::before, .choice > button::before, .st::before, .switch::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; opacity: 0; transition: opacity var(--t-quick) ease;
}
.chip[aria-pressed]::before, .choice > button::before, .st::before { z-index: -1; }
.chip[aria-pressed="true"]::before, .choice > [aria-pressed="true"]::before, .st.on::before, .switch:checked::before { opacity: 1; }

/* ---------- Estrutura da página: conteúdo rola, abas flutuam embaixo ---------- */
:root {
  --tabs-h: 66px;                                             /* altura da barra de abas */
  --tabs-gap: max(12px, calc(var(--safe-bottom) - 8px));      /* distância dela até a borda de baixo */
}
.app {
  min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto;
  padding: calc(var(--safe-top) + 6px) max(16px, env(safe-area-inset-right, 0px)) calc(var(--tabs-h) + var(--tabs-gap) + 18px) max(16px, env(safe-area-inset-left, 0px));
}
.page { display: flex; flex-direction: column; gap: 14px; }
.page-title { margin: 6px 4px 2px; font: 700 var(--fs-5)/1.1 var(--font-display); }
.overline { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.overline .ic { width: 17px; height: 17px; }
.big-num { font: 700 var(--fs-6)/1 var(--font-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 10px; }

/* ---------- Botões ---------- */
.btn {
  --ink: var(--text);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: var(--r-pill);
  color: var(--ink); font-size: var(--fs-3); font-weight: 800; line-height: 1.1; text-decoration: none;
  transition: transform var(--t-spring) var(--ease-spring), opacity var(--t-quick) ease;
}
.btn:active, .icon-btn:active, button.chip:active, :is(button, a).card:active, .choice > button:active, .st:active, .tab:active {
  transform: scale(.97); transition-duration: var(--t-press); transition-timing-function: var(--ease-out);
}
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn .ic { width: 20px; height: 20px; }
.btn-primary { --ink: var(--tone-ink); }
.btn-ghost { background: var(--surface-2); box-shadow: var(--rim); }
.btn-danger { --ink: var(--danger); border: 1.5px solid currentColor; }
.btn-plain { --ink: var(--muted); }
.btn-block { width: 100%; }
.btn-sm { min-height: var(--tap); padding: 0 16px; font-size: var(--fs-2); }
/* Ocupado: o texto some e gira um anel no lugar; o botão não muda de tamanho. Anel rápido parece espera curta. */
.btn[aria-busy="true"] { color: transparent; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--ink); border-right-color: transparent; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

/* Botão só de ícone: 44 px de toque. .is-solid tem fundo de cartão; .is-plush é a bolinha de pelúcia (tocar, mais) */
.icon-btn {
  position: relative; width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; border-radius: 50%;
  color: var(--muted); transition: transform var(--t-spring) var(--ease-spring);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .3; cursor: default; transform: none; }
.icon-btn.is-solid { background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: var(--rim); }
.icon-btn.is-plush { color: var(--tone-ink); }
.icon-btn-sm { width: 38px; height: 38px; }
.icon-btn-sm .ic { width: 18px; height: 18px; }
.icon-btn-sm::after { content: ""; position: absolute; inset: -3px; } /* área de toque de 44 px sem aumentar o desenho */

/* ---------- Chips: informam (span) ou marcam (button com aria-pressed) ---------- */
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--surface-2); box-shadow: var(--rim); font-size: 13px; font-weight: 800; white-space: nowrap;
}
.chip .ic { width: 16px; height: 16px; }
button.chip { transition: transform var(--t-spring) var(--ease-spring), color var(--t-quick) ease; }
button.chip:not(.chip-lg)::after { content: ""; position: absolute; inset: -5px; } /* área de toque de 44 px */
.chip-lg { min-height: var(--tap); padding: 0 16px; font-size: 15px; }
.chip-outline { background: transparent; border: 1px solid var(--line); box-shadow: none; color: var(--muted); }
.chip-tone { background: color-mix(in srgb, var(--tone) 18%, var(--surface-2)); }
.chip[aria-pressed="true"] { color: var(--tone-ink); border-color: transparent; }
/* de contorno, o marcado fica discreto, sem pelúcia: para filtros, que não são a ação principal da tela */
.chip-outline[aria-pressed]::before { display: none; }
.chip-outline[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--tone, currentColor); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; box-shadow: var(--rim), var(--lift); }
.card-tint { background: linear-gradient(160deg, color-mix(in srgb, var(--tone, var(--sleep)) 22%, var(--surface)), var(--surface)); }
/* linha que se toca inteira (Mamou, Som para dormir): bolha, título e o resto à direita */
.card-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 66px; padding: 10px 16px 10px 11px; color: var(--text); text-align: left; text-decoration: none; }
.card-row b { font-size: 18px; font-weight: 900; }
.card-meta { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.3; text-align: right; }
:is(button, a).card { transition: transform var(--t-spring) var(--ease-spring); }
:is(button, a).card:active { transform: scale(.98); }

/* Bolha: o ícone num quadradinho de pelúcia. Tom com .tone-* (padrão: sono) */
.bubble { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--tone-ink); font-size: 22px; line-height: 1; }
.bubble .ic { width: 24px; height: 24px; }
.bubble-sm { width: 34px; height: 34px; border-radius: 11px; font-size: 17px; }
.bubble-sm .ic { width: 18px; height: 18px; }

/* ---------- Números ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { display: grid; align-content: start; gap: 2px; padding: 11px 11px 10px; border-radius: 16px; background: var(--surface-2); box-shadow: var(--rim); }
.stat > .bubble { margin-bottom: 6px; }
.stat > b { font: 700 var(--fs-4)/1.15 var(--font-display); white-space: nowrap; }
.stat > span:last-child { color: var(--muted); font-size: var(--fs-1); font-weight: 700; line-height: 1.25; }

/* ---------- Listas (consultas, remédios) ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.item { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item > .ic { color: var(--muted); }
.item-txt { display: grid; flex: 1; min-width: 0; }
.item-txt b { font-weight: 800; overflow-wrap: anywhere; }
.item-txt span { color: var(--muted); font-size: var(--fs-2); font-weight: 700; }
.empty { padding: 10px 0; color: var(--muted); font-weight: 700; }

/* ---------- Campos ---------- */
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 800; color: var(--muted); }
.input {
  width: 100%; min-width: 0; min-height: 50px; padding: 0 14px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text); box-shadow: var(--well);
  font-size: 17px; font-weight: 700; /* 16 px ou mais: o iPhone não dá zoom ao focar */
  transition: border-color var(--t-quick) ease, box-shadow var(--t-quick) ease;
}
.input::placeholder { color: var(--muted); opacity: .7; }
.input:focus { border-color: var(--sleep); outline: none; box-shadow: var(--well), 0 0 0 4px color-mix(in srgb, var(--sleep) 24%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[type="time"], .input[type="date"] { -webkit-appearance: none; appearance: none; }
.input::-webkit-date-and-time-value { text-align: left; }
textarea.input { min-height: 96px; padding: 12px 14px; line-height: 1.4; resize: vertical; }
.field-err { color: var(--danger); }

/* ---------- Chave liga/desliga (input type=checkbox role=switch) ---------- */
.switch {
  -webkit-appearance: none; appearance: none; position: relative; width: 52px; height: 32px; flex: none; margin: 0;
  border-radius: var(--r-pill); background: var(--surface-2); border: 1.5px solid var(--line); box-shadow: var(--well); cursor: pointer;
}
.switch::before { inset: -1.5px; transition-duration: var(--t-move); }
.switch::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--muted); box-shadow: 0 2px 4px rgba(8, 0, 24, .35), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform var(--t-spring) var(--ease-spring), background-color var(--t-move) ease;
}
.switch:active::after { transform: scale(1.12, .9); }                               /* amassa como pelúcia */
.switch:checked::after { transform: translateX(20px); background: var(--tone-ink); }
.switch:checked:active::after { transform: translateX(20px) scale(1.12, .9); }

/* ---------- Seletor (2 a 4 opções; button com aria-pressed) ----------
   Sem JavaScript: o :has() acha a posição marcada (--seg-i) e a pílula desliza até ela.
   A cor do texto troca no mesmo tempo e na mesma curva da pílula. */
.seg {
  --seg-n: 2; --seg-i: 0; --seg-on: var(--text);
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--well);
}
.seg:has(> :nth-child(3)) { --seg-n: 3; }
.seg:has(> :nth-child(4)) { --seg-n: 4; }
.seg:has(> :nth-child(2)[aria-pressed="true"]) { --seg-i: 1; }
.seg:has(> :nth-child(3)[aria-pressed="true"]) { --seg-i: 2; }
.seg:has(> :nth-child(4)[aria-pressed="true"]) { --seg-i: 3; }
.seg::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--seg-n)); border-radius: var(--r-pill);
  background: var(--surface-2); box-shadow: 0 1px 4px rgba(0, 0, 0, .25), var(--rim);
  transform: translateX(calc(var(--seg-i) * 100%)); transition: transform var(--t-move) var(--ease-in-out);
}
.seg:not(:has([aria-pressed="true"]))::before { opacity: 0; }
.seg button { position: relative; min-height: 38px; border-radius: var(--r-pill); color: var(--muted); font-size: var(--fs-2); font-weight: 800; transition: color var(--t-move) var(--ease-in-out); }
.seg button[aria-pressed="true"] { color: var(--seg-on); }
.seg-accent { --seg-on: var(--tone-ink); }

/* ---------- Escolhas: opções grandes, lado a lado (Peito / Mamadeira) ---------- */
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice > button {
  display: grid; justify-items: center; gap: 6px; min-height: 96px; padding: 14px 8px; border-radius: 22px;
  background: var(--bg); border: 1px solid var(--line); box-shadow: var(--well); font-size: 17px; font-weight: 900;
  transition: transform var(--t-spring) var(--ease-spring), color var(--t-quick) ease, border-color var(--t-quick) ease;
}
.choice > button > .ic { width: 52px; height: 52px; } /* figurinhas: icon('fig-nursing'), icon('fig-bottle')… */
.choice > [aria-pressed="true"] { color: var(--tone-ink); border-color: transparent; }

/* ---------- Progresso ---------- */
/* <div class="progress" style="--p: 62"><i></i></div> · --p de 0 a 100 */
.progress { height: 12px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: var(--well); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; transform: translateX(calc(var(--p, 0) * 1% - 100%)); transition: transform 600ms var(--ease-out); }
/* passos: <div class="steps"><i class="is-done"></i><i aria-current="step"></i><i></i></div> */
.steps { display: flex; gap: 6px; }
.steps > i { flex: 1; height: 8px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: var(--well); }
.steps > [aria-current="step"] { background: color-mix(in srgb, var(--sleep) 50%, var(--surface-2)); }

/* ---------- Dica na página ---------- */
.hint { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; border-radius: 16px; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.3; text-decoration: none; }
.hint > .ic { width: 18px; height: 18px; color: var(--sleep); }
.hint > .ic:last-child { margin-left: auto; color: var(--muted); }
.hint-tint { border: 0; background: color-mix(in srgb, var(--tone, var(--sleep)) 16%, var(--surface)); color: var(--text); }

/* ---------- Tela vazia e mensagens: mascote, título, texto e uma ação ---------- */
.empty-state { display: grid; justify-items: center; gap: 12px; padding: 28px 16px; text-align: center; }
.empty-state b { font: 700 20px/1.15 var(--font-display); }
.empty-state p { margin: -4px 0 4px; max-width: 30ch; color: var(--muted); font-weight: 700; }
/* o mascote vem num quadrado violeta: a máscara redonda desfaz a borda e ele parece uma bola de pelúcia */
.mascot { width: 132px; height: 132px; border-radius: 50%; -webkit-mask-image: radial-gradient(circle, #000 56%, transparent 70%); mask-image: radial-gradient(circle, #000 56%, transparent 70%); }

/* ---------- Janela de baixo (sheet) · abre e fecha com sheet() de /js/components.js ---------- */
html.sheet-open { overflow: hidden; }
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; transition: opacity var(--t-move) ease; }
.scrim[data-open] { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; display: flex; flex-direction: column;
  margin: 0 auto; max-width: 560px; max-height: 88dvh;
  background: var(--surface); color: var(--text); border-radius: 30px 30px 0 0; box-shadow: var(--rim), 0 -20px 50px -24px rgba(8, 0, 24, .7);
  transform: translateY(100%); transition: transform 300ms var(--ease-drawer); /* sai mais rápido do que entra */
}
.sheet[data-open] { transform: none; transition-duration: var(--t-sheet); }
.sheet.is-dragging { transition: none; -webkit-user-select: none; user-select: none; } /* o dedo manda: sem atraso */
.sheet:focus { outline: none; }
.sheet::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: inherit; } /* puxada para cima não abre fresta embaixo */
.sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 14px; align-content: start;
  padding: 28px max(18px, env(safe-area-inset-right, 0px)) calc(22px + var(--safe-bottom)) max(18px, env(safe-area-inset-left, 0px));
}
.sheet .grab { position: absolute; top: 10px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line); }
.sheet h2 { margin: 2px 0 0; padding-right: 40px; font: 700 22px/1.15 var(--font-display); }
.sheet p { margin: -6px 0 0; color: var(--muted); font-size: var(--fs-2); }
.sheet-x { position: absolute; top: 8px; right: max(8px, env(safe-area-inset-right, 0px)); z-index: 1; }
.sheet-x .ic { width: 20px; height: 20px; }
.sheet-form { display: grid; gap: 14px; }
.sheet-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 10px; }

/* ---------- Aviso rápido (toast) · toast() de /js/components.js ---------- */
/* #toast-live fica sem position: ela criaria um contexto de empilhamento e o aviso ficaria atrás da janela de baixo */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--tabs-gap) + 14px); z-index: 60; translate: -50% 0; /* centraliza sem ocupar o transform */
  width: max-content; max-width: min(92vw, 480px); display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 20px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: 14.5px; font-weight: 800;
  pointer-events: none; /* os toques passam, menos no botão */
  opacity: 0; transform: translateY(12px) scale(.96); transition: opacity 160ms ease, transform 160ms var(--ease-out);
}
.toast[data-open] { opacity: 1; transform: none; transition-duration: 240ms; }
.toast-btn { position: relative; flex: none; min-height: 34px; margin: -6px -12px -6px 0; padding: 0 14px; border-radius: var(--r-pill); background: var(--bg); color: var(--text); font-weight: 900; pointer-events: auto; }
.toast-btn::after { content: ""; position: absolute; inset: -5px; } /* área de toque de 44 px */

/* ---------- Barra de abas: pílula de vidro flutuando ---------- */
/* a aba ativa troca na hora: usa-se dezenas de vezes por dia, animar atrasaria */
.tabs {
  position: fixed; left: 50%; bottom: var(--tabs-gap); z-index: 20; translate: -50% 0; width: min(calc(100% - 32px), 440px); height: var(--tabs-h);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px; border-radius: var(--r-pill);
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--line); box-shadow: var(--rim), 0 16px 34px -16px rgba(8, 0, 24, .75);
}
.tab {
  display: grid; align-content: center; justify-items: center; gap: 1px; border-radius: var(--r-pill);
  color: var(--muted); font-size: 11.5px; font-weight: 800; text-decoration: none;
  transition: transform var(--t-spring) var(--ease-spring);
}
.tab .ic { width: 23px; height: 23px; }
.tab[aria-current="page"] { color: var(--text); background: color-mix(in srgb, var(--accent) 20%, transparent); }
.tab[aria-current="page"] .ic { color: var(--sleep); }

/* ---------- Dormiu / Acordou: o ativo cresce, se enche de pelúcia e mostra o cronômetro ---------- */
/* altura base pela tela; cresce no espaço que sobrar (até 270 px), para o Início caber numa tela só */
.pair { display: flex; gap: 10px; flex: 1 0 auto; height: clamp(176px, 25dvh, 230px); max-height: 270px; }
.st {
  flex: 1 1 0; min-width: 0; container-type: inline-size;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left;
  padding: 16px 14px 15px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--rim), var(--lift); color: var(--text);
  transition: flex-grow 500ms var(--ease-drawer), color 350ms ease, border-color 350ms ease, transform var(--t-spring) var(--ease-spring);
}
.st::before { transition-duration: 350ms; }
.st[data-k="sleep"] { --tone: var(--sleep); --tone-ink: var(--sleep-ink); }
.st[data-k="awake"] { --tone: var(--awake); --tone-ink: var(--awake-ink); --shine: .36; }
.st:disabled { cursor: progress; }
.st.on { flex-grow: 1.45; border-color: transparent; color: var(--tone-ink); }
.st > .ic { width: 30px; height: 30px; }
.st:not(.on) > .ic { color: var(--muted); }
.st-label { font: 700 clamp(19px, 19cqi, 25px)/1.1 var(--font-display); }
.st-live { display: none; flex-direction: column; gap: 3px; width: 100%; }
.st.on .st-label { display: none; }
.st.on .st-live { display: flex; }
.st-cap { font-size: var(--fs-2); font-weight: 800; opacity: .85; }
.st-time { font-family: var(--font-display); font-weight: 700; line-height: 1; white-space: nowrap; }
.st-time .dg { width: .58em; } /* o algarismo mais largo da Fredoka tem 0,566em */
.st-time .big { font-size: clamp(30px, 26cqi, 50px); }
.st-time .sm { font-size: clamp(16px, 13cqi, 26px); opacity: .65; }
.st-since { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 13px; font-weight: 800; opacity: .8; }
.st-since .ic { width: 14px; height: 14px; }
/* branco sobre o --sleep do claro: com a opacidade ficaria abaixo de 4,5:1 (AA) */
:root[data-theme="light"] .st.on[data-k="sleep"] :is(.st-cap, .st-since) { opacity: 1; }

/* ---------- Tons: trocam a cor de bolhas, chips, cartões e botões (class="bubble tone-milk") ---------- */
/* com texto por cima, só estes; rosa e azul ficam para enfeite (.dot) porque não dão contraste com letra pequena */
.tone-sleep { --tone: var(--sleep); --tone-ink: var(--sleep-ink); }
.tone-awake { --tone: var(--awake); --tone-ink: var(--awake-ink); --shine: .36; }
.tone-milk { --tone: var(--milk); --tone-ink: var(--milk-ink); --shine: .36; }
.tone-ok { --tone: var(--ok); --tone-ink: var(--ok-ink); }
.tone-danger { --tone: var(--danger); --tone-ink: var(--danger-ink); }
.tone-pink { --tone: var(--pink); --tone-ink: var(--pink-ink); }

/* ---------- Mouse e movimento reduzido ---------- */
@media (hover: hover) and (pointer: fine) { /* no toque, o hover fica preso depois de tocar */
  .btn:hover:not(:disabled), .icon-btn:hover, button.chip:hover, :is(button, a).card:hover, .choice > button:hover { filter: brightness(1.07); }
  .tab:hover { color: var(--text); }
}
@media (prefers-reduced-motion: reduce) {
  /* menos e mais suave, não zero: saem os deslocamentos, ficam cor e opacidade */
  *, *::before, *::after { transition-property: opacity, color, background-color, border-color, box-shadow !important; }
  .sheet:not([data-open]) { opacity: 0; }
}
