/* Camada da v2: entra por cima de app.css e life.css. */
.sidebar { padding: 26px 16px 20px; }
.sidebar nav { margin-top: 34px; }
.brand { font-size: 1.05rem; }
.brand-icon { flex: none; }
.user { margin-top: auto; background: none; border: 0; padding: 8px 4px; color: inherit; text-align: left; width: 100%; }
.page-label { font-weight: 550; font-size: .95rem; }
.topbar { height: 66px; margin-bottom: 22px; }
.date { margin-left: auto; }
.command-button { margin-left: 0; }
main { max-width: 1240px; }

/* Hoje */
.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.today-head h1 { font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -.04em; font-weight: 620; }
.day-summary { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.mode-switch { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 4px; background: #11131d; border: 1px solid #ffffff17; border-radius: 12px; }
.mode-switch button { min-height: 40px; padding: 7px 15px; border: 0; border-radius: 9px; background: none; color: #b0b6cc; font-size: .875rem; font-weight: 550; }
.mode-switch button.active { background: linear-gradient(120deg, #ad92ff, #7960d9); color: #fff; }
.mode-switch.wide { display: grid; width: 100%; }
.mode-hint { color: var(--muted); font-size: .875rem; margin: 10px 0 16px; text-align: right; }
.day-banner { display: block; width: 100%; text-align: left; margin: 0 0 14px; padding: 12px 16px; min-height: 46px; border-radius: 12px; background: #8c6bff1c; border: 1px solid #b39aff44; color: #ddd2ff; font-size: .9rem; font-weight: 550; }

.command { grid-template-columns: 1fr 340px; min-height: 300px; }
.command-copy { padding: 30px 8px 30px 32px; }
.command h2 { margin: 16px 0 8px; font-size: clamp(1.7rem, 2.6vw, 2.4rem); }
.badge { font-size: .72rem; }
.focus-meta { margin: 12px 0 18px; }
.core-scene { min-height: 300px; }
.core-readout { top: 50%; display: block; }
.core-readout strong { font-size: 1.9rem; font-weight: 500; letter-spacing: -.05em; color: #fff; }
.core-readout small { font-size: .85rem; }
.core-fallback { inset: 22%; border: 0; box-shadow: none; -webkit-mask: radial-gradient(farthest-side, transparent 72%, #000 73%); mask: radial-gradient(farthest-side, transparent 72%, #000 73%); }

.quick-actions { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.quick-actions .secondary { flex: 1 1 160px; }
.metrics { margin-top: 0; }
.metric { padding: 13px 17px; }
.metric > div > span { font-size: .8rem; }
.metric b { font-size: 1.4rem; line-height: 1.3; }

/* Agenda */
.agenda { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; align-items: start; }
.agenda-group h3 { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #9a9fb8; margin: 0 0 8px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; margin-bottom: 7px; min-height: 62px; background: #12141f; border: 1px solid #ffffff12; border-left: 3px solid var(--task-color); border-radius: 12px; }
.row .check { flex: none; width: 44px; min-height: 44px; border-radius: 50%; background: none; border: 2px solid color-mix(in srgb, var(--task-color) 60%, transparent); color: var(--task-color); font-size: 1.05rem; }
.row .check:hover { background: color-mix(in srgb, var(--task-color) 15%, transparent); }
.row.done .check { background: var(--task-color); border-color: var(--task-color); color: #10121c; font-weight: 800; }
.row-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; min-height: 44px; color: inherit; }
.row-main b { display: block; font-weight: 580; font-size: .95rem; line-height: 1.25; }
.row-main small { display: block; color: #a3a9c0; font-size: .82rem; line-height: 1.35; margin-top: 2px; }
.row.done .row-main b { text-decoration: line-through; color: #a7adc2; }
.row.done, .row.skipped { opacity: .72; }
.row-xp { flex: none; font: 11px ui-monospace, monospace; color: #8e96b0; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: .7rem; padding: 1px 7px; border-radius: 6px; background: #ffffff0d; color: #b9bfd4; }
.tag.star { background: #f0c97a22; color: #f3d596; }

/* Água e caixa de entrada */
.quote-panel { display: none; }
.water-actions { display: flex; gap: 8px; }
.water-actions .primary { flex: 1; }
.liquid-track { height: 26px; margin-bottom: 14px; }
.water, .inbox { padding: 18px 20px; }
.inbox .compact { margin-bottom: 12px; }
.capture { display: flex; gap: 8px; }
.capture input { flex: 1; }
.capture button { width: 46px; padding: 0; font-size: 1.1rem; }
.inbox-row { display: flex; align-items: center; gap: 7px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; overflow-wrap: anywhere; }
.inbox-row span { flex: 1; min-width: 0; }

/* Barra de timer */
.live-bar { position: sticky; top: 8px; z-index: 12; display: block; width: 100%; margin-bottom: 14px; min-height: 44px; padding: 9px 14px; border-radius: 12px; border: 1px solid #77e0ff55; background: #0f2230f2; color: #bdeeff; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Missões */
.greeting .view-description { margin: 8px 0 0; }
.tier-legend { display: flex; gap: 8px 22px; flex-wrap: wrap; color: var(--muted); font-size: .875rem; margin-bottom: 8px; }
.tier-legend p { margin: 0; }
.tier-legend b { color: #d4d0ea; font-weight: 600; }
.tier-title { font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; color: #9a9fb8; margin: 22px 0 8px; font-weight: 600; }
.manager-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 7px; min-height: 58px; color: inherit; background: #12141f; border: 1px solid #ffffff12; border-radius: 12px; }
.manager-row i { width: 9px; height: 9px; border-radius: 50%; background: var(--task-color); flex: none; }
.manager-row span { flex: 1; min-width: 0; }
.manager-row b { display: block; font-weight: 570; }
.manager-row small { color: #a3a9c0; font-size: .82rem; }
.manager-row em { font-style: normal; color: #b4a2f1; font-size: .85rem; }

/* Modais */
dialog { max-height: 88vh; overflow: auto; }
.menu-list { display: grid; gap: 6px; }
.menu-list button { text-align: left; min-height: 48px; padding: 10px 14px; border-radius: 10px; background: #ffffff07; border: 1px solid #ffffff14; color: inherit; font-size: .95rem; }
.menu-list button:hover { background: #ffffff10; }
.danger-text { color: #ff9fb0; }
.replan-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.replan-row small { display: block; color: #a3a9c0; font-size: .82rem; }
.replan-actions { display: flex; gap: 6px; }
.replan-actions button { padding: 6px 10px; font-size: .8rem; min-height: 40px; }
.time-picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 12px; }
.time-picks button { padding: 8px 4px; }
.time-picks .selected, .pick-list .selected { background: #8269ff33; border-color: #a991ff; color: #eee9ff; }
.pick-list { display: flex; flex-wrap: wrap; gap: 7px; }
.pick-list button { min-height: 44px; padding: 8px 13px; border-radius: 10px; background: #ffffff07; border: 1px solid #ffffff1c; color: inherit; font-size: .9rem; }
.morning-q { color: var(--text); font-weight: 580; margin: 16px 0 8px; }
.check-list { display: grid; gap: 6px; margin: 10px 0; }
.check-list label { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 7px 12px; border-radius: 10px; background: #ffffff06; border: 1px solid #ffffff12; cursor: pointer; }
.check-list input { width: 20px; height: 20px; min-height: 0; accent-color: #a28cff; flex: none; }
.check-list small { display: block; color: #a3a9c0; font-size: .78rem; }
.check-label { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; font-size: .9rem; color: #c9cde0; }
.check-label input { width: 20px; height: 20px; min-height: 0; accent-color: #a28cff; }
.day-picks { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 5px; }
.day-picks legend { font-size: .875rem; color: var(--muted); margin-bottom: 7px; }
.day-picks input { position: absolute; opacity: 0; }
.day-picks span { display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 9px; border: 1px solid #ffffff1c; font-size: .8rem; cursor: pointer; }
.day-picks input:checked + span { background: #8269ff33; border-color: #a991ff; }
.day-picks input:focus-visible + span { outline: 2px solid var(--cyan); }
.explain p { color: #c9cde0; margin: 0 0 12px; line-height: 1.55; }
.explain b { color: var(--text); }
#commandSearch { width: 100%; margin-bottom: 10px; }
.command-list button.selected { background: #8269ff26; }

/* Treino */
.workout-on .training-rest { display: none; }
.workout-on #view-treino .split-grid { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips button { min-height: 40px; padding: 6px 11px; font-size: .82rem; }
.last-time { color: #f3d596; font-size: .9rem; margin: 6px 0; }
.history-day { background: none; border: 0; padding: 0; color: #adb4cd; cursor: pointer; }
.achievements { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
  .agenda { grid-template-columns: 1fr; }
  .command { grid-template-columns: 1fr 260px; }
}
@media (max-width: 860px) {
  .mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); overflow: visible; }
  .mobile-nav button { flex: none; }
  .command-button { font-size: 0; gap: 0; padding: 8px 11px; }
  .command-button:before { content: "⌕"; font-size: 1.15rem; }
  .command-button kbd { display: none; }
  .achievements { grid-template-columns: repeat(2, 1fr); }
  .live-bar { position: fixed; top: auto; left: 10px; right: 10px; width: auto; bottom: calc(82px + env(safe-area-inset-bottom)); }
}
@media (max-width: 620px) {
  .topbar { height: 54px; margin-bottom: 14px; }
  .today-head { display: block; }
  .today-head h1 { font-size: 1.6rem; }
  .mode-switch { display: grid; width: 100%; margin-top: 12px; }
  .mode-hint { text-align: left; margin: 8px 0 12px; }
  /* Núcleo compacto no canto do cartão: a ação vem primeiro. */
  .command { display: block; min-height: 0; position: relative; }
  .command-copy { padding: 18px; background: none; }
  .command h2 { font-size: 1.5rem; padding-right: 96px; margin-top: 12px; min-height: 2.2em; }
  .command p { padding-right: 6px; font-size: .95rem; }
  .core-scene { position: absolute; top: 4px; right: 2px; width: 112px; height: 112px; min-height: 0; margin: 0; }
  .core-readout strong { font-size: 1rem; }
  .core-readout small { font-size: .65rem; margin-left: 1px; }
  .actions button { flex: 1 1 auto; }
  .quick-actions .secondary { flex: 1 1 45%; padding: 9px 8px; font-size: .8rem; white-space: normal; }
  .forgiven { display: none; }
  .command-button { margin-left: auto; }
  .greeting { align-items: flex-start; }
  .quick-actions #closeDay { display: none; }
  .metrics { gap: 8px; }
  .metric { padding: 10px; }
  .metric > div > span { min-height: 0; font-size: .72rem; }
  .metric b { font-size: 1.15rem; margin-top: 2px; }
  .row-xp { display: none; }
  .bottom-grid { grid-template-columns: 1fr; }
  .set-form { grid-template-columns: 1fr 1fr; }
  .set-form .form-field:first-child, .set-form > button { grid-column: 1 / -1; }
  .history-row { flex-wrap: wrap; align-items: center; }
  footer { font-size: .75rem; }
}

@media (max-width: 860px) {
  .core-readout { left: 50%; right: auto; top: 50%; bottom: auto; width: auto; transform: translate(-50%, -50%); justify-content: center; }
}

/* Dinheiro na tela Hoje */
.bottom-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.money { padding: 18px 20px; display: flex; flex-direction: column; }
.money .compact { margin-bottom: 10px; }
.money strong { color: #7fe0a8; font-size: 1.05rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.money-hint { color: var(--muted); font-size: .9rem; margin: 0 0 14px; flex: 1; }
.money-hint.over { color: #ffb36c; }


/* ================================================================
   Estilo bento: grafite neutro, um acento limão, blocos compactos.
   ================================================================ */
:root {
  --bg: #0a0b0d; --card: #111315; --card-2: #17191c; --line: #ffffff12; --line-strong: #ffffff24;
  --text: #f4f6ef; --muted: #9ba09a; --lime: #a3c978; --lime-ink: #10160f;
  --violet: #a3c978; --cyan: #a3c978; --accent: #a3c978;
}
body { background: var(--bg); }
.ambient, .ambient:after { background: none; background-image: none; }
.sidebar { display: none; }
main, .topbar { box-sizing: border-box; }
main { margin: 0 auto !important; max-width: 1240px; padding: 0 24px 118px !important; }
footer { display: none; }
h1 span, .greeting h1 span { color: var(--lime); background: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--lime); }

/* Superfícies foscas, sem gradiente */
.glass, .tile, .budget-panel, .level-panel, .focus-setup, .focus-station, .workout-live, .life-stat, .achievement {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: none;
}
dialog { background: var(--card-2); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: 0 30px 80px #000a; }
dialog::backdrop { background: #000000b8; backdrop-filter: blur(6px); }
input, select, textarea { background: #0c0d0f; border-color: var(--line-strong); }

/* Botões */
.primary, .primary:hover { background: var(--lime); color: var(--lime-ink); border: 1px solid var(--lime); box-shadow: none; font-weight: 650; border-radius: 12px; }
.primary:hover { background: #d4f0a0; }
.secondary { background: var(--card-2); border: 1px solid var(--line-strong); color: var(--text); border-radius: 12px; }
.secondary:hover { background: #1e2024; }
.text-button { color: var(--lime); }
.icon-button { border-color: var(--line-strong); }

/* Topo */
.topbar { height: 72px; margin-bottom: 14px; border-bottom: 0; gap: 14px; }
.brand { font-size: 1rem; }
.brand-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--lime); color: var(--lime-ink); border: 0; box-shadow: none; font-size: .95rem; }
.os { color: var(--muted); }
.page-label { display: none; }
.date { margin-left: auto; color: var(--muted); }
.command-button { background: var(--card); border-color: var(--line); border-radius: 12px; min-height: 42px; gap: 14px; }
.user { width: auto; margin: 0; padding: 3px 12px 3px 4px; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-height: 42px; font-size: .875rem; }
.avatar { min-width: 32px; height: 32px; border-radius: 9px; background: var(--card-2); border: 0; }

/* Dock flutuante */
.dock { position: fixed; z-index: 20; left: 50%; right: auto; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 4px; padding: 7px; background: #15171aee; border: 1px solid var(--line-strong); border-radius: 20px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 14px 40px #0009; overflow: visible; width: auto; }
.dock button { position: relative; display: grid; place-items: center; width: 48px; height: 48px; min-height: 48px; flex: none; padding: 0; border: 0; border-radius: 14px; background: none; color: #a4a9a3; }
.dock button:hover { background: #ffffff10; color: var(--text); transform: translateY(-2px); }
.dock button.active { background: var(--lime); color: var(--lime-ink); }
.dock em { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); padding: 4px 9px; border-radius: 8px; background: #222528; color: var(--text); font: 500 .75rem/1.3 inherit; font-style: normal; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
.dock button:hover em, .dock button:focus-visible em { opacity: 1; }
#moreButton { display: none; }
#toast { bottom: 96px; background: var(--lime); color: var(--lime-ink); border: 0; font-weight: 600; }
.live-bar { position: fixed; top: auto; bottom: calc(86px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: auto; min-width: 230px; margin: 0; background: #1b2420; border-color: #a3c97866; color: var(--lime); z-index: 19; }
.xp-flight { background: var(--lime); color: var(--lime-ink); border: 0; font-weight: 700; box-shadow: none; }

/* Hoje em blocos */
.today-head { align-items: center; margin-bottom: 16px; }
.today-head h1 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 600; letter-spacing: -.035em; }
.mode-block { display: grid; gap: 6px; justify-items: end; }
.mode-hint { margin: 0; font-size: .8rem; }
.mode-switch { background: var(--card); border-color: var(--line); }
.mode-switch button.active { background: var(--lime); color: var(--lime-ink); }
.day-banner { background: #1b2420; border-color: #a3c97844; color: var(--lime); }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
.bento > .command { grid-column: span 8; align-self: stretch; }
.bento > .metric-card { grid-column: span 4; align-self: stretch; }
.bento > .quick-actions { grid-column: span 12; margin: 0; }
.bento > .list-tile { grid-column: span 8; }
.bento > .side-stack { grid-column: span 4; display: grid; gap: 12px; }
.tile { padding: 18px; min-width: 0; }

.command.tile { padding: 0; grid-template-columns: minmax(0, 1fr) 280px; min-height: 290px; background: var(--card); overflow: hidden; }
.command:after { display: none; }
.command-copy { padding: 26px 8px 26px 26px; }
.command h2 { font-size: clamp(1.7rem, 2.8vw, 2.5rem); font-weight: 620; letter-spacing: -.04em; }
.command p { color: var(--muted); }
.badge { background: #a3c9781a; border: 0; color: var(--lime); border-radius: 8px; font-size: .7rem; font-weight: 650; }
.badge i, .pulse-dot { background: var(--lime); box-shadow: none; }
.focus-meta { color: var(--muted); }
.focus-meta span:last-child { color: var(--lime); }
.core-scene { min-height: 280px; }

.metric-card { display: flex; flex-direction: column; min-height: 290px; }
.metric-top { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); }
.metric-delta { color: var(--lime-ink); background: var(--lime); border-radius: 8px; padding: 1px 8px; font-weight: 650; font-size: .8rem; font-variant-numeric: tabular-nums; }
.metric-big { font-size: 3.4rem; line-height: 1.1; font-weight: 600; letter-spacing: -.05em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.metric-caption { color: var(--muted); font-size: .85rem; }
.day-bars { flex: 1; min-height: 78px; display: flex; align-items: flex-end; gap: 4px; margin: 14px 0; }
.day-bars i { flex: 1; min-width: 0; border-radius: 4px 4px 2px 2px; background: #ffffff14; }
.day-bars i.on { background: #6f8a2c; }
.day-bars i.today { background: #ffffff33; }
.day-bars i.today.on { background: var(--lime); }
.metric-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.metric-foot small { display: block; color: var(--muted); font-size: .75rem; }
.metric-foot b { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-foot b small { display: inline; }

.quick-actions .secondary { flex: 1 1 150px; background: var(--card); border-color: var(--line); font-weight: 550; }
.list-tile .compact { margin-bottom: 14px; }
.list-tile h2 { font-size: 1.1rem; }
.agenda { grid-template-columns: 1fr; gap: 14px; }
.agenda-group h3 { color: var(--muted); font-size: .72rem; }
.row { background: var(--card-2); border: 0; border-radius: 12px; min-height: 58px; margin-bottom: 6px; padding: 6px 12px 6px 7px; }
.row .check { width: 40px; min-height: 40px; height: 40px; }
.row-main small { color: var(--muted); }
.tag { background: #ffffff0f; }
.tag.star { background: #a3c9781f; color: var(--lime); }
.money, .water, .inbox { padding: 16px 18px; }
.money strong { color: var(--lime); }
.water strong { color: var(--text); }
.liquid-track { height: 12px; border: 0; background: #ffffff0f; border-radius: 8px; box-shadow: none; }
.liquid-track > div { background: var(--lime); border: 0; box-shadow: none; }
.money-hint.over { color: #ffb36c; }

/* Outras telas */
.greeting h1 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); font-weight: 600; }
.view-description { color: var(--muted); }
.manager-row { background: var(--card); border-color: var(--line); }
.manager-row em { color: var(--lime); }
.pick-list button { background: var(--card-2); border-color: var(--line-strong); }
.time-picks .selected, .pick-list .selected, .day-picks input:checked + span, .duration-options input:checked + span { background: #a3c9781f; border-color: var(--lime); color: var(--lime); }
.command-list button:hover, .command-list button.selected { background: #a3c9781a; border-color: transparent; }
.command-list button span { color: var(--lime); }
.progress-track i { background: var(--lime); }
.history-bar { background: var(--lime); }
.focus-dial { background: conic-gradient(var(--lime) var(--focus-progress, 0%), #ffffff14 0); box-shadow: none; }
.focus-dial > div { background: var(--card); border-color: var(--card); }
.focus-setup h2 span { color: var(--lime); }
.level-number { color: var(--lime); text-shadow: none; font-weight: 500; }
.achievement.earned { background: #c8f50512; border-color: #a3c97855; color: var(--lime); }
.calendar-day { background: var(--card-2); border-color: var(--line); }
.calendar-day.today { background: #c8f50514; border-color: #a3c97866; }
.calendar-day.trained small, .calendar-day.trained > strong { color: var(--lime); }
.rest-bar b, .last-time, .timer-small { color: var(--lime); }
.record-button strong { color: var(--lime); }
.insight > span { color: var(--lime); }
.setting input, .check-list input, .check-label input { accent-color: var(--lime); }
.transaction-sign { background: var(--card-2); }
.income { color: var(--lime); }
.notification-card { background: var(--card); }

@media (max-width: 1100px) {
  .bento > .command, .bento > .metric-card, .bento > .list-tile, .bento > .side-stack { grid-column: span 12; }
  .bento > .side-stack { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .metric-card { min-height: 0; }
  .day-bars { height: 80px; flex: none; }
}
@media (max-width: 860px) {
  main { padding: 0 16px 104px !important; }
  .dock { left: 10px; right: 10px; transform: none; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; bottom: calc(9px + env(safe-area-inset-bottom)); }
  .dock .dock-extra { display: none; }
  #moreButton { display: grid; }
  .dock button { width: 100%; height: 54px; min-height: 54px; align-content: center; gap: 2px; }
  .dock button:hover { transform: none; }
  .dock em { position: static; transform: none; opacity: 1; padding: 0; background: none; color: inherit; font-size: .68rem; }
  .user span:last-child { display: none; }
  .user { padding: 4px; }
  .date { display: none; }
  .command-button { margin-left: auto; }
  .live-bar { left: 10px; right: 10px; transform: none; bottom: calc(80px + env(safe-area-inset-bottom)); }
  #toast { bottom: 90px; }
}
@media (max-width: 620px) {
  .topbar { height: 60px; margin-bottom: 6px; }
  .mode-block { justify-items: stretch; margin-top: 12px; }
  .bento { gap: 10px; }
  .command.tile { display: block; min-height: 0; }
  .command-copy { padding: 16px; }
  .command h2 { padding-right: 92px; font-size: 1.5rem; }
  .core-scene { width: 104px; height: 104px; min-height: 0; top: 6px; right: 6px; }
  .bento > .quick-actions { order: 1; }
  .bento > .metric-card { order: 3; }
  .bento > .list-tile { order: 2; }
  .bento > .side-stack { order: 4; }
  .metric-big { font-size: 2.6rem; }
  .day-bars { height: 60px; }
  .tile { padding: 14px; }
}

@media (max-width: 620px) {
  .command h2 { min-height: 0; }
}


/* ================================================================
   Mundo 3D: a interface flutua sobre o campo.
   ================================================================ */
:root { --verde: #006437; }
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: -1; pointer-events: none; }
.world-on .glass, .world-on .tile, .world-on .budget-panel, .world-on .level-panel, .world-on .focus-setup, .world-on .focus-station,
.world-on .workout-live, .world-on .life-stat, .world-on .achievement, .world-on .manager-row {
  background: #0f1312c4; border-color: #a3c9781f;
  -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3);
}
.world-on .command.tile { background: linear-gradient(100deg, #0e1211d9 0 44%, #0e121140 72%, #0e121118); -webkit-backdrop-filter: none; backdrop-filter: none; }
.world-on .row { background: #ffffff0a; }
.world-on .metric-card { position: relative; }
.world-on .core-readout strong { text-shadow: 0 2px 14px #000, 0 0 22px #a3c97888; }
.world-on .greeting h1, .world-on .today-head h1 { text-shadow: 0 2px 24px #000c; }
.world-on .view-description, .world-on .day-summary, .world-on .mode-hint { text-shadow: 0 1px 10px #000; }
.world-on .topbar { position: relative; z-index: 3; }

/* Profundidade dos cartões */
.tile, .glass, .panel, .life-stat, .manager-row, .achievement, .focus-setup, .focus-station, .workout-live {
  position: relative; transform: perspective(1100px) rotateX(calc(var(--rx, 0deg) + var(--sr, 0deg))) rotateY(var(--ry, 0deg)); transform-style: flat;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), border-color .2s, box-shadow .25s;
  box-shadow: 0 18px 40px -22px #000, inset 0 1px #ffffff0f;
}
.tilting { transition: transform .06s linear, box-shadow .2s; box-shadow: 0 30px 60px -24px #000, 0 0 0 1px #a3c97844, inset 0 1px #ffffff1a; z-index: 2; }
.tilting::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), #a3c9781f, transparent 62%); }

/* Entrada em 3D ao trocar de aba */
.view.enter > *, .view.enter .bento > *, .view.enter .side-stack > * { animation: fly-in .72s cubic-bezier(.16,.9,.24,1) both; }
.view.enter .bento > :nth-child(2), .view.enter > :nth-child(2) { animation-delay: .06s; }
.view.enter .bento > :nth-child(3), .view.enter > :nth-child(3) { animation-delay: .12s; }
.view.enter .bento > :nth-child(4), .view.enter > :nth-child(4) { animation-delay: .18s; }
.view.enter .bento > :nth-child(5), .view.enter > :nth-child(n+5) { animation-delay: .24s; }
.view.enter .bento { animation: none; }
@keyframes fly-in { from { opacity: 0; transform: perspective(900px) translate3d(0, 46px, -160px) rotateX(24deg); } to { opacity: 1; } }

/* Botões com volume */
.primary { box-shadow: 0 4px 0 #5f7a45, 0 10px 22px -8px #a3c97866; transition: transform .1s, box-shadow .1s, background .15s; }
.primary:hover { box-shadow: 0 5px 0 #5f7a45, 0 14px 28px -8px #a3c97888; transform: translateY(-1px); }
.primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 #5f7a45; }
.secondary { box-shadow: 0 3px 0 #000; transition: transform .1s, box-shadow .1s, background .15s; }
.secondary:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }

/* Linha da missão */
.row { transition: transform .22s cubic-bezier(.2,.8,.2,1), background .2s; transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.row:hover { transform: perspective(700px) translateZ(14px); background: #ffffff12; }
.row.flip { animation: row-flip .62s cubic-bezier(.3,1.3,.5,1); }
@keyframes row-flip { from { transform: perspective(700px) rotateX(-100deg); opacity: .3; } to { transform: perspective(700px) rotateX(0); opacity: 1; } }
.row .check { transition: transform .15s; }
.row .check:hover { transform: scale(1.1) translateZ(0); }

/* Dock com relevo */
.dock { box-shadow: 0 18px 44px #000c, inset 0 1px #ffffff1c, 0 0 0 1px #a3c97814; }
.dock button.active { box-shadow: 0 3px 0 #5f7a45, 0 8px 18px -4px #a3c97880; transform: translateY(-3px); }
@media (min-width: 861px) { .dock button:hover { transform: translateY(-6px) scale(1.14); } }

/* Janelas abrem girando */
dialog[open] { animation: dialog-in .34s cubic-bezier(.16,.9,.24,1); }
@keyframes dialog-in { from { opacity: 0; transform: perspective(900px) translateY(24px) rotateX(-16deg) scale(.96); } }

.motion-paused .tile, .motion-paused .glass { transform: none; }
@media (prefers-reduced-motion: reduce) { .tile, .glass, .panel, .life-stat, .manager-row, .row { transform: none !important; } }

/* A barra 3D ocupa o espaço da caixa de barras */
.metric-card .day-bars { min-height: 96px; }

@media (max-width: 620px) {
  .world-on .glass, .world-on .tile, .world-on .life-stat, .world-on .manager-row, .world-on .achievement, .world-on .budget-panel, .world-on .level-panel { -webkit-backdrop-filter: none; backdrop-filter: none; background: #0f1312d6; }
  .world-on .command.tile { background: linear-gradient(180deg, #0e121166, #0e1211e0 62%); }
  .command-copy { padding-top: 150px; }
  .command h2 { padding-right: 0; }
  .core-scene { width: 170px; height: 170px; top: 4px; right: 50%; transform: translateX(50%); }
  .core-readout strong { font-size: 1.3rem; }
  .metric-card .day-bars { height: 96px; }
}


/* Plano de treino */
.plan-stack { display: grid; gap: 12px; }
.plan-card, .goal-card { padding: 20px; }
.plan-card h2, .goal-card h2 { font-size: 1.15rem; margin: 0; }
.ficha-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ficha-tabs button { min-height: 54px; padding: 6px; border-radius: 12px; background: #ffffff0a; border: 1px solid var(--line-strong); color: var(--text); font-size: .85rem; font-weight: 580; }
.ficha-tabs small { display: block; color: var(--lime); font-size: .7rem; font-weight: 600; }
.ficha-tabs .selected { background: #a3c9781f; border-color: var(--lime); }
.exercise-list details { border-bottom: 1px solid var(--line); }
.exercise-list summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 2px; cursor: pointer; list-style: none; }
.exercise-list summary::-webkit-details-marker { display: none; }
.exercise-list b { font-weight: 570; font-size: .95rem; }
.exercise-list b i { color: var(--lime); font-style: normal; }
.exercise-list span { color: var(--muted); font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.exercise-list p { margin: 0 0 12px; color: #c4c9c0; font-size: .875rem; line-height: 1.5; }
.goal-now { display: block; font-size: 2.8rem; line-height: 1.15; font-weight: 600; letter-spacing: -.04em; margin: 8px 0 10px; font-variant-numeric: tabular-nums; }
.goal-now small { font-size: 1rem; color: var(--muted); letter-spacing: 0; }
.goal-card .water-actions { margin-bottom: 8px; }
.goal-card .water-actions .secondary { flex: none; }
.chip-done { border-color: var(--lime); color: var(--lime); opacity: .75; }
#currentSet { line-height: 1.5; }
@media (max-width: 620px) { .ficha-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Treinador 3D */
.train-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 14px; }
.train-side { display: grid; gap: 12px; min-width: 0; }
.coach { position: sticky; top: 10px; border-radius: 20px; overflow: hidden; background: #0d1110e8; border: 1px solid #a3c97826; box-shadow: 0 24px 50px -28px #000; }
.coach-stage { position: relative; height: min(62vh, 520px); min-height: 340px; background: radial-gradient(ellipse at 50% 40%, #fbfcfa, #d9dfd9 78%); }
.coach-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.coach-stage canvas:active { cursor: grabbing; }
.coach-hint { position: absolute; right: 12px; top: 12px; padding: 3px 9px; border-radius: 8px; background: #ffffffb3; color: #4c564f; font-size: .72rem; pointer-events: none; }
.coach-info { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.coach-muscle { color: var(--lime); font-size: .75rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.coach-info h2 { margin: 4px 0 2px; font-size: 1.3rem; font-weight: 620; letter-spacing: -.02em; }
.coach-meta { margin: 0 0 8px; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.coach-tip { margin: 0; color: #d3d8d0; font-size: .92rem; line-height: 1.5; }
.ex-group { margin: 14px 0 4px; color: var(--lime); font-size: .75rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.ex-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 46px; padding: 8px 10px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 8px; color: inherit; cursor: pointer; }
.ex-row:hover { background: #ffffff0a; }
.ex-row.selected { background: #a3c9781c; box-shadow: inset 2px 0 var(--lime); }
.ex-row b { font-weight: 570; font-size: .93rem; }
.ex-row b i { color: var(--lime); font-style: normal; }
.ex-row span { color: var(--muted); font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  .train-layout { grid-template-columns: 1fr; }
  .coach { position: relative; top: 0; scroll-margin-top: 8px; }
  .coach-stage { height: 46vh; min-height: 300px; }
}


/* Paleta final: fundo quase preto esverdeado, cards grafite, verde sálvia só na ação. */
:root {
  --bg: #0c100f; --card: #151b19; --card-2: #202925; --line: #28332d; --line-strong: #34423a;
  --text: #f2f5f0; --muted: #9da9a1; --lime: #a3c978; --lime-ink: #10160f; --violet: #a3c978; --cyan: #a3c978; --accent: #a3c978;
}
body { background: var(--bg); }
.world-on .glass, .world-on .tile, .world-on .budget-panel, .world-on .level-panel, .world-on .focus-setup, .world-on .focus-station,
.world-on .workout-live, .world-on .life-stat, .world-on .achievement, .world-on .manager-row, .world-on .plan-card, .world-on .goal-card {
  background: #151b19e6; border-color: var(--line); -webkit-backdrop-filter: none; backdrop-filter: none;
}
.world-on .command.tile { background: linear-gradient(100deg, #151b19f0 0 46%, #151b1966 78%, #151b1933); border-color: var(--line); }
.world-on .row { background: var(--card-2); }
.row { border-left-color: var(--line); }
.row .check { border-color: var(--line-strong); color: var(--muted); }
.row .check:hover { background: #ffffff0a; }
.row.done { border-left-color: var(--lime); }
.row.done .check { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.primary, .primary:hover { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); box-shadow: none; transform: none; }
.primary:hover { background: #d4f0a0; border-color: #d4f0a0; }
.primary:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.secondary { background: var(--card-2); border-color: var(--line); color: var(--text); box-shadow: none; }
.secondary:hover { background: #28332d; }
.secondary:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.tile, .glass, .panel, .life-stat, .manager-row, .achievement, .focus-setup, .focus-station, .workout-live { box-shadow: none; }
.tilting { box-shadow: 0 16px 34px -22px #000; }
.tilting::before { display: none; }
.dock { background: #151b19f2; border-color: var(--line); box-shadow: 0 14px 34px -14px #000; }
.dock button.active { background: var(--lime); color: var(--lime-ink); box-shadow: none; transform: none; }
.brand-icon { background: var(--lime); color: var(--lime-ink); box-shadow: none; }
.command-button, .user, .mode-switch { background: var(--card); border-color: var(--line); }
.mode-switch button.active { background: var(--lime); color: var(--lime-ink); }
.badge { background: #a3c97818; color: var(--lime); }
.metric-delta { background: #a3c97822; color: var(--lime); }
.day-bars i { background: #28332d; }
.day-bars i.on { background: #5f7a45; }
.day-bars i.today { background: #34423a; }
.day-bars i.today.on { background: var(--lime); }
.day-banner { background: var(--card); border-color: var(--line); color: var(--text); }
.xp-flight { background: var(--card-2); color: var(--lime); border: 1px solid var(--line); box-shadow: none; }
#toast { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.live-bar { background: var(--card-2); border-color: var(--line); color: var(--lime); }
dialog { background: var(--card); border-color: var(--line); box-shadow: 0 24px 60px #0009; }
input, select, textarea { background: #0c100f; border-color: var(--line); }
.coach { background: var(--card); border-color: var(--line); box-shadow: none; }
.ex-row.selected { background: #a3c9781a; }
.tag.star { background: #a3c97818; color: var(--lime); }
.focus-dial { box-shadow: none; }
.level-number, .metric-big { text-shadow: none; }
