/* IronTrack — identidade visual
   Layout: celular = barra superior + conteúdo em coluna + barra inferior com "Treinar" central;
   computador (≥ 900px) = barra lateral fixa + conteúdo em grade de 2 colunas. */
:root {
  /* Cor — preto com leve viés verde, verde-limão como único destaque */
  --bg: #0b0c0b;
  --surface: #141614;
  --surface-2: #1c1f1c;
  --line: #2a2e29;
  --fg: #f4f6f1;
  --muted: #a6ada2;
  --dim: #6f766b;
  --lime: #c6f432;
  --lime-soft: rgba(198, 244, 50, 0.12);
  --on-lime: #0b0c0b;
  --warn: #f5b83d;
  --warn-soft: rgba(245, 184, 61, 0.12);
  --danger: #ff6b5e;
  --danger-soft: rgba(255, 107, 94, 0.12);

  /* Tipografia — fontes do próprio aparelho: carregam instantaneamente e funcionam offline */
  --font-ui: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.5rem;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --tap: 48px;
  --tabbar-h: 68px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.15; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 6px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.noscript { padding: 24px; color: var(--fg); }

/* Faixa da barra de status do iPhone */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 30; background: var(--bg);
}

/* ---------- Estrutura ---------- */
.app { min-height: 100%; }
.main { min-width: 0; }
.sidebar { display: none; }

.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 8px;
  min-height: 60px;
  padding-block: 8px;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  background: rgba(11, 12, 11, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar-title h1 { font-size: var(--fs-lg); font-weight: 750; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim);
}
.eyebrow:empty { display: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: var(--tap); height: var(--tap); flex: none;
  border: 0; border-radius: 999px; background: transparent; color: var(--fg); cursor: pointer;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; }

.view {
  display: flex; flex-direction: column; gap: 16px;
  padding-top: 16px;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px);
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  max-width: 720px; margin: 0 auto;
  outline: none;
}

/* ---------- Barra inferior ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(14, 16, 14, 0.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar-h);
  color: var(--dim); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.01em;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--lime); }
.tab-primary { position: relative; }
.tab-primary .tab-disc {
  display: grid; place-items: center;
  width: 54px; height: 54px; margin-top: -18px; border-radius: 999px;
  background: var(--lime); color: var(--on-lime);
  box-shadow: 0 0 0 5px var(--bg);
}
.tab-primary .tab-disc svg { width: 28px; height: 28px; }
.tab-primary[aria-current="page"] { color: var(--fg); }
.tab-primary:active .tab-disc { transform: scale(0.96); }

/* ---------- Computador ---------- */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 24px;
    position: sticky; top: 0; height: 100vh;
    padding: 24px 16px; border-right: 1px solid var(--line); background: var(--surface);
  }
  .view { max-width: 980px; padding-bottom: 48px; padding-left: 32px; padding-right: 32px; }
  .topbar { padding-left: 32px; padding-right: 32px; }
  #more-btn { display: none; }
  .view .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .view .grid-2 > .span-2 { grid-column: 1 / -1; }
  .today .btn-stack { flex-direction: row; }
  .today .btn-stack > .btn { flex: 1; }
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: var(--lime) url("../icons/mark.svg") center / 26px no-repeat;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.02em; }
.brand-text small { font-size: 0.6875rem; color: var(--dim); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-group { margin: 16px 12px 6px; font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.side-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--muted); font-weight: 600;
}
.side-link svg { width: 20px; height: 20px; }
.side-link:hover { background: var(--surface-2); color: var(--fg); }
.side-link[aria-current="page"] { background: var(--lime-soft); color: var(--lime); }
.side-foot { margin-top: auto; padding: 0 12px; font-size: var(--fs-xs); color: var(--dim); }

/* ---------- Componentes ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { font-size: var(--fs-md); font-weight: 700; }
.card-link { font-size: var(--fs-sm); font-weight: 600; color: var(--lime); display: inline-flex; align-items: center; gap: 2px; min-height: 32px; }
.card-link svg { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.label { font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }

/* Bloco principal "Treino de hoje" */
.today {
  border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px;
  background: linear-gradient(160deg, #1a2010 0%, var(--surface) 55%);
  border: 1px solid #2f3a1a;
}
.today h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--fg);
  font-size: var(--fs-md); font-weight: 700; cursor: pointer; text-align: center;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 140px; }
