/* Team Monster — tokens do design system (preto, metal e dourado; só tema escuro) */
:root {
  --bg: #0a0a0b;
  --surface: #131313;
  --surface-2: #1b1b1c;
  --surface-3: #262627;
  --line: #2b2925;
  --line-gold: #c9a45c47;
  --gold: #c9a45c;
  --gold-hi: #e9cd8f;
  --gold-lo: #8e6a2e;
  --on-gold: #15100a;
  --steel: #cfcfcb;
  --ink: #f3f1ec;
  --muted: #a29d94;
  --faint: #85807a;
  --ok: #4fbf85;     --ok-soft: #4fbf851f;
  --warn: #f0883e;   --warn-soft: #f0883e1f;
  --danger: #ef5a50; --danger-soft: #ef5a501f;
  --kcal: var(--gold); --protein: #d9875a; --carbs: var(--steel); --fat: #9db36b; --water: #5dade2;
  --display: 'Chakra Petch', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 20px;
  --chamfer-sm: 8px; --chamfer-md: 14px;
  --glow: 0 0 0 1px #c9a45c47, 0 14px 36px -14px #c9a45c66;
  --shadow-lg: 0 18px 44px -10px #000000d9;
  --focus: 0 0 0 2px #0a0a0b, 0 0 0 4px #e9cd8f;
  --nav-h: 68px;
  --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, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; font-weight: 500; }
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
svg { flex-shrink: 0; }
img { max-width: 100%; }
.hidden { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.num { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- layout ---------- */
#app { max-width: 620px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.screen { padding: calc(16px + var(--safe-t)) 16px calc(var(--nav-h) + 96px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; animation: fade .18s ease-out; }
.screen.no-nav { padding-bottom: calc(40px + var(--safe-b)); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.topbar .left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.title { font-family: var(--display); font-weight: 700; font-size: 30px; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.title.sm { font-size: 24px; }
.eyebrow { font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.eyebrow.muted { color: var(--muted); }
.sub { font-size: 13px; font-weight: 600; color: var(--muted); }
.section-label { font-family: var(--display); font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .18em; margin-top: 6px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 46px; height: auto; }
.brand .hello { font-size: 12px; color: var(--muted); font-weight: 600; display: block; }
.brand .name { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: .02em; text-transform: uppercase; line-height: 1.05; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* divisor com fio dourado afinado */
.rule { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.rule::before, .rule::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, transparent, var(--gold)); clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.rule::after { background: linear-gradient(270deg, transparent, var(--gold)); clip-path: polygon(0 0, 100% 50%, 0 100%); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card.gold { border-color: var(--line-gold); }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-head h3 { font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.card-head .sub { font-size: 12px; }
a.sub { text-decoration: none; color: var(--gold); }

.hero { position: relative; background: radial-gradient(120% 140% at 100% 0%, #c9a45c2e, transparent 55%), var(--surface); border: 1px solid var(--line-gold); box-shadow: var(--glow); padding: 18px; display: flex; flex-direction: column; gap: 12px;
  clip-path: polygon(var(--chamfer-md) 0, 100% 0, 100% calc(100% - var(--chamfer-md)), calc(100% - var(--chamfer-md)) 100%, 0 100%, 0 var(--chamfer-md)); border-radius: 0; }
.hero .k { font-family: var(--display); font-size: 12px; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: .2em; }
.hero h2 { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.05; text-transform: uppercase; text-wrap: balance; }
.hero .meta { font-size: 13px; color: var(--muted); font-weight: 600; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c, var(--gold)); border-radius: 99px; transition: width .5s cubic-bezier(.2,.8,.2,1); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 4px; text-align: left; text-decoration: none; min-width: 0; }
.stat span { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat b { font-family: var(--display); font-weight: 600; font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--faint); }
.c-warn { color: var(--warn) !important; } .c-danger { color: var(--danger) !important; } .c-ok { color: var(--ok) !important; } .c-muted { color: var(--muted) !important; } .c-gold { color: var(--gold) !important; }

/* ---------- list rows ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; text-decoration: none; min-width: 0; }
.row.plain { border: none; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 11px 2px; }
.row.plain:last-child { border-bottom: none; }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row .name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--muted); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-3); color: var(--gold); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 15px; flex-shrink: 0; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; box-shadow: inset 0 0 0 1px var(--line-gold); }
.ico-box { width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.amount { font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 7px; border-radius: var(--r-xs); white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.b-em_dia, .b-ok { background: var(--ok-soft); color: var(--ok); }
.b-vence_logo { background: var(--warn-soft); color: var(--warn); }
.b-vencido, .b-bloqueado { background: var(--danger-soft); color: var(--danger); }
.b-inativo { background: var(--surface-3); color: var(--faint); }
.b-gold { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 1px var(--line-gold); }

/* ---------- buttons ---------- */
.btn { height: 48px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; transition: transform .08s, opacity .15s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.sm { height: 38px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 54px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.gold { border: none; border-radius: 0; color: var(--on-gold); font-family: var(--display); font-size: 15px; letter-spacing: .05em; text-transform: uppercase; background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  clip-path: polygon(var(--chamfer-sm) 0, 100% 0, 100% calc(100% - var(--chamfer-sm)), calc(100% - var(--chamfer-sm)) 100%, 0 100%, 0 var(--chamfer-sm)); }
.btn.gold.lg { font-size: 17px; clip-path: polygon(var(--chamfer-md) 0, 100% 0, 100% calc(100% - var(--chamfer-md)), calc(100% - var(--chamfer-md)) 100%, 0 100%, 0 var(--chamfer-md)); }
.btn.outline { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { background: transparent; color: var(--danger); border-color: #ef5a5055; }
.btn.wa { background: #1f7a4a; border-color: #1f7a4a; color: #fff; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; color: var(--ink); }
.icon-btn.sm { width: 36px; height: 36px; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.btn-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.on { background: var(--ok); } .dot.wait { background: var(--warn); } .dot.off { background: var(--danger); }

.fab { position: fixed; right: max(16px, calc(50% - 310px + 16px)); bottom: calc(var(--nav-h) + 18px + var(--safe-b)); width: 58px; height: 58px; border: none; color: var(--on-gold); background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); display: flex; align-items: center; justify-content: center; z-index: 20; filter: drop-shadow(0 10px 18px #00000099);
  clip-path: polygon(var(--chamfer-md) 0, 100% 0, 100% calc(100% - var(--chamfer-md)), calc(100% - var(--chamfer-md)) 100%, 0 100%, 0 var(--chamfer-md)); }

/* ---------- chips / segmented ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
.chip { flex-shrink: 0; height: 36px; padding: 0 13px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.chip b { font-weight: 700; color: var(--faint); }
.chip.on { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.chip.on b { color: var(--on-gold); opacity: .7; }

.seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); padding: 4px; border-radius: var(--r-md); }
.seg button { height: 38px; border-radius: var(--r-sm); border: none; background: transparent; font-weight: 700; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }

/* dias da semana */
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.day { min-height: 62px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 2px; position: relative; min-width: 0; }
.day b { font-family: var(--display); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.day span { font-size: 10px; font-weight: 700; color: var(--faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.day.on { border-color: var(--gold); background: var(--surface-2); box-shadow: inset 0 -3px 0 var(--gold); }
.day.on span { color: var(--gold); }
.day.today::after { content: ''; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.day.rest b { color: var(--faint); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); min-width: 0; }
.field small { font-weight: 600; color: var(--muted); font-size: 12px; }
.input, .field input, .field select, .field textarea { width: 100%; min-width: 0; height: 50px; border-radius: var(--r-sm); border: 1px solid var(--line); padding: 0 14px; font-size: 16px; font-weight: 600; background: var(--surface-2); color: var(--ink); outline: none; transition: border-color .15s, background .15s; }
.field textarea, textarea.input { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.45; resize: vertical; font-size: 15px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); background: #202021; }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--faint); font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.search input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; min-width: 0; color: var(--ink); }
.pass-row { display: flex; gap: 8px; }
.pass-row input { flex: 1; }

.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; }
.toggle-row .txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.toggle-row .txt b { font-weight: 700; font-size: 14px; }
.toggle-row .txt span { font-size: 12px; color: var(--muted); font-weight: 600; }
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); transition: background .15s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + i { background: var(--gold); border-color: var(--gold); }
.switch input:checked + i::after { transform: translateX(20px); background: var(--on-gold); }
.switch input:focus-visible + i { box-shadow: var(--focus); }

/* checkbox grande (refeições / exercícios) */
.check { width: 30px; height: 30px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: transparent; flex-shrink: 0; transition: background .15s, border-color .15s; }
.check.on { background: var(--ok); border-color: var(--ok); color: #06140c; }

/* ---------- bottom nav ---------- */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 620px; height: calc(var(--nav-h) + var(--safe-b)); padding: 6px 6px calc(8px + var(--safe-b)); background: #0e0e0ff2; backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); z-index: 30; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--faint); font-size: 11px; font-weight: 700; position: relative; }
.nav a.desk { display: none; }
.nav a span { width: 46px; height: 28px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.nav a.on { color: var(--gold); }
.nav a.on span { background: #c9a45c1f; }
.nav-brand { display: none; }

/* ---------- sheet ---------- */
.backdrop { position: fixed; inset: 0; background: #000000b3; z-index: 50; animation: bd .2s ease-out; display: flex; align-items: flex-end; justify-content: center; }
@keyframes bd { from { opacity: 0; } }
.sheet { width: 100%; max-width: 620px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-bottom: none; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 10px 16px calc(22px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; animation: up .25s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lg); }
.sheet.wide { max-width: 760px; }
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 44px; height: 5px; border-radius: 99px; background: var(--surface-3); align-self: center; flex-shrink: 0; }
.sheet .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet .head h2 { font-family: var(--display); font-weight: 700; font-size: 22px; text-transform: uppercase; line-height: 1.1; letter-spacing: .02em; min-width: 0; }
.sheet .head .icon-btn { background: var(--surface-2); }
.sheet p.lead { font-size: 14px; color: var(--muted); font-weight: 600; line-height: 1.45; }
.sheet .foot { position: sticky; bottom: calc(-22px - var(--safe-b)); margin: 0 -16px calc(-22px - var(--safe-b)); padding: 12px 16px calc(14px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; top: calc(12px + var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; padding: 0 16px; }
.toast { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-gold); padding: 12px 16px; border-radius: var(--r-sm); font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg); animation: tin .2s ease-out; max-width: 520px; display: flex; gap: 8px; align-items: center; }
.toast svg { color: var(--ok); }
.toast.err { border-color: #ef5a5066; }
.toast.err svg { color: var(--danger); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); font-weight: 600; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; line-height: 1.45; }
.empty .ico-box { width: 56px; height: 56px; }
.skel { background: linear-gradient(90deg, #161617 0%, #1f1f20 50%, #161617 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-md); }
@keyframes sk { to { background-position: -200% 0; } }
.splash { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: radial-gradient(60% 40% at 50% 45%, #c9a45c22, transparent 70%), var(--bg); }
.splash img { width: 220px; height: auto; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .65; transform: scale(.97); } }
.banner { border-radius: var(--r-md); padding: 14px; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line-gold); color: var(--ink); text-decoration: none; }
.banner > svg { color: var(--gold); }
.banner .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.banner .txt b { font-size: 14px; font-weight: 700; }
.banner .txt span { font-size: 12px; color: var(--muted); font-weight: 600; }
.banner.warn { border-color: #f0883e55; } .banner.warn > svg { color: var(--warn); }
.banner.danger { border-color: #ef5a5066; background: var(--danger-soft); } .banner.danger > svg { color: var(--danger); }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); font-weight: 600; }
.kv b { font-weight: 700; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; color: var(--ink); }
.menu-item:last-child { border-bottom: none; }
.menu-item > svg:first-child { color: var(--gold); }
.menu-item .txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.menu-item .txt b { font-size: 15px; font-weight: 700; }
.menu-item .txt span { font-size: 12px; color: var(--muted); font-weight: 600; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--surface-3); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.code-box { font-family: ui-monospace, Consolas, monospace; font-size: 14px; background: var(--surface-2); border: 1px dashed var(--line-gold); border-radius: var(--r-sm); padding: 12px; word-break: break-all; user-select: all; line-height: 1.6; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-stats div { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-stats span { font-size: 12px; font-weight: 600; color: var(--muted); }
.mini-stats b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; font-size: 12px; font-weight: 600; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- macros (barra superior da dieta) ---------- */
.macrobar { position: sticky; top: 0; z-index: 15; margin: calc(-16px - var(--safe-t)) -16px 0; padding: calc(12px + var(--safe-t)) 16px 12px; background: #0a0a0bf0; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.macros { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 8px; }
.macro { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.macro .top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.macro .val { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 0; white-space: nowrap; text-transform: none; }
.macro .of { font-size: 11px; color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
.macro.over .val { color: var(--warn); }

/* refeições */
.meal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; color: var(--ink); }
.meal.done { border-color: #4fbf8555; background: linear-gradient(0deg, var(--ok-soft), var(--ok-soft)), var(--surface); }
.meal .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.meal .t { display: flex; align-items: baseline; gap: 8px; }
.meal .t b { font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.meal .t span { font-size: 12px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.meal .desc { font-size: 14px; color: var(--muted); line-height: 1.5; white-space: pre-line; }
.meal .mac { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.meal .mac i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; vertical-align: 1px; }

/* água */
.water { display: flex; align-items: center; gap: 12px; }
.water .glass { flex: 1; display: flex; gap: 4px; }
.water .glass i { flex: 1; height: 26px; border-radius: 3px; background: var(--surface-3); }
.water .glass i.on { background: var(--water); }

/* exercícios */
.ex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; color: var(--ink); min-width: 0; }
.ex.done { border-color: #4fbf8555; }
.ex.done .ex-name { color: var(--muted); }
.thumb { width: 64px; height: 64px; border-radius: var(--r-sm); background: var(--surface-3); flex-shrink: 0; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--gold); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play { position: absolute; inset: auto 4px 4px auto; width: 22px; height: 22px; border-radius: 50%; background: #000000b3; color: var(--gold-hi); display: flex; align-items: center; justify-content: center; }
.thumb.lg { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.ex-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ex-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.ex-pres { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; font-weight: 700; color: var(--steel); font-variant-numeric: tabular-nums; }
.ex-pres span { color: var(--muted); font-weight: 600; }
.ex-last { font-size: 12px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.ex-num { font-family: var(--display); font-weight: 700; color: var(--faint); font-size: 13px; width: 18px; text-align: center; flex-shrink: 0; }
.video-box { width: 100%; background: #000; border-radius: var(--r-md); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.video-box video { width: 100%; height: auto; max-height: 62vh; display: block; background: #000; }
.video-box.wide { aspect-ratio: 16 / 9; }
.video-box iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.presc { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.presc div { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.presc span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.presc b { font-family: var(--display); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.loadbox { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }

/* editor de treino / dieta (personal) */
.ed-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ed-item .top { display: flex; gap: 10px; align-items: center; }
.ed-item .top .thumb { width: 44px; height: 44px; }
.ed-item .fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ed-item .fields.cardio { grid-template-columns: 1fr; }
.ed-item input, .ed-item textarea, .ed-item select { width: 100%; min-width: 0; height: 40px; font-size: 14px; font-weight: 600; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); outline: none; }
.ed-item input:focus, .ed-item textarea:focus, .ed-item select:focus { border-color: var(--gold); }
.ed-item input::placeholder, .ed-item textarea::placeholder { color: var(--faint); font-weight: 500; }
.ed-item textarea { height: auto; min-height: 64px; padding: 8px 10px; }
.ed-item label { font-size: 11px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; gap: 4px; text-transform: uppercase; letter-spacing: .06em; }
.ed-tools { display: flex; gap: 4px; }
.mac-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); width: 100%; text-align: left; color: var(--ink); }
.pick.on { border-color: var(--gold); background: #c9a45c14; }
.pick .thumb { width: 44px; height: 44px; }
.pick .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pick .main b { font-size: 14px; font-weight: 700; }
.pick .main span { font-size: 12px; color: var(--muted); font-weight: 600; }
.dirty-bar { position: sticky; bottom: calc(var(--nav-h) + 10px + var(--safe-b)); z-index: 18; display: flex; gap: 8px; align-items: center; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-gold); box-shadow: var(--shadow-lg); }
.dirty-bar span { flex: 1; font-size: 13px; font-weight: 700; color: var(--gold); }

/* exercícios: grade da biblioteca */
.lib { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lib-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; color: var(--ink); min-width: 0; }
.lib-card .thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; }
.lib-card .info { padding: 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lib-card b { font-size: 14px; font-weight: 700; line-height: 1.25; }
.lib-card span { font-size: 12px; color: var(--muted); font-weight: 600; }
.lib-card .novideo { font-size: 11px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }

/* gráficos */
.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--faint); font-size: 11px; font-weight: 600; font-family: var(--body); font-variant-numeric: tabular-nums; }
.chart .ln { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ar { fill: url(#tmGrad); stroke: none; }
.chart .pt { fill: var(--gold); stroke: var(--surface); stroke-width: 2; }
.chart .end { fill: var(--gold-hi); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .endlbl { fill: var(--ink); font-family: var(--display); font-size: 12px; font-weight: 600; }
.chart .tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line-gold); border-radius: var(--r-sm); padding: 6px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-lg); }
.chart .tip span { color: var(--muted); font-weight: 600; margin-right: 6px; }
.big-num { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.big-num b { font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.big-num span { font-size: 13px; font-weight: 700; color: var(--muted); }
.delta-up { color: var(--ok); } .delta-down { color: var(--warn); }
.heat { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); }
.heat i.on { background: var(--gold); }
.heat i.today { box-shadow: inset 0 0 0 1px var(--gold-hi); }
.measure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.measure { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px; display: flex; flex-direction: column; gap: 2px; border: 1px solid transparent; text-align: left; color: var(--ink); }
.measure.on { border-color: var(--gold); }
.measure span { font-size: 12px; font-weight: 600; color: var(--muted); }
.measure b { font-family: var(--display); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.measure em { font-style: normal; font-size: 12px; font-weight: 700; }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(28px + var(--safe-t)) 22px calc(28px + var(--safe-b)); gap: 22px; max-width: 460px; margin: 0 auto;
  background: radial-gradient(70% 38% at 50% 22%, #c9a45c26, transparent 70%); }
.login .logo { display: flex; justify-content: center; }
.login .logo img { width: min(270px, 70vw); height: auto; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login p { color: var(--muted); font-size: 14px; text-align: center; font-weight: 600; line-height: 1.45; }
.login .motto { font-family: var(--display); font-size: 11px; letter-spacing: .32em; color: var(--faint); text-align: center; text-transform: uppercase; }

/* tela de plano vencido */
.blocked { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b)); gap: 18px; max-width: 460px; margin: 0 auto; text-align: center; }
.blocked .mark { width: 120px; height: auto; align-self: center; filter: grayscale(.4) brightness(.8); }
.blocked h1 { font-family: var(--display); font-size: 34px; font-weight: 700; text-transform: uppercase; color: var(--danger); letter-spacing: .02em; }
.blocked p { color: var(--muted); font-weight: 600; line-height: 1.5; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plans div { background: var(--surface); border: 1px solid var(--line-gold); border-radius: var(--r-md); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.plans span { font-family: var(--display); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.plans b { font-family: var(--display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- blocos de layout ---------- */
.dash-top, .cols, .stack, .toolbar, .narrow { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* agenda presencial */
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot { display: flex; gap: 10px; align-items: stretch; min-height: 48px; }
.slot .hr { width: 46px; font-size: 13px; font-weight: 700; color: var(--muted); display: flex; align-items: center; font-variant-numeric: tabular-nums; }
.slot .body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.slot .busy { border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-gold); color: var(--ink); display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 14px; min-height: 48px; width: 100%; text-align: left; gap: 8px; }
.slot .busy b { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .free { border-radius: var(--r-sm); background: transparent; border: 1px dashed var(--line); color: var(--faint); font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 48px; width: 100%; text-align: left; }
.slot.past { opacity: .45; }

@media (min-width: 640px) {
  .screen { padding-left: 20px; padding-right: 20px; }
  .macrobar { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lib { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .measure-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- PC ---------- */
@media (min-width: 1024px) {
  :root { --side: 248px; }
  #app { max-width: none; margin: 0 0 0 var(--side); }
  .screen { max-width: 1180px; margin: 0 auto; padding: 30px 40px 120px; gap: 18px; }
  .screen.no-nav { padding-bottom: 56px; }
  .topbar .brand img { display: none; }
  .title { font-size: 36px; }
  .macrobar { margin: -30px -40px 0; padding: 14px 40px; }

  .nav { left: 0; top: 0; bottom: 0; transform: none; width: var(--side); max-width: none; height: 100vh; padding: 22px 14px; border-top: none; border-right: 1px solid var(--line); background: #0d0d0e; backdrop-filter: none; display: flex; flex-direction: column; gap: 4px; }
  .nav-brand { display: flex; justify-content: center; padding: 4px 10px 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
  .nav-brand img { width: 150px; height: auto; }
  .nav a, .nav a.desk { display: flex; flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 12px; border-radius: var(--r-sm); font-size: 15px; color: var(--muted); }
  .nav a span { width: auto; height: auto; background: none !important; }
  .nav a:hover { background: var(--surface); color: var(--ink); }
  .nav a.on { background: var(--surface-2); color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }

  .fab { right: 40px; bottom: 36px; }
  .dirty-bar { bottom: 20px; }
  .dash-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: stretch; }
  .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  .cols.wide-left { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .stack.sticky { position: sticky; top: 24px; }
  .toolbar { flex-direction: row; align-items: center; gap: 14px; }
  .toolbar .search { width: 340px; flex-shrink: 0; }
  .toolbar .chips { margin: 0; padding: 0; flex: 1; flex-wrap: wrap; }
  .list.cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
  .lib { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .narrow { max-width: 760px; width: 100%; }
  .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .backdrop { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: var(--r-lg); border-bottom: 1px solid var(--line); padding: 22px 24px 24px; max-height: 88vh; animation: pop .18s ease-out; }
  .sheet.wide { max-width: 760px; }
  .sheet .foot { bottom: -24px; margin: 0 -24px -24px; padding: 12px 24px 16px; }
  .sheet .grab { display: none; }
  @keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } }

  .row, .stat, .menu-item, .chip, .day, .btn, .icon-btn, .ex, .lib-card, .meal, .pick { transition: background .12s, border-color .12s, transform .08s, box-shadow .12s, filter .12s; }
  a.row:hover, button.row:hover, .stat:hover, .ex:hover, .lib-card:hover, button.meal:hover { border-color: var(--line-gold); }
  .menu-item:hover { background: var(--surface-2); }
  .btn:hover { filter: brightness(1.12); }
  .icon-btn:hover, .chip:not(.on):hover, .day:not(.on):hover { border-color: var(--gold); }
  .slot .free:hover { border-color: var(--gold); color: var(--gold); }

  .login { max-width: none; align-items: center; }
  .login > * { width: 100%; max-width: 400px; }
}
