:root {
  --bg: #f3f6f4;
  --bg-accent: #e7f2ec;
  --bg-glow-1: #d9f3e8;
  --bg-glow-2: #eef6f1;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --ink: #14201b;
  --muted: #5d6f67;
  --line: #d7e2dc;
  --brand: #0f8f6a;
  --brand-dark: #0b6f53;
  --brand-soft: #e6f6ef;
  --amber: #d97706;
  --amber-soft: #fff7ed;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --header-bg: rgba(255, 255, 255, 0.82);
  --chip: #eef3f0;
  --ok-soft: #e7f7ef;
  --ok-ink: #0f6b4c;
  --warn-soft: #fff4e5;
  --warn-ink: #9a5b00;
  --info-soft: #f3f8fc;
  --info-line: #d7e6f2;
  --info-ink: #0b5f8a;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(20, 32, 27, 0.06);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Syne", "DM Sans", system-ui, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0f1613;
  --bg-accent: #15201b;
  --bg-glow-1: #16352b;
  --bg-glow-2: #1a2420;
  --surface: #17211c;
  --surface-2: #1c2923;
  --ink: #e8f0eb;
  --muted: #9bb0a6;
  --line: #2a3a33;
  --brand: #2ecf9a;
  --brand-dark: #7ee0bc;
  --brand-soft: #1a3329;
  --amber: #f0b429;
  --amber-soft: #2a2112;
  --danger: #f87171;
  --danger-soft: #3a1b1b;
  --header-bg: rgba(15, 22, 19, 0.88);
  --chip: #24312b;
  --ok-soft: #1a3329;
  --ok-ink: #7ee0bc;
  --warn-soft: #332514;
  --warn-ink: #f0b429;
  --info-soft: #152430;
  --info-line: #2a4050;
  --info-ink: #7eb8d9;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, var(--bg-glow-1) 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, var(--bg-glow-2) 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, strong { font-family: var(--display); }

.container {
  width: min(920px, calc(100% - 1.25rem));
  margin-inline: auto;
}
@media (min-width: 480px) {
  .container { width: min(920px, calc(100% - 2rem)); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}
.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: white;
}
.brand strong {
  display: block;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand small { color: var(--muted); font-size: 0.75rem; }

.main { padding: 1.25rem 0 3.5rem; }
@media (min-width: 640px) {
  .main { padding: 2rem 0 4rem; }
}

.hero-intro {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 1.75rem;
}
.hero-intro h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.03em;
}
.hero-intro p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
@media (min-width: 640px) {
  .panel { padding: 2rem; }
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
  .wizard-steps { grid-template-columns: repeat(4, 1fr); }
}
.wizard[data-wizard] .wizard-steps:has([data-step-indicator="1"]:last-child),
.wizard-steps:has(.wizard-step:nth-child(2):last-child) {
  grid-template-columns: repeat(2, 1fr);
}
.wizard-step .bar {
  display: block;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.25s ease;
}
.wizard-step.is-active .bar,
.wizard-step.is-done .bar { background: var(--brand); }
.wizard-step .label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9aaba3;
}
.wizard-step.is-active .label,
.wizard-step.is-done .label { color: var(--brand-dark); }

