/* Treinos — Ironman 70.3 Brasília. Mobile-first (375px), modo claro creme + laranja Fera. */
:root {
  --bg: #F5EFE6;
  --surface: #FBF8F3;
  --surface-2: #E8E0D6;
  --ink: #0A0A0A;
  --ink-2: #3D3A36;
  --muted: #6B6B6B;
  --line: #D9D0C4;
  --accent: #F04E14;
  --accent-ink: #C23A0A;
  --ok: #1F6B3A;
  --radius: 14px;
  --space: 16px;
  --maxw: 640px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font);
  padding-bottom: 88px;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* topo */
.top {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: var(--maxw); margin: 0 auto; padding: 12px var(--space);
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.brand { font-weight: 900; letter-spacing: .14em; font-size: 13px; text-transform: uppercase; }
.brand b { color: var(--accent); }
.count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count strong { color: var(--ink); font-weight: 800; }

main { max-width: var(--maxw); margin: 0 auto; padding: 20px var(--space) 0; }

/* navegação de data */
.datebar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.datebar .nav {
  width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 22px; line-height: 1; flex: none;
}
.datebar .nav:active { background: var(--surface-2); }
.datebar .when { flex: 1; text-align: center; min-width: 0; }
.when .d { font-weight: 800; font-size: 17px; }
.when .d::first-letter { text-transform: uppercase; }
.when .w { font-size: 13px; color: var(--muted); }
.today-btn {
  display: block; margin: 0 auto 14px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--ink); background: transparent; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.today-btn[hidden] { display: none; }

/* faixa da semana */
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 22px; }
.strip button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 8px 0 7px; min-height: 58px; text-align: center; position: relative;
}
.strip .dw { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.strip .dn { display: block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.strip .dot { display: block; width: 6px; height: 6px; border-radius: 50%; margin: 3px auto 0; background: var(--line); }
.strip button.has .dot { background: var(--ink); }
.strip button.all .dot { background: var(--ok); }
.strip button.sel { background: var(--ink); color: #fff; border-color: var(--ink); }
.strip button.sel .dw { color: #d8d0c4; }
.strip button.sel .dot { background: var(--accent); }
.strip button.sel.all .dot { background: #6fd39a; }
.strip button.is-today:not(.sel) { border-color: var(--accent); border-width: 2px; padding: 7px 0 6px; }

/* cabeçalho do dia */
.day-head { margin-bottom: 18px; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); font-weight: 800; }
.day-head h1 { margin: 4px 0 0; font-size: clamp(28px, 8vw, 40px); line-height: 1.05; font-weight: 900; letter-spacing: -.02em; }
.day-head .sub { margin-top: 6px; color: var(--muted); font-size: 14px; }

/* cards de sessão */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px var(--space); margin-bottom: 14px;
}
.card.done { background: #EEF3EC; border-color: #B8CDB9; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; background: var(--ink); color: #fff;
}
.chip.alt { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.chip.hot { background: var(--accent); color: #fff; }
.card h2 { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.card .meta { margin-top: 4px; font-size: 13px; color: var(--muted); }
.mins { text-align: right; flex: none; line-height: 1; }
.mins .n { font-size: 40px; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mins .u { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 4px; font-weight: 700; }

.steps { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
.steps li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr; gap: 2px; }
.steps .t { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.steps .d { font-weight: 600; }
.steps .n { font-size: 14px; color: var(--ink-2); }
.sum { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); background: var(--surface-2); padding: 10px 12px; border-radius: 10px; }

details.nutri { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
details.nutri summary {
  list-style: none; padding: 14px; min-height: 48px; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
}
details.nutri summary::-webkit-details-marker { display: none; }
details.nutri summary::after { content: '+'; font-size: 22px; font-weight: 400; color: var(--accent); }
details.nutri[open] summary::after { content: '−'; }
.nrow { padding: 0 14px 12px; }
.nrow .k { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.nrow .v { font-size: 14px; color: var(--ink-2); margin-top: 1px; }

.mark {
  width: 100%; margin-top: 16px; min-height: 54px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .01em;
}
.mark:active { background: var(--accent-ink); }
.mark.is-done { background: transparent; color: var(--ok); border: 2px solid var(--ok); }
.mark.is-done:active { background: #dfeadd; }

/* alimentação do dia */
.day-nutri h2 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.kv { display: grid; gap: 10px; margin: 14px 0; }
.kv div { border-left: 3px solid var(--accent); padding-left: 10px; }
.kv .k { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kv .v { font-weight: 600; font-size: 15px; }
.meals { margin: 0; padding: 0; list-style: none; }
.meals li { padding: 10px 0; border-top: 1px solid var(--line); }
.meals .k { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fine { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* aba plano */
.wk {
  display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
}
.wk.cur { border-color: var(--accent); border-width: 2px; padding: 11px 13px; }
.wk .r1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.wk .nm { font-weight: 800; }
.wk .ph { font-size: 13px; color: var(--muted); }
.wk .bar { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.wk .bar i { display: block; height: 100%; background: var(--ok); }
.wk .ct { font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.sec-title { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
.tools { display: grid; gap: 8px; }
.tool {
  min-height: 48px; border: 1px solid var(--ink); background: transparent; border-radius: 12px; font-weight: 700;
}
.tool.danger { border-color: #9b2c1b; color: #9b2c1b; }
.summary-total { font-size: 15px; margin: 0 0 14px; }

/* abas */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs-in { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; }
.tabs button { background: transparent; border: 0; color: #cfc7bb; min-height: 56px; font-weight: 700; font-size: 15px; }
.tabs button[aria-selected="true"] { color: #fff; box-shadow: inset 0 3px 0 var(--accent); }

footer { max-width: var(--maxw); margin: 28px auto 0; padding: 0 var(--space) 24px; font-size: 12px; color: var(--muted); }
footer a { color: var(--ink-2); }

@media (min-width: 720px) {
  .steps li { grid-template-columns: 170px 1fr; column-gap: 16px; }
  .steps .n { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
