/* App do aluno — identidade Pulso (grafite + limão), pensado para o celular */
body.ap-on {
  color-scheme: dark;
  --text: #F2F3F5; --text-2: #d6d8dd; --muted: #A9ADB8; --border: #2A2D35; --border-strong: #3a3e48;
  --surface: #17191E; --surface-2: #1d2026; --surface-3: #23262d; --bg: #0E0F12; --primary-text: #C6F432;
  background: #0E0F12; color: #F2F3F5; min-height: 100vh;
}
body.ap-on .bk-wrap { max-width: 560px; margin: 0 auto; padding: 0; }
body.ap-on .input { background: #0E0F12; color: #F2F3F5; border-color: #2A2D35; }
body.ap-on .modal { background: #17191E; color: #F2F3F5; border: 1px solid #2A2D35; }
body.ap-on .btn { background: #23262d; color: #F2F3F5; border-color: #2A2D35; }
body.ap-on .btn.primary { background: #C6F432; color: #0E0F12; border-color: #C6F432; }
body.ap-on .btn.danger, body.ap-on .btn.ghost.danger { color: #ff8a65; }
body.ap-on .btn.danger { background: #3a1a12; }
body.ap-on a { color: #C6F432; }
body.ap-in-session { overflow: hidden; }

.ap-main { padding: calc(14px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.ap-loading { color: #A9ADB8; text-align: center; padding: 40px 0; }
.ap-top { display: flex; align-items: center; gap: 12px; padding: 6px 2px 2px; }
.ap-top small { color: #A9ADB8; font-size: 13px; display: block; }
.ap-top h1 { margin: 2px 0 0; font-family: var(--font-display); font-size: 28px; letter-spacing: -.02em; line-height: 1.1; }
.ap-brand img { display: block; border-radius: 9px; }
.grow { flex: 1; min-width: 0; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }

.ap-card { background: #17191E; border: 1px solid #22252c; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ap-card-head { display: flex; align-items: center; gap: 10px; }
.ap-card-head h2 { margin: 0; font-family: var(--font-display); font-size: 18px; letter-spacing: -.01em; flex: 1; min-width: 0; }
.ap-card-head small { color: #A9ADB8; display: block; font-size: 13px; margin-top: 2px; }
.ap-muted { color: #A9ADB8; }
.ap-small { font-size: 13px; text-align: center; }
.ap-big { font-family: var(--font-display); font-size: 20px; color: #C6F432; }

.ap-hero { background: linear-gradient(160deg, #1b1e15 0%, #17191E 60%); border: 1px solid #2f3524; border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.ap-hero > small { color: #C6F432; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.ap-hero h2 { margin: 0; font-family: var(--font-display); font-size: 26px; letter-spacing: -.02em; }
.ap-hero p { margin: -4px 0 0; color: #A9ADB8; }
.ap-hero-row { display: flex; gap: 12px; align-items: center; }
.ap-hero-row .mm-fig { width: 110px; flex: none; margin: 0; }
.ap-hero-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.ap-hero-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; border-bottom: 1px solid #23262d; padding-bottom: 6px; }
.ap-hero-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-hero-list em { font-style: normal; font-family: var(--font-display); color: #C6F432; flex: none; }

.ap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #C6F432; color: #0E0F12; border: 0; border-radius: 999px; padding: 10px 16px; font: 600 14px var(--font); cursor: pointer; min-height: 40px; }
.ap-btn:disabled { opacity: .6; }
.ap-btn.sm { padding: 8px 14px; font-size: 13px; min-height: 36px; }
.ap-btn-lg { width: 100%; padding: 15px; font-size: 16px; min-height: 52px; }
.ap-link { background: none; border: 0; color: #A9ADB8; font: 500 14px var(--font); padding: 12px; cursor: pointer; text-align: center; display: block; width: 100%; }
.ap-link.danger { color: #ff8a65; }
.ap-icon { background: #23262d; border: 0; color: #F2F3F5; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; flex: none; }
.ap-chip { background: #23262d; border: 1px solid #2f333c; color: #F2F3F5; border-radius: 999px; padding: 7px 12px; font: 600 13px var(--font); cursor: pointer; min-height: 34px; }

.ap-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ap-stat { background: #17191E; border: 1px solid #22252c; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.ap-stat svg { color: #FF7A45; }
.ap-stat b { font-family: var(--font-display); font-size: 24px; color: #F2F3F5; }
.ap-stat small { color: #A9ADB8; font-size: 12px; line-height: 1.25; }

.ap-alert { display: flex; align-items: center; gap: 10px; background: #2a2412; border: 1px solid #4a3d14; color: #ffd36b; border-radius: 14px; padding: 12px 14px; font: 500 14px var(--font); cursor: pointer; text-align: left; }
.ap-list { display: flex; flex-direction: column; }
.ap-row { display: flex; align-items: center; gap: 12px; background: none; border: 0; border-bottom: 1px solid #22252c; color: inherit; padding: 12px 2px; text-align: left; font: inherit; cursor: pointer; width: 100%; }
.ap-row:last-child { border-bottom: 0; }
.ap-row.static { cursor: default; }
.ap-row b { display: block; font-weight: 600; }
.ap-row small { color: #A9ADB8; font-size: 13px; display: block; margin-top: 2px; }
.ap-row > svg { color: #C6F432; flex: none; }
.ap-badge { background: #2a3313; color: #C6F432; border-radius: 999px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; flex: none; display: inline-block; margin-top: 4px; }
.ap-badge.ok { background: #16301f; color: #7ee2a0; }
.ap-note { background: #1d2026; border-radius: 12px; padding: 10px 12px; font-size: 14px; color: #d6d8dd; white-space: pre-line; }
.ap-note.warn { background: #2a2412; color: #ffd36b; }
.ap-note.coach { background: #1e2a12; color: #e3f7b0; border: 1px solid #3a4a1c; }
.ap-prog h2 { margin: 6px 0 0; font-family: var(--font-display); font-size: 20px; }
.ap-prog small { color: #A9ADB8; }
.ap-month { margin: 8px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #A9ADB8; }
.ap-date { width: 42px; flex: none; text-align: center; background: #23262d; border-radius: 10px; padding: 5px 0; }
.ap-date b { font-family: var(--font-display); font-size: 18px; }
.ap-date small { margin: 0; font-size: 11px; text-transform: lowercase; }
.ap-details summary { cursor: pointer; color: #A9ADB8; padding: 8px 0; }

.ap-heat { width: 100%; height: auto; }
.ap-heat rect { fill: #23262d; }
.ap-heat rect.on { fill: #C6F432; }
.ap-line { width: 100%; height: auto; }
.ap-line .ln { fill: none; stroke: #C6F432; stroke-width: 2.5; stroke-linejoin: round; }
.ap-line circle { fill: #C6F432; }
.ap-line text { fill: #A9ADB8; font-size: 10px; }
.ap-line-legend { display: flex; justify-content: space-between; font-size: 12px; color: #A9ADB8; }
.ap-inline { display: flex; align-items: center; gap: 10px; }

/* abas */
.ap-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(14,15,18,.94); backdrop-filter: blur(12px); border-top: 1px solid #22252c; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.ap-tab { background: none; border: 0; color: #8a8f9c; display: flex; flex-direction: column; align-items: center; gap: 3px; font: 500 11px var(--font); padding: 6px 0; cursor: pointer; min-height: 48px; }
.ap-tab.on { color: #C6F432; }
.ap-resume { display: flex; align-items: center; gap: 10px; background: #C6F432; color: #0E0F12; border: 0; border-radius: 14px; padding: 12px 14px; font: 500 14px var(--font); cursor: pointer; text-align: left; }

/* sessão de treino (tela cheia) */
.ap-session { position: fixed; inset: 0; z-index: 40; background: #0E0F12; color: #F2F3F5; display: flex; flex-direction: column; }
.ap-s-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid #22252c; }
.ap-s-top b { display: block; font-family: var(--font-display); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-s-top small { color: #A9ADB8; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ap-progress { height: 4px; background: #23262d; }
.ap-progress i { display: block; height: 100%; background: #C6F432; width: 0; transition: width .25s; }
.ap-s-body { flex: 1; overflow-y: auto; padding: 14px 14px calc(110px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.ap-last { color: #A9ADB8; font-size: 12.5px; margin-top: -4px; }
.ap-sets { display: flex; flex-direction: column; gap: 6px; }
.ap-set { display: grid; grid-template-columns: 38px 1fr 1fr 48px; gap: 8px; align-items: center; }
.ap-set.head span { font-size: 11.5px; color: #8a8f9c; text-transform: uppercase; letter-spacing: .06em; text-align: center; }
.ap-setn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #23262d; font-family: var(--font-display); font-weight: 600; color: #d6d8dd; }
.ap-set.done .ap-setn { background: #2a3313; color: #C6F432; }
.ap-in { width: 100%; box-sizing: border-box; background: #0E0F12; border: 1px solid #2A2D35; color: #F2F3F5; border-radius: 10px; padding: 10px 8px; text-align: center; font: 600 16px var(--font-display); min-height: 44px; }
.ap-in.wide { width: 110px; flex: none; }
.ap-in:focus { outline: 2px solid #C6F432; outline-offset: 0; border-color: transparent; }
.ap-in:disabled { opacity: .35; }
.ap-set.done .ap-in { border-color: #2f3524; color: #C6F432; }
.ap-tick { width: 46px; height: 44px; border-radius: 12px; border: 1px solid #2f333c; background: #1d2026; color: #6b707c; display: grid; place-items: center; cursor: pointer; }
.ap-tick.on { background: #C6F432; border-color: #C6F432; color: #0E0F12; }
.ap-set-actions { display: flex; gap: 8px; margin-top: 4px; }
.ap-rest { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 45; display: flex; align-items: center; gap: 8px; background: #C6F432; color: #0E0F12; border-radius: 18px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 536px; margin: 0 auto; }
.ap-rest[hidden] { display: none; }
.ap-rest b { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; margin-right: auto; }
.ap-rest .ap-chip { background: rgba(14,15,18,.12); border-color: rgba(14,15,18,.2); color: #0E0F12; }
.ap-effort { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.ap-eff { border: 1px solid #2f333c; background: #1d2026; color: #F2F3F5; border-radius: 8px; padding: 9px 0; font: 600 14px var(--font-display); cursor: pointer; }
.ap-eff.on { background: #C6F432; color: #0E0F12; border-color: #C6F432; }

.ap-sheet .mm-fig { max-width: 220px; margin: 0 auto; }
.ap-dose { font-family: var(--font-display); color: #C6F432; font-size: 16px; }
.ap-media { width: 100%; border-radius: 12px; background: #fff; }
.ap-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: #d6d8dd; }
.ap-pr-box { background: #1d2026; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ap-pr-box div { display: flex; gap: 8px; align-items: center; }
.ap-pr-box svg { color: #C6F432; flex: none; }
.ap-log-ex { border-bottom: 1px solid #22252c; padding-bottom: 8px; }
.ap-log-ex small { display: block; color: #A9ADB8; margin-top: 2px; }

.ap-done { display: flex; flex-direction: column; gap: 14px; text-align: center; padding-top: 30px; }
.ap-done h1 { margin: 0; font-family: var(--font-display); font-size: 30px; }
.ap-done p { margin: -8px 0 0; color: #A9ADB8; }
.ap-done .ap-card { text-align: left; }
.ap-done-ic { width: 72px; height: 72px; border-radius: 22px; background: #C6F432; color: #0E0F12; display: grid; place-items: center; margin: 0 auto; }

/* janelas e avisos por cima da tela de treino */
body.ap-on .overlay { z-index: 60; }
body.ap-on #toasts { z-index: 70; }

/* faixa da versão de demonstração */
.ap-demo { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: #2a2412; border: 1px solid #4a3d14; color: #ffd36b; border-radius: 12px; padding: 8px 12px; font-size: 12.5px; }
.ap-demo a { color: #ffd36b; font-weight: 600; white-space: nowrap; }