.form-panel h2 { margin: 0; font-size: 1.35rem; }
.muted { color: var(--muted); margin: 0.35rem 0 1.25rem; line-height: 1.5; }
.tiny { font-size: 0.75rem; }
.right { text-align: right; }
.eyebrow {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.accent { color: var(--brand); }

.field { display: block; margin-bottom: 1rem; }
.field > span {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.field em { font-style: normal; font-weight: 400; color: #9aaba3; }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.75rem 0.85rem;
  background: var(--surface-2);
  color: var(--ink);
  caret-color: var(--ink);
  font-size: 1rem; /* evita zoom automático no iOS */
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 143, 106, 0.15);
  background: var(--surface-2);
  color: var(--ink);
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea {
  background: #0c1210;
  color: #e8f0eb;
  border-color: #3a4d44;
}
html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .field select:focus,
html[data-theme="dark"] .field textarea:focus {
  background: #101815;
  color: #e8f0eb;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(46, 207, 154, 0.2);
}
html[data-theme="dark"] .field input::placeholder,
html[data-theme="dark"] .field textarea::placeholder {
  color: #8aa297;
}
/* Chrome/Safari autofill força fundo claro — reescurece no tema escuro */
html[data-theme="dark"] .field input:-webkit-autofill,
html[data-theme="dark"] .field input:-webkit-autofill:hover,
html[data-theme="dark"] .field input:-webkit-autofill:focus,
html[data-theme="dark"] .field textarea:-webkit-autofill,
html[data-theme="dark"] .field select:-webkit-autofill {
  -webkit-text-fill-color: #e8f0eb;
  caret-color: #e8f0eb;
  box-shadow: 0 0 0 1000px #0c1210 inset;
  transition: background-color 99999s ease-out;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.bmi-box, .hr-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  margin-bottom: 1rem;
}
.hr-box { display: block; background: var(--brand-soft); border-color: var(--line); }
.hr-box .eyebrow { color: var(--brand-dark); }
.bmi-value { font-size: 1.6rem; font-weight: 800; margin: 0; }
.bmi-label { margin: 0.2rem 0 0; font-weight: 700; }
.bmi-ok { color: var(--brand); }
.bmi-low { color: #0284c7; }
.bmi-warn { color: #d97706; }
.bmi-high { color: #dc2626; }

.goal-grid {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .goal-grid { grid-template-columns: 1fr 1fr; }
}
.goal-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1rem;
  cursor: pointer;
  transition: 0.2s ease;
  background: var(--surface);
  min-height: 3rem;
}
.goal-card input { position: absolute; opacity: 0; pointer-events: none; }
.goal-card strong { display: block; margin-bottom: 0.25rem; }
.goal-card span { display: block; font-size: 0.8rem; color: var(--muted); line-height: 1.4; }
.goal-card.is-active,
.goal-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(15, 143, 106, 0.12);
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.4rem;
}
@media (min-width: 480px) {
  .day-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.day-chip {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  text-align: center;
  padding: 0.75rem 0;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface);
  min-height: 2.75rem;
  display: grid;
  place-items: center;
}
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip.is-active,
.day-chip:has(input:checked) {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.form-actions .btn {
  flex: 1 1 auto;
  min-width: min(100%, 8rem);
}
.btn {
  border: 0;
  border-radius: 0.75rem;
  padding: 0.8rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
  min-height: 2.75rem;
}
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--chip); }
.btn-block { width: 100%; margin-top: 1rem; }
.btn[hidden] { display: none !important; }

.alert {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
}
.alert-error {
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: var(--danger);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.back-link:hover { color: var(--ink); }

.plan-summary-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}
.plan-summary h1 {
  margin: 0.25rem 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}
.progress-stat { text-align: right; }
.progress-value {
  margin: 0.15rem 0 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--brand);
}
.progress-bar {
  margin-top: 1rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
  transition: width 0.4s ease;
}
.progress-bar.amber > span {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.game-panel { margin-top: 1.25rem; }
.game-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.game-level { display: flex; align-items: center; gap: 0.75rem; }
.game-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 1.1rem;
}
.points { margin: 0.1rem 0 0; font-size: 1.15rem; font-weight: 800; }
.game-bar-wrap { flex: 1; min-width: 160px; max-width: 280px; }

.badge-grid {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
@media (min-width: 480px) {
  .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 800px) {
  .badge-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.badge {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0.85rem;
  padding: 0.65rem 0.35rem;
  text-align: center;
  opacity: 0.65;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
}
.badge.is-earned {
  opacity: 1;
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}
.badge-dot {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0 auto 0.35rem;
  border-radius: 999px;
  background: var(--chip);
  font-size: 0.75rem;
}
.badge.is-earned .badge-dot { background: #f59e0b; color: white; }

.celebrate {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.9rem;
  border: 1px solid #fcd34d;
  background: linear-gradient(90deg, #fffbeb, #fef3c7);
  display: grid;
  gap: 0.2rem;
  animation: bounce-in 0.45s ease;
}
@keyframes bounce-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.days { margin-top: 1.25rem; display: grid; gap: 0.75rem; }
.day-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.day-card.is-done {
  border-color: #86efac;
  background: #f0fdf4;
}
.day-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.day-index {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--ink);
  font-weight: 800;
  flex-shrink: 0;
}
.day-index.done { background: var(--brand); color: #fff; }
.day-meta { display: grid; gap: 0.1rem; flex: 1; color: var(--ink); }
.day-meta strong { color: var(--ink); }
.day-meta small { color: var(--muted); }
.day-count { color: var(--muted); font-size: 0.75rem; display: none; }
@media (min-width: 640px) { .day-count { display: inline; } }

.day-body {
  border-top: 1px solid var(--line);
  padding: 1rem 1.1rem 1.2rem;
}
.exercise-list { list-style: none; margin: 0; padding: 0; }
.exercise-row {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) {
  .exercise-row {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
}
.ex-illust {
  position: relative;
  width: 5.75rem;
  height: 7rem;
  margin: 0;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  flex-shrink: 0;
}
.ex-illust.has-photo {
  width: 6.5rem;
  height: 8rem;
  box-shadow: var(--shadow);
}
.ex-illust img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.ex-illust svg { width: 100%; height: 100%; display: block; }
.ex-illust-bg { fill: var(--surface-2); }
.ex-illust-label { fill: var(--muted); font-size: 8px; font-weight: 700; font-family: var(--font); }
.ex-illust-badge {
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  bottom: 0.35rem;
  padding: 0.2rem 0.35rem;
  border-radius: 999px;
  background: rgba(15, 22, 19, 0.72);
  color: #e8f0eb;
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  backdrop-filter: blur(4px);
}
.ex-illust-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
@media (min-width: 720px) {
  .ex-illust { width: 6.5rem; height: 8rem; }
  .ex-illust.has-photo { width: 7.25rem; height: 9rem; }
}
.exercise-info strong { display: block; font-size: 0.95rem; }
.exercise-info small { color: var(--muted); line-height: 1.4; }
.exercise-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}
.exercise-info strong { color: var(--ink); }

.tips-grid {
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
}
@media (min-width: 720px) {
  .tips-grid { grid-template-columns: 1fr 1fr; }
}
.tip-card h3 { margin: 0 0 0.75rem; }
.tip-card p, .tip-card li {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.925rem;
}
.tip-card ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.5rem;
}

.week-done {
  margin-top: 1.25rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: white;
  text-align: center;
  padding: 1.5rem;
}
.week-done p { margin: 0.4rem 0 0; color: #d1fae5; }

[hidden] { display: none !important; }

.header-admin-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
}
.header-admin-link:hover { color: var(--brand-dark); border-color: var(--brand); }

.admin-header .brand-mark {
  background: #0f172a;
  font-weight: 800;
}
.admin-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}
.admin-user {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.inline-form { display: inline; margin: 0; }

.admin-login {
  min-height: 60vh;
  display: grid;
  place-items: center;
}
.login-panel {
  width: min(420px, 100%);
}
.login-panel h1 { margin: 0.35rem 0 0.4rem; }
.login-form { margin-top: 1.25rem; }

.admin-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}
.admin-top h1 { margin: 0; }
.admin-search {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-search input {
  min-width: 220px;
  border: 1px solid #c9d6cf;
  border-radius: 0.7rem;
  padding: 0.7rem 0.85rem;
  background: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
}
.stat-card .stat-value {
  margin: 0.35rem 0 0;
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--display);
}

.table-panel h2 { margin: 0 0 1rem; font-size: 1.2rem; }
.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid #eef2ef;
  vertical-align: middle;
}
.admin-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.admin-table .actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: center;
}
.admin-table .actions form { margin: 0; }
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger:hover { background: #fecaca; }
.alert-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.header-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.header-user:hover {
  color: var(--brand-dark);
}
.header-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.profile-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.profile-hero-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.profile-hero h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}
.profile-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), #0a6b52);
  flex-shrink: 0;
}
.profile-avatar-img {
  object-fit: cover;
  padding: 0;
  display: block;
}
.profile-avatar-panel {
  margin-bottom: 1.25rem;
}
.profile-avatar-panel h3 {
  margin-top: 0;
}
.avatar-upload-form {
  margin-top: 0.85rem;
}
.avatar-remove-form {
  margin-top: 0.75rem;
}
.profile-hero-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.profile-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
  .profile-grid { grid-template-columns: 1fr 1fr; }
}
.profile-dl {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.profile-dl div {
  display: grid;
  gap: 0.15rem;
}
.profile-dl dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.profile-dl dd {
  margin: 0;
  font-weight: 600;
}
.profile-section {
  margin-top: 1.25rem;
}
.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.profile-section-head h2 { margin: 0; }
.profile-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.profile-pill.ok {
  background: var(--ok-soft);
  color: var(--ok-ink);
}
.profile-pill.warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}
.profile-lifestyle-grid {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 640px) {
  .profile-lifestyle-grid { grid-template-columns: 1fr 1fr; }
}
.profile-kv {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface-2);
}
.profile-kv span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.profile-kv strong {
  font-weight: 600;
  color: var(--ink);
}
.profile-kv-wide {
  grid-column: 1 / -1;
}
.profile-note-row td {
  padding-top: 0;
  border-top: none;
  font-size: 0.9rem;
}
.auth-screen {
  min-height: 62vh;
  display: grid;
  place-items: center;
}
.auth-screen-visual {
  width: min(920px, 100%);
  gap: 1rem;
  place-items: stretch;
}
@media (min-width: 860px) {
  .auth-screen-visual {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: stretch;
    min-height: 70vh;
  }
}
.auth-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 220px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(15, 143, 106, 0.55), rgba(15, 22, 19, 0.92) 55%),
    radial-gradient(circle at 20% 20%, rgba(126, 224, 188, 0.35), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(46, 207, 154, 0.25), transparent 40%),
    #0f1613;
  color: #e8f0eb;
  display: grid;
  align-items: end;
  padding: 1.4rem;
}
body.visual-health .auth-visual {
  background:
    linear-gradient(160deg, rgba(14, 116, 144, 0.55), rgba(15, 22, 19, 0.92) 58%),
    radial-gradient(circle at 18% 25%, rgba(126, 184, 217, 0.35), transparent 48%),
    radial-gradient(circle at 85% 70%, rgba(46, 180, 160, 0.28), transparent 42%),
    #0f1613;
}
.auth-visual-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin: 0.35rem 0 0.45rem;
  line-height: 1.15;
}
.auth-visual-text {
  margin: 0;
  color: rgba(232, 240, 235, 0.82);
  max-width: 28ch;
}
.auth-panel {
  width: min(440px, 100%);
  justify-self: center;
}
@media (min-width: 860px) {
  .auth-panel { width: 100%; align-self: center; }
}
.auth-panel h1 {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.7rem;
}
.auth-offer {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.85rem;
  border-left: 3px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.35;
}
.auth-offer strong {
  color: var(--brand-dark);
  font-weight: 700;
}
.auth-offer-compact {
  margin: 1.1rem 0 0;
  text-align: center;
  border-left: none;
  background: transparent;
  padding: 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.auth-switch {
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.925rem;
}
.auth-switch a {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.my-plans {
  margin-bottom: 1.25rem;
}
.my-plans h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}
.my-plans-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.my-plans-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface-2);
}
.my-plans-list a:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.my-plans-list small { color: var(--muted); }

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px) {
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid-4 { grid-template-columns: 1fr; }
}