.btn-stack { display: flex; flex-direction: column; gap: 8px; }
.phase-tag {
  font-size: 0.625rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--line);
}
.btn-primary .phase-tag { background: rgba(0,0,0,0.15); color: var(--on-lime); border-color: transparent; }

/* Faixa da semana */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.day-name { font-size: 0.6875rem; font-weight: 650; color: var(--dim); text-transform: uppercase; }
.day-dot {
  width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 10px;
  display: grid; place-items: center; font-size: var(--fs-sm); font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid transparent;
}
.day.is-today .day-dot { border-color: var(--lime); color: var(--fg); }
.day.is-completed .day-dot { background: var(--lime); color: var(--on-lime); }
.day.is-incomplete .day-dot { background: var(--warn); color: var(--on-lime); }
.day.is-cancelled .day-dot { background: transparent; border-color: var(--dim); color: var(--dim); text-decoration: line-through; }

/* Estatísticas */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px; min-width: 0; }
.stat-value { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: var(--fs-xl); font-weight: 750; line-height: 1.1; }
.stat-value.is-empty { color: var(--dim); }
.stat-label { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }

/* Estado vazio */
.empty { display: flex; gap: 12px; align-items: flex-start; padding: 4px 0; }
.empty-icon {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--dim);
}
.empty-icon svg { width: 20px; height: 20px; }
.empty-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.empty-body strong { font-weight: 650; }
.empty-body p { font-size: var(--fs-sm); color: var(--muted); }
.empty-hero { text-align: center; align-items: center; flex-direction: column; padding: 24px 8px; }
.empty-hero .empty-icon { width: 56px; height: 56px; border-radius: 16px; }
.empty-hero .empty-icon svg { width: 28px; height: 28px; }
.empty-hero .empty-body { align-items: center; max-width: 34ch; }

/* Avisos */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); font-size: var(--fs-sm); }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.notice-warn { background: var(--warn-soft); color: #f8d38a; }
.notice-warn svg { color: var(--warn); }
.notice-info { background: var(--surface-2); color: var(--muted); }
.notice strong { color: var(--fg); }
.notice-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* Atalhos */
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shortcut {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px;
  background: var(--surface-2); border-radius: var(--r-md); font-weight: 650; min-width: 0;
}
.shortcut svg { width: 20px; height: 20px; color: var(--lime); flex: none; }
.shortcut:active { background: var(--line); }

/* Lista de menu */
.menu { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.menu-item:active { background: var(--surface-2); }
.menu-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--lime-soft); color: var(--lime); flex: none; }
.menu-icon svg { width: 20px; height: 20px; }
.menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-text strong { font-weight: 650; }
.menu-text span { font-size: var(--fs-sm); color: var(--muted); }
.menu-chev { color: var(--dim); width: 20px; height: 20px; flex: none; }

/* Controle segmentado */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.segmented button {
  min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  font-weight: 650; font-size: var(--fs-sm); cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* Calendário */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head h3 { font-size: var(--fs-md); font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-dow { font-size: 0.6875rem; font-weight: 650; color: var(--dim); padding: 4px 0; text-transform: uppercase; }
.cal-day {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px;
  font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--muted); background: var(--surface-2);
}
.cal-day.is-out { background: transparent; color: var(--line); }
.cal-day.is-today { outline: 2px solid var(--lime); outline-offset: -2px; color: var(--fg); font-weight: 700; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: var(--fs-xs); color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-done { background: var(--lime); }
.sw-partial { background: var(--warn); }
.sw-cancel { background: var(--dim); }

/* Linhas de informação */
.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.kv-row:last-child { border-bottom: 0; }
.kv-row span:first-child { color: var(--muted); }
.kv-row span:last-child { font-weight: 650; text-align: right; }

.prose { display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); color: var(--muted); max-width: 65ch; }
.prose strong { color: var(--fg); }
.prose ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

/* Formulário de ajustes */
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field-text label, .field-text strong { font-weight: 650; font-size: var(--fs-sm); }
.field-text span { font-size: var(--fs-xs); color: var(--muted); }
.field .segmented { flex: none; min-width: 120px; }
.switch { position: relative; flex: none; width: 52px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background 120ms; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 999px; background: var(--fg); transition: transform 120ms; }
.switch input:checked + .track { background: var(--lime); }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--on-lime); }
.switch input:focus-visible + .track { outline: 2px solid var(--lime); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; flex: none; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--fg); font-size: 1.25rem; font-weight: 700; cursor: pointer; }
.stepper button:active { background: var(--line); }
.stepper output { min-width: 64px; text-align: center; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 700; }
.save-state { font-size: var(--fs-xs); color: var(--dim); min-height: 1.2em; }
.save-state.is-ok { color: var(--lime); }
.save-state.is-error { color: var(--danger); }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--lime); border-radius: inherit; min-width: 2px; }
.problems { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }

/* Campos de formulário (16px evita zoom automático no iPhone) */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-row > label, .form-label { font-size: var(--fs-sm); font-weight: 650; }
.form-hint { font-size: var(--fs-xs); color: var(--muted); }
.form-error { font-size: var(--fs-sm); color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--fg);
  font: inherit; font-size: 16px;
}
.textarea { min-height: 88px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--lime); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.search .input { padding-left: 38px; }

/* Fichas de escolha (chips) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter-l)); margin-right: calc(-1 * var(--gutter-r)); padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-weight: 650; font-size: var(--fs-sm); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.chip-day { min-width: 0; justify-content: center; padding: 0; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 650; }
.tag-lime { background: var(--lime-soft); color: var(--lime); }

/* Lista de fichas */
.plan-card { display: flex; flex-direction: column; gap: 10px; }
.plan-top { display: flex; align-items: flex-start; gap: 12px; }
.plan-letter {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: var(--lime-soft); color: var(--lime); font-family: var(--font-num); font-weight: 800; font-size: var(--fs-lg);
}
.plan-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.plan-main h3 { font-size: var(--fs-md); font-weight: 750; overflow-wrap: anywhere; }
.plan-main p { font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.plan-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-actions .btn { min-height: 44px; padding: 0 14px; font-size: var(--fs-sm); flex: 1 1 auto; }
.archived .plan-letter { background: var(--surface-2); color: var(--dim); }

/* Itens da ficha */
.item { display: flex; align-items: stretch; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 8px 8px 12px; }
.item-num { width: 24px; flex: none; display: grid; place-items: center; color: var(--dim); font-family: var(--font-num); font-weight: 700; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 0; background: none; border: 0; text-align: left; color: inherit; cursor: pointer; }
.item-body strong { font-weight: 700; overflow-wrap: anywhere; }
.item-body span { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.item-side { display: flex; flex-direction: column; justify-content: center; }
.item-side .icon-btn { width: 40px; height: 40px; }
.icon-btn[disabled] { opacity: 0.25; cursor: default; }
.icon-btn.small svg { width: 20px; height: 20px; }

/* Lista de exercícios */
.ex-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.ex-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.ex-row:last-child { border-bottom: 0; }
.ex-row:active { background: var(--surface-2); }
.ex-row .menu-text strong { overflow-wrap: anywhere; }
.ex-row.is-added { background: var(--lime-soft); }
.ex-row .check { width: 22px; height: 22px; color: var(--lime); flex: none; }
.group-title { margin: 8px 4px 0; }
.sheet .ex-list { max-height: 50vh; overflow: auto; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; }
.stepper-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stepper-row:last-child { border-bottom: 0; }

/* Treino em andamento */
.session-head { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 61px); z-index: 15; }
@media (min-width: 900px) { .session-head { top: 61px; } }
.session-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line);
}
.session-bar .elapsed { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: var(--fs-lg); font-weight: 750; }
.session-bar .progress-text { font-size: var(--fs-xs); color: var(--muted); }
.session-bar .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 4px; }
.progress > span { display: block; height: 100%; background: var(--lime); }

