:root {
  --bg: #0e0e0d;
  --surface: #171715;
  --surface-2: #201f1c;
  --line: #2c2b27;
  --text: #f1efe8;
  --muted: #8f8c82;
  --accent: #ff6a2b;
  --accent-ink: #1a0b03;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(24px + var(--safe-b));
}
#app { max-width: 560px; margin: 0 auto; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Barra do topo */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.bar-title { flex: 1; min-width: 0; }
.bar-title h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.bar-title p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; margin: -6px; }
.icon-btn:active { background: var(--surface-2); }
.bar .icon-btn:last-child { margin-left: auto; }

main { padding: 16px; }
.section { padding: 20px 16px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.lead { color: var(--muted); margin-bottom: 20px; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 12px; }
.muted { color: var(--muted); }

/* Botões */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 54px; padding: 0 20px;
  border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line);
  font-weight: 600; font-size: 16px; text-align: center;
}
.btn + .btn { margin-top: 10px; }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { width: auto; min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.file { cursor: pointer; }

/* Início */
.empty { padding: 48px 20px; }
.empty h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px; }
.empty p { color: var(--muted); margin-bottom: 28px; }

.program-name { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 18px; }
.workouts { display: grid; gap: 10px; }
.workout {
  display: flex; align-items: stretch; gap: 16px; width: 100%; text-align: left;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.workout:active { background: var(--surface-2); }
.letter { flex: 0 0 44px; font-size: 56px; line-height: .9; font-weight: 800; letter-spacing: -.04em; color: var(--accent); }
.workout-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-top: 2px; }
.workout-meta { font-size: 13px; color: var(--muted); }
.workout-list { font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.resume {
  display: grid; grid-template-columns: 1fr auto; align-items: center; row-gap: 2px;
  padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: rgba(255, 106, 43, .08);
}
.resume-label { grid-column: 1; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.resume-title { grid-column: 1; font-weight: 600; }
.resume-go { grid-column: 2; grid-row: 1 / 3; font-weight: 700; color: var(--accent); }

.notice { padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.notice p { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.notice strong { color: var(--text); }

/* Treino */
.workout-view { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card.done { border-color: rgba(255, 106, 43, .45); }
.card-head { padding: 14px 16px 0; }
.index { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.card.done .count { color: var(--accent); }
.card h3 { font-size: 20px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; margin-top: 4px; }
.meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.last { color: var(--muted); font-size: 14px; padding: 10px 16px 0; }

.figure { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; width: 100%; aspect-ratio: 3 / 1; background: var(--line); }
.figure:has(> svg) { aspect-ratio: 2 / 1; }
.figure .frame { display: grid; place-items: end start; padding: 8px 10px; background: var(--surface-2); }
.figure .frame span { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.figure > svg { grid-column: 1 / -1; width: 100%; height: 100%; background: var(--surface-2); }
.figure.has-image { display: block; background: #000; aspect-ratio: 16 / 10; }
.figure img { width: 100%; height: 100%; object-fit: contain; display: block; }

.carousel { position: relative; width: 100%; aspect-ratio: 2 / 1; background: var(--surface-2); }
.car-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; cursor: pointer; }
.car-track::-webkit-scrollbar { display: none; }
.car-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; scroll-snap-stop: always; user-select: none; -webkit-user-drag: none; }
.car-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 7px; pointer-events: none; }
.car-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .45; }
.car-dots i.on { background: var(--text); opacity: 1; }
.car-btn { position: absolute; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(14, 14, 13, .72); color: var(--text); font-size: 13px; font-weight: 600; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.car-photo { top: 8px; right: 8px; }
.car-play { bottom: 8px; right: 8px; }
.car-play .on-on, .carousel.playing .car-play .on-off { display: none; }
.carousel.playing .car-play .on-on { display: inline; }
.carousel.playing .car-play { border-color: var(--accent); color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 0; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.chip.on { border-color: var(--text); color: var(--text); background: var(--surface-2); }

.sets { display: grid; padding: 12px 8px 8px; }
.set { display: grid; grid-template-columns: 28px 1fr 1fr 56px; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 12px; }
.set.done { background: rgba(255, 106, 43, .08); }
.set-n { color: var(--muted); font-weight: 700; text-align: center; }
.field { display: flex; align-items: baseline; gap: 6px; height: 52px; padding: 0 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.field:focus-within { border-color: var(--text); }
.field input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 22px; font-weight: 700; padding: 0; }
.field input::placeholder { color: #827f76; font-weight: 400; font-size: 17px; }
.field span { color: var(--muted); font-size: 13px; }
.field.wide { flex: 1; }
.check { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; border: 1.5px solid var(--line); color: var(--muted); transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.check svg { width: 26px; height: 26px; stroke-width: 2.6; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.toggle { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; margin: 12px 16px 16px; width: calc(100% - 32px); border-radius: 14px; border: 1.5px solid var(--line); font-weight: 600; color: var(--muted); }
.toggle.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cardio-row { display: flex; gap: 10px; padding: 12px 16px 16px; }
.cardio-row .toggle { margin: 0; width: auto; flex: 1.3; padding: 0 12px; }
.cardio-row .field { height: 52px; }

.finish { padding: 12px 0 8px; }

/* Descanso dentro da barra do treino: faixa no topo e tempo no lugar do progresso */
.rest-line { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--line); overflow: hidden; }
.rest-line i { display: block; height: 100%; width: 100%; background: var(--accent); transition: width .25s linear; }
.rest-info {
  display: none; flex-direction: column; gap: 2px; min-width: 0; flex: 1;
  min-height: 44px; padding: 0; margin: 0; background: none; border: 0;
  color: var(--text); font: inherit; text-align: left;
}
.rest-info strong { font-size: 28px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.rest-info small { font-size: 13px; color: var(--muted); white-space: nowrap; }
body.resting .progress-normal { display: none; }
body.resting .rest-info { display: flex; }
body.rest-over .finish-bar { background: var(--accent); color: var(--accent-ink); border-top-color: var(--accent); }
body.rest-over .rest-line { display: none; }
body.rest-over .rest-info strong { font-size: 22px; color: var(--accent-ink); }
body.rest-over .rest-info small { display: none; }
body.rest-over .rest-info { justify-content: center; }
.rest-sheet-time { text-align: center; font-size: 44px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 16px; }
.rest-sheet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.rest-sheet-row .btn { margin-top: 0; }

.flash { position: fixed; inset: 0; z-index: 30; pointer-events: none; background: var(--accent); opacity: 0; }
.flash.on { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 30%, 60% { opacity: .85; } 15%, 45%, 100% { opacity: 0; } }

/* Importação */
.pv { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; overflow: hidden; }
.pv-head { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pv-head span { display: flex; flex-direction: column; }
.pv-head strong { font-size: 18px; }
.pv-head small, .radio small { color: var(--muted); font-size: 13px; }
.pv-active { display: flex; gap: 10px; align-items: center; padding: 12px 16px; color: var(--muted); font-size: 14px; border-bottom: 1px solid var(--line); }
.pv-workout { padding: 12px 16px; }
.pv-workout + .pv-workout { border-top: 1px solid var(--line); }
.pv-workout h4 { font-size: 13px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.pv-workout ul { list-style: none; margin: 0; padding: 0; }
.pv-workout li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; }
.pv-workout em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pv-workout em.tag-linked { color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0; }

/* Ajustes */
.settings .eyebrow { margin-top: 32px; }
.settings .eyebrow:first-child { margin-top: 0; }
.list { list-style: none; margin: 12px 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.list .row + .row { border-top: 1px solid var(--line); }
.radio, .switch { display: flex; align-items: center; gap: 12px; }
.radio span { display: flex; flex-direction: column; }
.switch input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); position: relative; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(20px); background: var(--accent-ink); }
.settings > .row { padding: 0; }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.seg { min-height: 44px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.seg.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.log { border-bottom: 1px solid var(--line); padding: 10px 0; }
.log summary { cursor: pointer; font-weight: 600; }
.log ul { color: var(--muted); font-size: 14px; padding-left: 18px; margin: 8px 0 0; }

/* Painel e aviso */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; }
.sheet[hidden] { display: none; }
.sheet-panel { width: 100%; max-width: 560px; margin: 0 auto; padding: 20px 16px calc(16px + var(--safe-b)); background: var(--surface); border-radius: 20px 20px 0 0; border-top: 1px solid var(--line); }
.sheet-title { font-weight: 700; font-size: 17px; margin-bottom: 16px; }
.sheet .btn[hidden] { display: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; transition: .2s ease;
  padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 15px;
  pointer-events: none; white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
body.has-tabs { padding-bottom: calc(84px + var(--safe-b)); }
body.has-tabs .toast { bottom: calc(84px + var(--safe-b)); }

/* Abas */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px max(8px, calc((100% - 560px) / 2)) calc(6px + var(--safe-b));
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabs[hidden] { display: none; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.tabs a:active { background: var(--surface-2); }
.tabs a.on { color: var(--text); }
.tabs a.on svg { stroke: var(--accent); }
.tabs svg { width: 24px; height: 24px; }
.tabs a:focus-visible, .hist-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Topo da tela inicial */
.home-top { padding: calc(28px + var(--safe-t)) 16px 0; }
.home-date { color: var(--muted); font-size: 15px; }
.home-top .program-name { margin: 2px 0 0; }
main.home { padding-top: 20px; }
.home-top + .empty { padding-top: 24px; }

/* Semana */
.week { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.day-name { font-size: 12px; color: var(--muted); }
.day.today .day-name { color: var(--text); font-weight: 700; }
.day-dot { width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.day.today .day-dot { border-color: var(--text); }
.day.future .day-dot { opacity: .4; }
.day.done .day-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day-dot.multi { font-size: 12px; letter-spacing: 0; }

/* Histórico */
.history { padding-top: 4px; }
.hist-month { font-size: 15px; font-weight: 700; color: var(--muted); margin: 22px 0 10px; }
.hist-month:first-child { margin-top: 6px; }
.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.hist-row:active { background: var(--surface-2); }
.hist-letter { font-size: 30px; line-height: 1; font-weight: 800; letter-spacing: -.03em; color: var(--accent); }
.hist-body { display: flex; flex-direction: column; min-width: 0; }
.hist-body strong { font-weight: 700; }
.hist-body small { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-date { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* Detalhe da sessão */
.session { display: grid; gap: 12px; }
.sess-meta { color: var(--muted); }
.sess-extra { color: var(--muted); font-size: 14px; margin-top: -6px; }
.sess-ex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; }
.sess-ex h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; overflow-wrap: anywhere; }
.sess-sets { list-style: none; margin: 0; padding: 0; }
.sess-sets li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.sess-sets li span { color: var(--muted); }

/* Ajuste rápido de carga (v1.4.0) */
.nudge { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px 8px 6px 44px; }
.nudge-btn { min-height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.nudge-btn:active { background: var(--line); }
.field input.bump { animation: bump .15s ease-out; transform-origin: left center; }
@keyframes bump { 50% { transform: scale(1.08); } }

/* Barra fixa do treino: progresso + Finalizar (o cronômetro cobre durante o descanso) */
.finish-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; align-items: center; gap: 14px;
  padding: 10px max(16px, calc((100% - 560px) / 2 + 16px)) calc(10px + var(--safe-b));
  background: var(--surface); border-top: 1px solid var(--line);
}
.finish-progress { color: var(--muted); font-size: 15px; white-space: nowrap; }
.finish-progress strong { color: var(--text); font-size: 20px; font-weight: 800; }
.finish-bar .btn { flex: 1; }
body.in-workout { padding-bottom: calc(96px + var(--safe-b)); }
body.in-workout .toast { bottom: calc(96px + var(--safe-b)); }

@media (prefers-reduced-motion: reduce) {
  .flash.on { animation-duration: 3s; }
  .rest-line i, .toast, .check { transition: none; }
  .field input.bump { animation: none; }
}

/* ---------- v1.5.0 ---------- */

/* Card da home: carrossel no topo (troca a cada 1 s, com esmaecimento) */
.workout { flex-wrap: wrap; row-gap: 14px; overflow: hidden; }
.home-car {
  position: relative; flex: 0 0 calc(100% + 32px); margin: -16px -16px 0;
  aspect-ratio: 3 / 1; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.home-car:empty { display: none; }
.workout .workout-body { flex: 1 1 0; }
.home-car img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .3s ease; user-select: none; -webkit-user-drag: none; }
.home-car img.on { opacity: 1; }

/* Ver o treino: cartões sem campos */
.card-pad { height: 14px; }

/* Botão redondo: ▶ inicia; ■ encerra segurando 3 s */
.finish-bar { justify-content: space-between; }
.finish-progress { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.finish-progress small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-btn {
  position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.round-btn svg { width: 28px; height: 28px; }
.round-btn .solid { fill: currentColor; stroke: none; }
.round-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.round-btn.start { background: var(--accent); color: var(--accent-ink); }
.round-btn.start:active { transform: scale(.94); }
.round-btn.stop { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.round-btn .ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); pointer-events: none; }
.round-btn .ring circle { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 185.4; stroke-dashoffset: 185.4; transition: stroke-dashoffset .2s ease; }
.round-btn.holding .ring circle { stroke-dashoffset: 0; transition: stroke-dashoffset 3s linear; }
.round-btn.holding { color: var(--accent); }
body.has-bar { padding-bottom: calc(112px + var(--safe-b)); }
body.has-bar .toast { bottom: calc(96px + var(--safe-b)); }

/* Como foi o treino? */
.finish-view { display: grid; gap: 14px; }
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rate { aspect-ratio: 1; max-height: 68px; border-radius: 16px; font-size: 34px; line-height: 1; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--line); filter: grayscale(.6); opacity: .75; transition: transform .15s ease, opacity .15s ease, filter .15s ease, border-color .15s ease; }
.rate.on { border-color: var(--accent); background: rgba(255, 106, 43, .12); filter: none; opacity: 1; transform: scale(1.06); }
.rate-label { text-align: center; color: var(--muted); font-size: 15px; min-height: 21px; }
.note { display: grid; gap: 8px; margin-top: 6px; }
.note textarea { width: 100%; min-height: 96px; resize: none; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 17px; outline: 0; }
.note textarea:focus { border-color: var(--text); }
.note textarea::placeholder { color: #827f76; }
.note-count { justify-self: end; color: var(--muted); font-size: 13px; }
.finish-view .btn + .btn { margin-top: 0; }

/* Histórico: avaliação e exclusão */
.hist-rate { font-weight: 400; margin-left: 4px; }
.hist-item { position: relative; }
.hist-del { position: absolute; top: 0; right: 0; bottom: 0; width: 120px; padding-left: 16px; border-radius: var(--radius); background: #c9362c; color: #fff; font-weight: 700; display: grid; place-items: center; }
.hist-row { position: relative; z-index: 1; transition: transform .2s ease; touch-action: pan-y; }
.hist-row.open { transform: translateX(-104px); }
.sess-rate { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-align: center; }
.sess-emoji { font-size: 44px; line-height: 1.1; }
.sess-rate-label { color: var(--muted); font-size: 14px; margin-top: 2px; }
.sess-note { margin-top: 10px; font-size: 16px; overflow-wrap: anywhere; }
.sess-emoji + .sess-rate-label + .sess-note { padding-top: 10px; border-top: 1px solid var(--line); }
.btn.danger { color: #ff6b5e; }
.row-gap { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .home-car img, .rate, .hist-row { transition: none; }
}

/* Telas estreitas: iPhone antigo (320 px) e zoom 200% (v1.7.0) */
@media (max-width: 340px) {
  .set { grid-template-columns: 22px 1fr 1fr 44px; gap: 6px; padding: 4px 4px; }
  .field { padding: 0 8px; gap: 3px; }
  .field span { font-size: 11px; }
  .nudge { padding-left: 4px; }
  .rating { gap: 4px; }
  .rate { font-size: 26px; border-radius: 12px; }
  .row { flex-wrap: wrap; }
}
@media (max-width: 240px) {
  .field span { display: none; }
  .rating { grid-template-columns: repeat(3, 1fr); }
  .set { grid-template-columns: 1fr 1fr; }
  .set > .set-n, .set > .check { grid-column: 1 / -1; }
  .set-n { text-align: left; }
}
.hist-more { margin-top: 16px; }
.home-top h1 { overflow-wrap: anywhere; }