.admin-create-user {
  margin-top: 0.5rem;
}
.admin-create-user .btn {
  margin-top: 0.25rem;
}
.admin-nav a {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.admin-nav a:hover { color: var(--brand-dark); }

.user-score-bar {
  position: sticky;
  top: 4.5rem;
  z-index: 15;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
}
.user-score-main {
  display: grid;
  gap: 1rem;
}
@media (min-width: 800px) {
  .user-score-main {
    grid-template-columns: 1.1fr 1.4fr auto;
    align-items: center;
  }
}
.user-score-value {
  margin: 0.15rem 0;
  font-size: 1.9rem;
  font-weight: 800;
  font-family: var(--display);
  color: var(--brand-dark);
  line-height: 1;
}
.user-score-commitment-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.user-score-commitment-top strong {
  font-size: 1.2rem;
  color: var(--amber);
}
.user-score-stats {
  display: flex;
  gap: 1.25rem;
}
.user-score-stat {
  margin: 0.2rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--display);
}

.supplements-panel {
  margin-top: 1.25rem;
}
.supplements-head h3 {
  margin: 0 0 0.35rem;
}
.supplements-head .muted {
  margin: 0 0 1rem;
}
.supplements-grid {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 720px) {
  .supplements-grid { grid-template-columns: repeat(3, 1fr); }
}
.supplement-card {
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface-2);
  padding: 1rem;
}
.supplement-card strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--brand-dark);
}
.supplement-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.health-care-panel {
  margin-top: 1.25rem;
}
.health-care-card {
  background: var(--info-soft);
  border-color: var(--info-line);
}
.health-care-card strong {
  color: var(--info-ink);
}