.ex-card { gap: 10px; padding: 14px 12px; }
.ex-card.is-complete { border-color: #3a4a1a; }
.ex-head { display: flex; align-items: flex-start; gap: 8px; }
.ex-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ex-head h3 { font-size: var(--fs-md); font-weight: 750; overflow-wrap: anywhere; }
.ex-meta { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.ex-last { font-size: var(--fs-xs); color: var(--dim); font-variant-numeric: tabular-nums; }
.ex-last strong { color: var(--muted); font-weight: 650; }

.set-grid-head, .set-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 0.8fr) 52px; gap: 6px; align-items: center;
}
.set-grid-head { font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); padding: 0 2px; }
.set-grid-head span:nth-child(2), .set-grid-head span:nth-child(3) { text-align: center; }
.set-num {
  height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg);
  font-family: var(--font-num); font-weight: 750; font-size: var(--fs-md); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.set-num small { font-size: 0.5625rem; font-family: var(--font-ui); font-weight: 750; letter-spacing: 0.04em; color: var(--warn); margin-top: 3px; }
.set-input {
  width: 100%; height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  text-align: center; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.125rem; font-weight: 700; padding: 0 4px;
}
.set-input::placeholder { color: var(--dim); font-weight: 600; }
.set-input:focus { outline: none; border-color: var(--lime); }
.set-input[aria-invalid="true"] { border-color: var(--danger); }
.set-check {
  height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--dim); cursor: pointer;
  display: grid; place-items: center;
}
.set-check svg { width: 24px; height: 24px; }
.set-row.is-done .set-check { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.set-row.is-done .set-input { background: var(--surface); border-color: transparent; }
.set-row.is-warmup .set-num, .set-row.is-prep .set-num { border-style: dashed; }
.set-follow { margin: -2px 0 4px 50px; display: flex; flex-direction: column; gap: 8px; }
.set-follow .label { margin: 0; }
.effort-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.rir-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.pain-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.pick {
  min-height: 40px; padding: 4px 2px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 0.75rem; font-weight: 700; cursor: pointer; line-height: 1.1;
}
.pick[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pick.e1[aria-pressed="true"] { background: #7fb3ff; border-color: #7fb3ff; color: #08101c; }
.pick.e2[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.pick.e3[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); color: #1c1203; }
.pick.e4[aria-pressed="true"] { background: var(--danger); border-color: var(--danger); color: #1a0705; }
.pick.p-bad[aria-pressed="true"] { background: var(--danger); border-color: var(--danger); color: #1a0705; }
.set-summary {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 32px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: var(--fs-xs); font-weight: 650; cursor: pointer;
}
.set-summary.is-missing { color: var(--lime); border-color: #3a4a1a; }
.set-summary svg { width: 14px; height: 14px; flex: none; }
.set-summary { flex-wrap: wrap; text-align: left; }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.dot.e1 { background: #7fb3ff; } .dot.e2 { background: var(--lime); } .dot.e3 { background: var(--warn); } .dot.e4 { background: var(--danger); }
.ex-actions { display: flex; gap: 6px; }
.ex-actions .btn { min-height: 44px; font-size: var(--fs-sm); flex: 1; }
.notice-pain { background: var(--danger-soft); color: #ffb3ab; }
.notice-pain svg { color: var(--danger); }

/* Cronômetro de descanso */
.elapsed-btn { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; text-align: left; align-self: flex-start; }
.session-head { display: flex; flex-direction: column; gap: 6px; }
.rest-bar {
  --rest-pct: 100%;
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 8px 8px 8px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); min-height: 60px;
}
.rest-bar > * { position: relative; }
.rest-bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; background: var(--lime-soft); }
.rest-bar.is-running::before { width: var(--rest-pct); transition: width 250ms linear; }
.rest-bar .rest-label { grid-column: 1; font-weight: 750; font-size: var(--fs-sm); }
.rest-bar .rest-time { grid-column: 1; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.75rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; }
.rest-bar .rest-sub { grid-column: 1; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest-bar .rest-start, .rest-bar .rest-ctrls { grid-column: 2; grid-row: 1 / span 2; }
.rest-bar .rest-start { min-height: 44px; font-size: var(--fs-sm); padding: 0 14px; }
.rest-ctrls { display: flex; gap: 4px; }
.rest-btn {
  min-width: 44px; height: 44px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg);
  font-family: var(--font-num); font-weight: 750; font-size: var(--fs-sm); cursor: pointer; display: grid; place-items: center;
}
.rest-btn svg { width: 20px; height: 20px; }
.rest-btn.is-main { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.rest-btn.wide { padding: 0 12px; }
.rest-bar.is-paused .rest-time { color: var(--muted); }
.rest-bar.is-done { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.rest-bar.is-done .rest-sub { color: rgba(11,12,11,0.7); }
.rest-bar.is-done .rest-btn { background: rgba(11,12,11,0.12); border-color: transparent; color: var(--on-lime); }
.rest-bar.flash { animation: rest-flash 400ms ease-in-out 4; }
@keyframes rest-flash { 50% { filter: brightness(1.35); transform: scale(1.01); } }
@media (max-width: 360px) { .rest-btn { min-width: 40px; } }

/* Histórico */
.filters { display: flex; flex-direction: column; gap: 8px; }
.filter-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.filter-row .select { min-height: 44px; font-size: 16px; padding: 8px 28px 8px 10px; }
@media (max-width: 420px) { .filter-row { grid-template-columns: 1fr 1fr; } .filter-row > :last-child:nth-child(3) { grid-column: 1 / -1; } }
.hist-item { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.hist-item:last-child { border-bottom: 0; }
.hist-item:active { background: var(--surface-2); }
.status-line-completed { border-left-color: var(--lime); }
.status-line-incomplete { border-left-color: var(--warn); }
.status-line-cancelled { border-left-color: var(--dim); }
.status-line-cancelled .menu-text strong { color: var(--muted); }
.status-line-active { border-left-color: var(--fg); }
.hist-date { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.hist-date strong { font-family: var(--font-num); font-size: var(--fs-lg); font-weight: 800; }
.hist-date span { font-size: 0.6875rem; color: var(--dim); text-transform: uppercase; font-weight: 650; }
.hist-item .menu-text span { font-variant-numeric: tabular-nums; }
.cal-day { border: 0; font: inherit; cursor: default; position: relative; }
.cal-day.has-completed, .cal-day.has-incomplete, .cal-day.has-cancelled, .cal-day.has-active { cursor: pointer; font-weight: 750; }
.cal-day.has-completed { background: var(--lime); color: var(--on-lime); }
.cal-day.has-incomplete { background: var(--warn); color: #1c1203; }
.cal-day.has-cancelled { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--dim); text-decoration: line-through; }
.cal-day.has-active { background: var(--fg); color: var(--bg); }
.cal-day.is-selected { outline: 2px solid var(--fg); outline-offset: 1px; }
.cal-count { position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 999px; background: currentColor; }

/* Comparação */
.cmp-row { gap: 10px; }
.cmp-row:active { background: var(--surface-2); }
.cmp-date { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cmp-date .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.set-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); font-size: var(--fs-sm); font-weight: 650; font-variant-numeric: tabular-nums; }
.set-chip small { font-size: 0.625rem; color: var(--warn); font-weight: 750; }
.set-chip.is-warm { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.set-chip.is-best { box-shadow: inset 0 0 0 1.5px var(--lime); }
.cmp-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.delta { font-size: var(--fs-xs); font-weight: 750; }
.delta.up { color: var(--lime); } .delta.down { color: var(--danger); } .delta.same { color: var(--muted); }

/* Gráficos */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chart { margin: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--dim); stroke-width: 1; }
.chart .tick { fill: var(--dim); font-size: 10px; font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--fg); font-size: 11px; font-weight: 750; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--lime); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--lime); opacity: 0.1; }
.chart .dot { fill: var(--lime); stroke: var(--surface); stroke-width: 2; }
.chart .col { fill: var(--lime); opacity: 0.55; }
.chart .col.is-current { opacity: 1; }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit:focus-visible { stroke: var(--fg); stroke-width: 1.5; }
.chart rect.hit.is-hovered { fill: rgba(244, 246, 241, 0.06); }
.chart circle.hit.is-hovered { fill: rgba(198, 244, 50, 0.18); }
.chart-tip {
  position: fixed; z-index: 80; pointer-events: none; display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: 10px; background: var(--fg); color: var(--bg); font-size: var(--fs-xs); max-width: 240px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
.chart-tip strong { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.chart-tip span { color: #4a4f47; }
.seg-sm button { min-height: 36px; font-size: var(--fs-xs); }
.seg-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(84px, 34%) minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 28px; border-radius: 6px; outline: none; }
.hbar:focus-visible, .hbar.is-hovered { background: rgba(244, 246, 241, 0.05); }
.hbar-label { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--lime); border-radius: 0 4px 4px 0; }
.hbar-value { font-size: var(--fs-sm); font-weight: 700; min-width: 3ch; text-align: right; }
.chart-table summary { cursor: pointer; font-size: var(--fs-sm); color: var(--muted); font-weight: 650; min-height: 32px; display: flex; align-items: center; }
.table-wrap { overflow-x: auto; }
.table-wrap table, .cmp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.table-wrap th, .table-wrap td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap thead th { color: var(--dim); font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; }
.table-wrap tbody th { font-weight: 650; }
.cmp-table td, .cmp-table thead th:not(:first-child) { text-align: right; }
.rbl { display: flex; flex-direction: column; }
.rbl-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.rbl-row:last-child { border-bottom: 0; }
.rbl-load { font-weight: 750; }
.rbl-seq { color: var(--muted); overflow-wrap: anywhere; }
.pr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pr-list li a { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pr-list li:last-child a { border-bottom: 0; }
.pr-ico { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--lime-soft); color: var(--lime); }
.pr-ico svg { width: 18px; height: 18px; }

/* Resumo da sessão */
.status-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 750; }
.status-completed { background: var(--lime-soft); color: var(--lime); }
.status-incomplete { background: var(--warn-soft); color: var(--warn); }
.status-cancelled { background: var(--surface-2); color: var(--muted); }
.status-active { background: var(--lime); color: var(--on-lime); }
.log-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.log-list li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.log-list li:last-child { border-bottom: 0; }
.log-list .n { width: 22px; color: var(--dim); font-family: var(--font-num); flex: none; }
.log-list .v { font-weight: 700; flex: none; }
.log-list .x { color: var(--muted); min-width: 0; }
.log-list li.is-skip { color: var(--dim); }

.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); cursor: pointer; }
.check-row input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--danger); }

/* Corpo e medidas */
.measure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.measure { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); color: var(--muted); font-weight: 650; min-width: 0; }
.measure span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.body-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.stat-btn { border: 1px solid transparent; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.stat-btn.is-on { border-color: var(--lime); }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.photo-thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--surface-2); cursor: pointer; max-width: 100%; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb span { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; background: rgba(11,12,11,0.75); color: var(--fg); font-size: 0.625rem; font-weight: 700; }
.photo-thumb.is-picked { border-color: var(--lime); }
.photo-preview { max-height: 40vh; width: auto; max-width: 100%; align-self: center; border-radius: 12px; }
.photo-full { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 12px; background: var(--bg); }
.photo-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.photo-compare figure { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.photo-compare img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--bg); }
.photo-compare figcaption { font-size: var(--fs-xs); color: var(--muted); }
.photo-compare figcaption strong { color: var(--fg); }
label.btn { cursor: pointer; }

/* Sugestões de progressão */
.sg-badge { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 8px; border-radius: 999px; font-size: 0.6875rem; font-weight: 750; white-space: nowrap; flex: none; }
.sg-badge svg { width: 13px; height: 13px; }
.sg-up { background: var(--lime); color: var(--on-lime); }
.sg-hold { background: var(--surface-2); color: var(--muted); }
.sg-muted { background: transparent; color: var(--dim); border: 1px solid var(--line); }
.sg-warn { background: var(--warn-soft); color: var(--warn); }
.sg-alert { background: var(--danger-soft); color: var(--danger); }
.sg-row .menu-text span { white-space: normal; }
.sg-chip { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; max-width: 100%; margin-top: 4px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: var(--fs-xs); font-weight: 650; cursor: pointer; text-align: left; }
.sg-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sg-mini { align-self: center; border: 0; background: none; padding: 0; cursor: pointer; }
.sg-reasons, .sg-evidence { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }
.sg-reasons { list-style: none; padding-left: 0; }
.target-line { color: var(--lime) !important; font-weight: 650; }

/* Resumo inteligente */
.insight-link { flex-direction: row; align-items: center; gap: 14px; }
.insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.insights li { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.insights li:last-child { border-bottom: 0; padding-bottom: 0; }
.insights p { font-size: var(--fs-sm); }
.kind { display: inline-flex; align-self: flex-start; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 999px; font-size: 0.625rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.k-med { background: var(--lime-soft); color: var(--lime); }
.k-est { background: rgba(127, 179, 255, 0.14); color: #9cc4ff; }
.k-hip { background: var(--warn-soft); color: var(--warn); }
.ai-text { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.4; }

/* Instalação e atualização */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.steps strong { color: var(--fg); }
.ok-text { color: var(--lime); }
.update-banner {
  position: fixed; z-index: 65; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 8px);
  margin: 0 auto; width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--lime); box-shadow: 0 8px 24px rgba(0,0,0,0.5); font-size: var(--fs-sm);
}
.update-banner span { flex: 1; min-width: 0; }
.update-banner .btn { min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); }
.update-banner .icon-btn { width: 36px; height: 36px; }

/* Avisos rápidos (toast) */
.toasts {
  position: fixed; z-index: 60; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast {
  pointer-events: auto; max-width: 440px; width: 100%;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--fg); color: var(--bg); font-size: var(--fs-sm); font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: toast-in 180ms ease-out;
}
.toast svg { width: 18px; height: 18px; flex: none; }
.toast-error { background: var(--danger); color: #1a0705; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Painel inferior (sheet) e confirmação */
.sheet-root:empty { display: none; }
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 900px) { .sheet-backdrop { align-items: center; } }
.sheet {
  width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 20px var(--gutter-r) calc(20px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  display: flex; flex-direction: column; gap: 16px;
  animation: sheet-in 200ms ease-out;
}
@media (min-width: 900px) { .sheet { border-radius: var(--r-lg); padding: 24px; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); align-self: center; margin-top: -8px; }
.sheet h2 { font-size: var(--fs-lg); font-weight: 750; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Carregamento */
.boot { display: grid; place-items: center; min-height: 50vh; color: var(--dim); font-size: var(--fs-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Conta e sincronização */
.sync-ind { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 999px; color: var(--muted); }
.sync-ind svg { width: 22px; height: 22px; }
.sync-ind .sync-dot { position: absolute; right: 9px; bottom: 10px; width: 9px; height: 9px; border-radius: 999px; background: var(--dim); box-shadow: 0 0 0 2px var(--bg); }
.sync-ind.st-synced .sync-dot { background: var(--lime); }
.sync-ind.st-syncing .sync-dot { background: #7fb3ff; animation: sync-pulse 1s ease-in-out infinite; }
.sync-ind.st-pending .sync-dot { background: var(--warn); }
.sync-ind.st-error .sync-dot { background: var(--danger); }
.sync-ind.st-offline .sync-dot { background: var(--dim); }
@keyframes sync-pulse { 50% { opacity: 0.35; } }
.sync-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 750; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.sync-chip .sync-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
.sync-chip.st-ok { color: var(--lime); background: var(--lime-soft); }
.sync-chip.st-busy { color: #9cc4ff; background: rgba(127, 179, 255, 0.14); }
.sync-chip.st-warn { color: var(--warn); background: var(--warn-soft); }
.sync-chip.st-err { color: var(--danger); background: var(--danger-soft); }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mode-opt { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--line); font-size: var(--fs-sm); min-width: 0; }
.mode-opt strong { display: flex; align-items: center; gap: 6px; }
.mode-opt strong svg { width: 16px; height: 16px; }
.mode-opt span { color: var(--muted); font-size: var(--fs-xs); }
.mode-opt.is-on { border-color: var(--lime); }
.code-box { padding: 14px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--lime); font-size: 1.05rem; font-weight: 800; letter-spacing: 0.04em; text-align: center; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.err-text { color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 10px; font-size: var(--fs-xs); }