.field em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85em;
}

.motivation-banner {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
}
.motivation-banner .eyebrow {
  margin: 0 0 0.35rem;
  color: var(--brand-dark);
}
.motivation-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
  font-weight: 600;
  color: var(--ink);
  font-family: Syne, sans-serif;
}
.motivation-disciplina { border-left-color: #5f7a4a; }
.motivation-autoestima { border-left-color: #2f6f95; background: var(--info-soft); }
.motivation-autoestima .eyebrow { color: var(--info-ink); }
.motivation-superacao { border-left-color: #b06a2b; background: var(--warn-soft); }
.motivation-superacao .eyebrow { color: var(--warn-ink); }
.motivation-equilibrio { border-left-color: #5a5f9a; }

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 700;
  text-decoration: none;
}
.btn-google:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.theme-toggle {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--chip);
  border-color: var(--brand);
}
.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

html[data-theme="dark"] .celebrate {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--ink);
}
html[data-theme="dark"] .day-card.is-done {
  background: var(--ok-soft);
  border-color: var(--brand);
}
html[data-theme="dark"] .day-index:not(.done) {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
html[data-theme="dark"] .exercise-stats {
  color: var(--brand-dark);
}
html[data-theme="dark"] .admin-table th {
  background: var(--surface-2);
}
html[data-theme="dark"] .admin-table td,
html[data-theme="dark"] .admin-table th {
  border-color: var(--line);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-divider span { flex-shrink: 0; }

/* —— Mobile adaptations —— */
@media (max-width: 640px) {
  .brand small { display: none; }
  .header-actions {
    justify-content: flex-end;
    gap: 0.4rem;
    max-width: 62%;
  }
  .header-user {
    max-width: 6.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-link-profile { display: none; }
  .header-admin-link {
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
  }
  .wizard-step .label {
    font-size: 0.68rem;
    line-height: 1.2;
  }
  .plan-summary h1 { font-size: 1.35rem; }
  .progress-stat { text-align: left; width: 100%; }
  .game-bar-wrap { max-width: none; width: 100%; }
  .user-score-bar { top: 3.75rem; padding: 0.85rem; }
  .user-score-stats { width: 100%; justify-content: space-between; }
  .admin-header .header-inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .admin-nav {
    width: 100%;
    justify-content: flex-start;
  }
  .profile-hero-main { width: 100%; }
  .profile-hero-actions { width: 100%; }
  .profile-hero-actions .btn { width: 100%; }
  .auth-panel,
  .login-panel {
    padding: 1.25rem;
  }
  .my-plans-list a {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .exercise-stats {
    width: 100%;
  }
  .table-wrap {
    -webkit-overflow-scrolling: touch;
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
  }
  .admin-table {
    min-width: 560px;
  }
}

@media (max-width: 380px) {
  .header-actions .header-admin-link[href*="admin"] {
    display: none;
  }
  .day-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mapa · Perto de mim */
body.map-page .container.main {
  max-width: min(1180px, calc(100% - 1.5rem));
}
.hero-map-link {
  margin: 1rem 0 0;
}
.map-shell {
  display: grid;
  gap: 1rem;
}
.map-toolbar h1 {
  margin: 0.2rem 0 0.35rem;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
}
.map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  cursor: pointer;
  font-size: 0.85rem;
  user-select: none;
}
.map-chip input {
  accent-color: var(--brand);
}
.map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
}
.map-radius-field {
  min-width: 7rem;
  margin: 0;
}
.map-city-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  flex: 1 1 220px;
}
.map-city-form .field {
  flex: 1 1 180px;
  margin: 0;
}
.map-status {
  margin: 0;
  min-height: 1.2em;
}
.map-layout {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 900px) {
  .map-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
    align-items: stretch;
    min-height: 62vh;
  }
}
.map-canvas {
  width: 100%;
  height: min(58vh, 520px);
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  background: #1a1f1c;
  z-index: 0;
}
@media (min-width: 900px) {
  .map-canvas { height: 100%; min-height: 420px; }
}
.map-list-panel {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  padding: 0.85rem 0.9rem;
  overflow: auto;
  max-height: min(58vh, 520px);
}
.map-list-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}
.map-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.map-result-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  display: grid;
  gap: 0.15rem;
}
.map-result-btn:hover {
  border-color: var(--brand);
}
.map-result-btn strong {
  font-size: 0.92rem;
}
.map-result-btn span,
.map-result-btn small {
  font-size: 0.8rem;
}
.map-empty {
  padding: 0.5rem 0.15rem;
}
.map-attribution {
  margin: 0;
}
.map-attribution a {
  color: var(--brand-dark);
}
.map-pin {
  background: transparent;
  border: none;
}
.map-pin-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.admin-settings-panel h2 {
  margin-top: 0;
}
.admin-settings-form {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  max-width: 32rem;
}
.admin-toggle {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  cursor: pointer;
}
.admin-toggle input {
  margin-top: 0.2rem;
  accent-color: var(--brand);
  width: 1.1rem;
  height: 1.1rem;
}
.admin-toggle strong {
  display: block;
  margin-bottom: 0.15rem;
}
.admin-toggle small {
  display: block;
}

.profile-body-panel {
  margin-bottom: 1.25rem;
}
.profile-body-panel h3 {
  margin-top: 0;
}
.profile-body-form {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.75rem;
}

/* Temas visuais: academia vs saúde */
body.visual-gym {
  background:
    radial-gradient(1100px 480px at 8% -8%, color-mix(in srgb, var(--brand) 28%, transparent) 0%, transparent 55%),
    radial-gradient(800px 360px at 100% 0%, rgba(240, 180, 41, 0.12) 0%, transparent 50%),
    var(--bg);
}
body.visual-health {
  background:
    radial-gradient(1100px 480px at 12% -10%, rgba(14, 116, 144, 0.22) 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 5%, rgba(46, 180, 160, 0.16) 0%, transparent 48%),
    var(--bg);
}
.hero-visual h1 { max-width: 18ch; }
.goal-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--brand-soft);
  color: var(--brand-dark);
  margin-bottom: 0.45rem;
}
.goal-icon svg { width: 1.55rem; height: 1.55rem; }
.goal-card.goal-health .goal-icon {
  background: var(--info-soft);
  color: var(--info-ink);
}
.goal-card {
  display: grid;
}

.progress-stack {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 860px) {
  .progress-stack {
    grid-template-columns: 1fr 1.1fr;
    align-items: stretch;
  }
}
.progress-panel-head h2 {
  margin: 0.2rem 0 0.25rem;
  font-size: 1.15rem;
}
.week-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
  align-items: end;
  min-height: 160px;
  margin-top: 0.85rem;
}
.week-bar-col {
  display: grid;
  gap: 0.4rem;
  justify-items: center;
  height: 100%;
}
.week-bar-track {
  width: 100%;
  height: 130px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: color-mix(in srgb, var(--line) 45%, transparent);
  border-radius: 999px;
  padding: 0.25rem;
}
.week-bar {
  width: 70%;
  min-height: 8%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  display: grid;
  place-items: start center;
  transition: height 0.25s ease;
}
.week-bar.is-on {
  background: linear-gradient(180deg, var(--brand-dark), var(--brand));
}
.week-bar em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.35rem;
}
.week-bar-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}
.cal-weekdays {
  margin: 0.85rem 0 0.45rem;
}
.cal-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  position: relative;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid transparent;
}
.cal-cell.is-empty { visibility: hidden; }
.cal-cell.is-today {
  border-color: var(--brand);
  color: var(--ink);
  font-weight: 700;
}
.cal-cell.has-activity {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--brand-dark);
  font-weight: 700;
}
.cal-dot {
  position: absolute;
  bottom: 0.28rem;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 999px;
  background: var(--brand);
}

