/* RateNow — estilo inspirado nas diretrizes de interface da Apple (iOS) */
:root {
  /* Marca RateNow: ouro #F2A900, azul-noite #0E1A3A, névoa #DDE7F5, papel #FFFBF3 */
  --gold: #f2a900;
  --navy: #0e1a3a;
  --mist: #dde7f5;
  --bg: #f7f2e8;
  --card: #ffffff;
  --card-2: #f7f2e8;
  --label: #0e1a3a;
  --label-2: rgba(14, 26, 58, 0.62);
  --label-3: rgba(14, 26, 58, 0.32);
  --sep: rgba(14, 26, 58, 0.14);
  --fill: rgba(14, 26, 58, 0.09);
  --fill-2: rgba(14, 26, 58, 0.05);
  --tint: #8a5c00;
  --accent: #f2a900;
  --on-accent: #0e1a3a;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --star: #f2a900;
  --bar-bg: rgba(247, 242, 232, 0.8);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070c1c;
    --card: #111a33;
    --card-2: #1a2545;
    --label: #fffbf3;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.55);
    --fill: rgba(120, 120, 128, 0.32);
    --fill-2: rgba(120, 120, 128, 0.18);
    --tint: #f2a900;
    --accent: #f2a900;
    --on-accent: #0e1a3a;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --star: #f2a900;
    --bar-bg: rgba(7, 12, 28, 0.8);
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 17px/1.35 var(--font);
  letter-spacing: -0.41px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
a { color: var(--tint); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; }
input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
svg { display: block; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 45%, transparent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--label-2); }
.small { font-size: 13px; letter-spacing: -0.08px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }

/* ---------- Barra de navegação ---------- */
.navbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  background: transparent; border-bottom: 0.5px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.navbar.scrolled { background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom-color: var(--sep); }
.nav-title { font-weight: 600; opacity: 0; transform: translateY(4px); transition: opacity 0.2s, transform 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }
.navbar.scrolled .nav-title { opacity: 1; transform: none; }
.nav-side { display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav-side.right { justify-content: flex-end; }
.nav-back { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 6px; font-size: 17px; min-width: 0; }
.nav-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.nav-back svg { width: 12px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--label-2); }
.icon-btn.tint { color: var(--tint); }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { opacity: 0.4; }

/* ---------- Conteúdo ---------- */
.content {
  max-width: 720px; margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) calc(120px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.large-title { font-size: 34px; line-height: 41px; font-weight: 800; letter-spacing: -0.9px; margin: 2px 4px 14px; }
.page-enter { animation: enter 0.38s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

.section-h { font-size: 13px; text-transform: uppercase; color: var(--label-2); letter-spacing: -0.08px; margin: 26px 16px 7px; display: flex; gap: 6px; }
.section-f { font-size: 13px; color: var(--label-2); margin: 7px 16px 0; letter-spacing: -0.08px; display: flex; gap: 6px; align-items: center; }
.section-f svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.section-f.center { justify-content: center; margin-top: 28px; }

/* Lista agrupada (inset grouped) */
.group { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.group > li, .group > .row { position: relative; }
.group > li + li::before, .group > .row + .row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); z-index: 1;
}
.row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 11px 16px; width: 100%; text-align: left; background: var(--card); }
.row-btn { color: var(--label); transition: background 0.15s; }
.row-btn:active { background: var(--fill-2); }
.row-btn.destructive, .destructive { color: var(--red); }
.danger-group { margin-top: 28px; }
.danger-group .row { justify-content: center; }
.chev { width: 8px; height: 14px; flex: none; fill: none; stroke: var(--label-3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.input { border: 0; outline: 0; background: transparent; width: 100%; resize: none; }
textarea.input { line-height: 1.4; min-height: 44px; }
.input::placeholder { color: var(--label-3); }
.group .input.row:focus-visible { outline: none; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border-radius: 14px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 17px;
  transition: transform 0.15s var(--ease), opacity 0.15s;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn:disabled { background: var(--fill); color: var(--label-3); transform: none; cursor: default; }
.btn-block { width: 100%; }
.btn-gray { background: var(--fill); color: var(--tint); }
.link-btn { display: block; margin: 12px auto 0; color: var(--tint); font-size: 15px; text-align: center; padding: 6px; }

.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep);
}
.footer-bar > * { max-width: 688px; margin-left: auto; margin-right: auto; }

/* ---------- Avatar, pill, estrelas ---------- */
.avatar { flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; background: linear-gradient(180deg, color-mix(in srgb, var(--av) 82%, #fff), var(--av)); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; letter-spacing: -0.05px; white-space: nowrap; }
.pill-green { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.pill-orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 15%, transparent); }
.pill-red { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.pill-gray { color: var(--label-2); background: var(--fill); }

.star { fill: currentColor; }
.star.inline { display: inline-block; width: 13px; height: 13px; color: var(--star); vertical-align: -1px; }
.stars-ro { position: relative; display: inline-block; width: max-content; justify-self: start; flex: none; line-height: 0; vertical-align: middle; }
.stars-ro .stars-bg, .stars-ro .stars-fg { display: flex; gap: 1px; }
.stars-ro .stars-bg { color: var(--fill); }
.stars-ro .stars-fg { position: absolute; inset: 0; overflow: hidden; color: var(--star); }
.stars-ro .star { width: var(--s); height: var(--s); flex: none; }

/* ---------- Login ---------- */
.auth { min-height: 100dvh; max-width: 400px; margin: 0 auto; padding: calc(12vh + env(safe-area-inset-top)) 20px 40px; text-align: center; }
.auth-icon { width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center; background: var(--navy); box-shadow: 0 10px 30px rgba(14, 26, 58, 0.28); }
.auth-icon .star { width: 56px; height: 56px; color: var(--gold); }
.auth h1 { font-size: 34px; margin: 0 0 6px; font-weight: 800; letter-spacing: -0.9px; }
.auth p { margin: 0 0 28px; }
.auth-form { display: grid; gap: 12px; text-align: left; }
.form-error { color: var(--red); font-size: 15px; margin: 4px 4px 0; min-height: 1px; }
.form-error:empty { display: none; }

/* ---------- Início ---------- */
.eval-row { gap: 14px; padding-top: 14px; padding-bottom: 14px; }
.eval-main { flex: 1; min-width: 0; }
.eval-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eval-sub { font-size: 14px; color: var(--label-2); margin-top: 1px; letter-spacing: -0.15px; }
.eval-pill { margin-top: 7px; }
.eval-avg { display: grid; justify-items: end; gap: 3px; }
.eval-avg strong { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.35px; }

.empty { text-align: center; padding: 10vh 24px 0; }
.empty-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); }
.empty-icon .star { width: 36px; height: 36px; color: var(--star); }
.empty h2 { font-size: 22px; margin: 0 0 6px; }
.empty p { color: var(--label-2); margin: 0 auto 24px; max-width: 320px; }
.empty-inline { padding: 20px; text-align: center; color: var(--label-2); background: var(--card); border-radius: var(--radius); font-size: 15px; }

/* ---------- Nova avaliação ---------- */
.stepper-row { min-height: 56px; }
.stepper { display: flex; align-items: center; background: var(--fill-2); border-radius: 9px; height: 34px; }
.stepper button { width: 40px; height: 34px; display: grid; place-items: center; color: var(--tint); }
.stepper button:active { background: var(--fill); }
.stepper button:first-child { border-radius: 9px 0 0 9px; }
.stepper button:last-child { border-radius: 0 9px 9px 0; }
.stepper svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.stepper output { min-width: 64px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px; border-left: 0.5px solid var(--sep); border-right: 0.5px solid var(--sep); line-height: 18px; }
.chips { gap: 8px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 15px; background: var(--fill-2); font-size: 14px; font-weight: 500; color: var(--label); transition: background 0.15s, color 0.15s; }
.chip.active { background: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { .chip.active { background: var(--accent); color: var(--on-accent); } }
.crit-input { gap: 10px; padding-top: 6px; padding-bottom: 6px; }
.crit-input .input { height: 32px; }
.crit-idx { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--fill); color: var(--label-2); font-size: 12px; font-weight: 600; display: grid; place-items: center; letter-spacing: 0; }
.remove { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; }
.remove svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.add-crit { color: var(--tint); gap: 10px; }
.add-crit svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--green); stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; }
.lock-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 24px; padding: 14px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--orange) 12%, var(--card)); font-size: 14px; line-height: 1.4; letter-spacing: -0.15px; }
.lock-note svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--orange); stroke-width: 2; margin-top: 1px; }

/* ---------- Detalhe / Dashboard ---------- */
.person-head { display: flex; align-items: center; gap: 10px; margin: -6px 4px 16px; }
.primary-action { margin-bottom: 16px; }
.hero { display: flex; align-items: center; gap: 20px; }
.hero-info { flex: 1; min-width: 0; display: grid; gap: 8px; justify-items: start; }
.hero-meta { font-size: 15px; color: var(--label-2); }
.hero-meta strong { color: var(--label); }
.progress-label { display: flex; justify-content: space-between; width: 100%; font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; margin-top: 4px; }
.meter { width: 100%; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 3px; background: var(--green); transition: width 0.6s var(--ease); }
.meter > span.low { background: var(--orange); }
.meter > span.tint { background: var(--accent); }

.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--fill); stroke-width: 12; }
.ring-val { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 0.9s var(--ease); }
.ring-target { stroke: var(--label); stroke-width: 2.5; stroke-linecap: round; opacity: 0.55; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.4px; }
.ring-label span { font-size: 12px; color: var(--label-2); margin-top: 3px; }

.goal { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; }
.goal-icon { font-size: 24px; line-height: 1; }
.goal-label { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--label-2); letter-spacing: 0.2px; }
.goal-text { font-size: 16px; margin-top: 2px; }

.dash-grid { display: grid; gap: 0; }
.chart svg { width: 100%; height: 110px; }
.bar-good { fill: var(--green); }
.bar-low { fill: var(--orange); }
.bar-empty { fill: var(--fill); }
.target-line { stroke: var(--label-2); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--label-2); margin-top: 8px; }
.chart-legend { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .dash { display: inline-block; width: 14px; border-top: 1.5px dashed var(--label-2); }

.crit-row { display: grid; gap: 7px; }
.crit-top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.crit-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crit-val { font-weight: 600; font-variant-numeric: tabular-nums; }

.day-row { gap: 12px; }
.day-num { width: 56px; flex: none; font-weight: 600; font-size: 15px; }
.day-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.day-note { font-size: 14px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-avg { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--label-2); font-size: 15px; }

.finished-banner { display: grid; gap: 2px; text-align: center; padding: 16px; border-radius: 14px; font-weight: 700; font-size: 19px; }
.finished-banner span { font-size: 14px; font-weight: 500; opacity: 0.85; }
.finished-banner.achieved { background: color-mix(in srgb, var(--green) 16%, var(--card)); color: var(--green); }
.finished-banner.missed { background: color-mix(in srgb, var(--red) 12%, var(--card)); color: var(--red); }

/* ---------- Avaliar o dia ---------- */
.day-head { text-align: center; padding: 8px 0 6px; display: grid; justify-items: center; gap: 4px; }
.day-head h1 { font-size: 28px; margin: 8px 0 0; letter-spacing: 0.36px; }
.day-head h1 .muted { font-weight: 500; }
.day-head p { margin: 0 0 12px; }
.rate-list { margin-top: 12px; }
.rate-row { display: grid; gap: 8px; padding-top: 14px; padding-bottom: 12px; }
.rate-name { font-size: 16px; font-weight: 500; }
.rate-stars { display: flex; gap: 2px; margin-left: -6px; }
.rate-stars button { width: 48px; height: 44px; display: grid; place-items: center; color: var(--fill); transition: color 0.15s; }
.rate-stars button .star { width: 32px; height: 32px; }
.rate-stars button.on { color: var(--star); }
.rate-stars button.pop .star { animation: pop 0.32s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.day-summary { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; margin-bottom: 10px !important; min-height: 20px; font-variant-numeric: tabular-nums; }

/* ---------- Link público ---------- */
.share-head { text-align: center; display: grid; justify-items: center; padding-top: 8px; }
.share-head .large-title { margin: 12px 0 2px; }
.share-head p { margin: 0 0 18px; }
.share-hint { text-align: center; font-size: 15px; color: var(--label-2); margin: 0 12px 16px; }
.share-hint strong { color: var(--label); }
.share-head + .finished-banner { margin-bottom: 16px; }
.readonly-tag { font-size: 12px; color: var(--label-2); background: var(--fill-2); padding: 4px 9px; border-radius: 10px; margin-right: 8px; white-space: nowrap; }

/* ---------- Folha inferior ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0); transition: background 0.28s; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop.open { background: rgba(0, 0, 0, 0.35); }
.sheet {
  width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto;
  background: var(--bg); border-radius: 14px 14px 0 0;
  padding: 8px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  transform: translateY(100%); transition: transform 0.32s var(--ease);
}
.sheet-backdrop.open .sheet { transform: none; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--label-3); margin: 0 auto 14px; }
.sheet-title { font-size: 22px; font-weight: 700; margin: 0 4px 6px; }
.sheet-sub { display: flex; align-items: center; gap: 8px; margin: 0 4px 16px; }
.sheet .muted.small { margin: 0 4px 14px; }
.sheet-actions { display: grid; gap: 10px; margin-top: 14px; }
.note-card { white-space: pre-wrap; font-size: 16px; }
.link-field { font-size: 14px; color: var(--label-2); }

/* ---------- Alerta ---------- */
.alert-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0, 0, 0, 0); transition: background 0.2s; padding: 24px; }
.alert-backdrop.open { background: rgba(0, 0, 0, 0.35); }
.alert {
  width: 270px; border-radius: 14px; overflow: hidden; text-align: center;
  background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  transform: scale(1.12); opacity: 0; transition: transform 0.2s var(--ease), opacity 0.2s;
}
.alert-backdrop.open .alert { transform: none; opacity: 1; }
.alert-text { padding: 19px 16px 18px; }
.alert-text strong { display: block; font-size: 17px; }
.alert-text p { margin: 4px 0 0; font-size: 13px; line-height: 1.35; letter-spacing: -0.08px; }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 0.5px solid var(--sep); }
.alert-actions button { height: 44px; color: var(--tint); }
.alert-actions button + button { border-left: 0.5px solid var(--sep); }
.alert-actions button.bold { font-weight: 600; }
.alert-actions button.destructive { color: var(--red); font-weight: 600; }
.alert-actions button:active { background: var(--fill-2); }

/* ---------- Toast e carregamento ---------- */
.toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); z-index: 70;
  transform: translate(-50%, -140%); transition: transform 0.38s var(--ease);
  background: var(--card); color: var(--label); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  padding: 12px 20px; border-radius: 24px; font-size: 15px; font-weight: 600; white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); }
.center-fill { min-height: 100dvh; display: grid; place-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--fill); border-top-color: var(--label-2); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Foto ---------- */
.avatar-img { object-fit: cover; background: var(--fill); }
.photo-pick { display: grid; justify-items: center; gap: 4px; margin: 12px 0 0; }
.photo-btn { cursor: pointer; }
.photo-preview { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--label-2); overflow: hidden; }
.photo-preview svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick .link-btn { margin: 0; }
.avatar-edit { position: relative; flex: none; border-radius: 50%; }
.avatar-badge { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.18); display: grid; place-items: center; color: var(--tint); }
.avatar-badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.photo-big { display: grid; place-items: center; margin: 8px 0 18px; }
.sheet-actions .btn svg, .share-cta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }
.sheet-actions label.btn { cursor: pointer; }
.btn-gray.destructive { color: var(--red); }
.btn-whatsapp { background: #25d366; color: #fff; }
.share-cta { margin-bottom: 16px; }

/* ---------- Ajustes ---------- */
.setting-icon { flex: none; width: 30px; height: 30px; border-radius: 7px; background: var(--c); color: #fff; display: grid; place-items: center; }
.setting-icon svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); cursor: pointer; transition: background 0.25s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform 0.25s var(--ease); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: 0.5; cursor: default; }

/* ---------- Assistente de IA ---------- */
.fab {
  position: fixed; z-index: 16; right: max(16px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 7px; height: 48px; padding: 0 18px 0 14px; border-radius: 24px;
  background: linear-gradient(135deg, #bf5af2, #5e5ce6); color: #fff; font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 24px rgba(94, 92, 230, 0.35); transition: transform 0.15s var(--ease);
}
.fab:active { transform: scale(0.94); }
.fab svg { width: 20px; height: 20px; fill: currentColor; }
.fab.above-footer { bottom: calc(92px + env(safe-area-inset-bottom)); }
.sheet.sheet-tall { height: 88dvh; display: flex; flex-direction: column; padding-bottom: 0; }
.sheet.sheet-tall .sheet-body { flex: 1; min-height: 0; display: flex; }
.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 0 4px 12px; border-bottom: 0.5px solid var(--sep); }
.chat-head .link-btn { margin: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px 2px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.chat-empty { margin: auto; text-align: center; color: var(--label-2); max-width: 290px; font-size: 15px; }
.chat-empty svg { width: 40px; height: 40px; margin: 0 auto 10px; fill: #bf5af2; }
.bubble { max-width: 84%; padding: 9px 14px; border-radius: 19px; font-size: 16px; line-height: 1.38; word-wrap: break-word; }
.bubble.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.bubble.assistant { align-self: flex-start; background: var(--card); border-bottom-left-radius: 6px; }
.bubble p { margin: 0; }
.bubble p + p, .bubble ul + p, .bubble p + ul { margin-top: 6px; }
.bubble ul { margin: 0; padding-left: 20px; }
.bubble li + li { margin-top: 3px; }
.typing { display: flex; gap: 4px; padding: 14px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--label-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 2px 10px; }
.chat-chips[hidden] { display: none; }
.chat-chips .chip { background: var(--card); color: var(--tint); height: 34px; }
.chat-input { display: flex; align-items: flex-end; gap: 8px; padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); border-top: 0.5px solid var(--sep); }
.chat-input textarea { flex: 1; resize: none; border: 0.5px solid var(--sep); background: var(--card); border-radius: 19px; padding: 8px 14px; min-height: 38px; max-height: 120px; outline: none; font-size: 16px; line-height: 1.3; }
.chat-input .send { flex: none; width: 34px; height: 34px; margin-bottom: 2px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.chat-input .send:disabled { background: var(--fill); color: var(--label-3); }
.chat-input .send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- SaaS: conta, assinatura, tarefas, painel ---------- */
.block { display: block; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 15px; word-break: break-all; text-align: right; }
.mono.big { font-size: 20px; letter-spacing: 1px; color: var(--label); }
.c-orange { color: var(--orange); }
.c-red { color: var(--red); }
.auth .group { text-align: left; }
.auth-switch { margin: 22px 0 0 !important; color: var(--label-2); font-size: 15px; }
.auth-foot { margin: 28px 0 0 !important; font-size: 13px; color: var(--label-2); }
.auth .link-btn { margin-top: 10px; }
.invite-email { gap: 12px; }
.invite-email .grow { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--tint) 11%, var(--card)); color: var(--label); font-size: 15px; }
.banner.warn { background: color-mix(in srgb, var(--orange) 14%, var(--card)); }
.banner-icon { font-size: 20px; line-height: 1; }
.banner-cta { flex: none; font-weight: 600; color: var(--tint); }
.banner:active { opacity: 0.7; }

.plan-status { display: grid; gap: 3px; margin-bottom: 8px; border-left: 4px solid var(--green); }
.plan-status.off { border-left-color: var(--orange); }
.plan-status span { color: var(--label-2); font-size: 15px; }
.plans { display: grid; gap: 12px; }
.plan-card { text-align: left; display: grid; gap: 6px; padding: 16px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); border: 2px solid transparent; transition: border-color 0.15s, transform 0.15s; }
.plan-card:active { transform: scale(0.985); }
.plan-card.selected { border-color: var(--tint); }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 17px; }
.plan-price { font-size: 28px; font-weight: 700; letter-spacing: 0.3px; font-variant-numeric: tabular-nums; }
.plan-price span { font-size: 15px; font-weight: 500; color: var(--label-2); }
.plan-card ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 5px; font-size: 15px; color: var(--label-2); }
.plan-card li { display: flex; gap: 7px; align-items: center; }
.plan-card li svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.segmented { display: flex; padding: 2px; border-radius: 9px; background: var(--fill); gap: 2px; }
.segmented button { flex: 1; min-height: 32px; padding: 0 10px; border-radius: 7px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background 0.15s; }
.segmented button.on { background: var(--card); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); font-weight: 600; }
.segmented.scroll { overflow-x: auto; scrollbar-width: none; }
.segmented.scroll::-webkit-scrollbar { display: none; }
@media (prefers-color-scheme: dark) { .segmented button.on { background: #636366; } }

.pix .row { min-height: 50px; }
.pix-key { font-weight: 600; word-break: break-all; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 17px; flex: none; display: inline-flex; gap: 5px; align-items: center; }
.btn-sm svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-green { background: var(--green); color: #fff; }
.btn svg { flex: none; }
.btn > svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.steps { margin: 14px 0 16px; padding-left: 22px; color: var(--label-2); font-size: 15px; display: grid; gap: 4px; }

.account-card .row { gap: 14px; padding-top: 12px; padding-bottom: 12px; }
.account-card strong { font-size: 18px; }
.row-value { color: var(--label-2); font-size: 15px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.row-value.tint { color: var(--tint); }
.row-value svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.setting-icon.stroke svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.field-row { gap: 12px; }
.field-row label { flex: none; width: 92px; color: var(--label); }
.field-row.wide label { width: 150px; }
.field-row .input { flex: 1; min-width: 0; text-align: left; }
.sheet-form .segmented { margin-top: 2px; }
.gap-top { margin-top: 16px; }
.select { font: inherit; color: var(--tint); background: transparent; border: 0; text-align: right; max-width: 60%; appearance: none; -webkit-appearance: none; cursor: pointer; }
.date-input { width: auto; flex: none; text-align: right; color: var(--tint); }
.date-input::-webkit-calendar-picker-indicator { opacity: 0.6; }

/* Tarefas */
.section-h-row { display: flex; justify-content: space-between; align-items: center; }
.section-h-row .link-btn { margin: 0; text-transform: none; font-size: 13px; }
.task-row { gap: 12px; }
.task-row.done .task-text { color: var(--label-2); text-decoration: line-through; text-decoration-color: var(--label-3); }
.check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--label-3); display: grid; place-items: center; color: transparent; transition: background 0.15s, border-color 0.15s; }
.check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.task-check .task-row { min-height: 52px; }
.task-check .check { width: 28px; height: 28px; }
.task-check .check.on { animation: pop 0.3s var(--ease); }
.task-add { gap: 12px; padding-top: 6px; padding-bottom: 6px; }
.task-add .input { height: 34px; }
.add-dot { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.add-dot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.task-status { display: inline-flex; align-items: center; gap: 5px; }
.task-status.ok { color: var(--green); font-weight: 600; }
.task-status svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; }
.btn-sm-gap { margin-top: 12px; }
#tasks-sec { margin-bottom: 8px; }
#tasks .btn { margin-top: 14px; }
.task-done-card { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 14px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--green) 14%, var(--card)); color: var(--green); }
.task-done-card > svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.task-done-card strong { display: block; font-size: 17px; }
.task-done-card span { color: var(--label-2); font-size: 14px; }
.upsell { display: flex; align-items: center; gap: 12px; color: var(--label); }
.upsell:active { opacity: 0.7; }

.task-new { display: block; }
.section-f.block { display: block; }
.task-new .task-add { gap: 10px; padding-top: 8px; padding-bottom: 8px; }
.task-add .input { height: 36px; }
.add-btn { gap: 4px; padding: 0 12px 0 9px; }
.add-btn svg { width: 16px; height: 16px; stroke-width: 2.6; }
.add-btn:disabled { background: var(--fill); color: var(--label-3); }
.repeat-row { display: flex; align-items: center; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.repeat-row::-webkit-scrollbar { display: none; }
.repeat-row .chip { flex: none; height: 28px; font-size: 13px; }
.repeat-label { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--label-2); margin-right: 2px; }
.repeat-label svg, .task-rep svg, .rules-link svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.repeat-custom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px 10px; font-size: 15px; }
.repeat-hint { margin: 0; padding: 0 16px 12px; font-size: 13px; color: var(--tint); }
.task-rep { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--tint); margin-top: 2px; }
.task-row.done .task-rep { opacity: 0.6; }
.rules-link { display: inline-flex; align-items: center; gap: 5px; margin: 10px 16px 0; }

/* Painel admin */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.stat-wide { grid-column: 1 / -1; }
.stat-label { font-size: 13px; color: var(--label-2); font-weight: 500; }
.stat strong { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.2px; }
.stat-wide strong { font-size: 30px; }
.stat-sub { font-size: 13px; color: var(--label-2); }
.search { margin: 10px 0; }
.search .input { background: var(--fill); border-radius: 10px; height: 36px; padding: 0 12px; }
.user-row { gap: 12px; }
.user-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sub { display: block; font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-row { justify-content: center; color: var(--label-2); }
.user-head { text-align: center; display: grid; justify-items: center; gap: 2px; padding: 8px 0 18px; }
.user-head h1 { font-size: 24px; margin: 10px 0 0; }
.user-head p { margin: 0 0 8px; }
.access-card { display: grid; justify-items: center; gap: 2px; margin-bottom: 12px; text-align: center; }
.access-card strong { font-size: 26px; color: var(--green); }
.access-card.off strong { color: var(--red); }
.pay-row { padding-top: 10px; padding-bottom: 10px; }
@media (min-width: 900px) {
  .plans { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-wide { grid-column: span 2; }
}

/* ---------- Telas maiores (tablet / desktop) ---------- */
@media (min-width: 900px) {
  .content { max-width: 960px; padding-left: 32px; padding-right: 32px; }
  .large-title { margin-top: 12px; }
  .dash-grid { grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  .hero { padding: 24px; }
  .primary-action { display: flex; align-items: center; gap: 20px; }
  .primary-action .btn-block { width: auto; min-width: 260px; }
  .primary-action .link-btn { margin: 0; }
  .primary-action .finished-banner { flex: 1; }
  .footer-bar { left: 50%; right: auto; transform: translateX(-50%); width: 420px; bottom: 20px; border-radius: 20px; border: 0.5px solid var(--sep); padding: 12px; }
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 14px; max-height: 80dvh; transform: translateY(20px) scale(0.98); opacity: 0; transition: transform 0.3s var(--ease), opacity 0.3s; }
  .sheet-backdrop.open .sheet { transform: none; opacity: 1; }
  .grabber { display: none; }
  .sheet { padding-top: 22px; }
  .rate-row { grid-template-columns: 1fr auto; align-items: center; }
  .fab.above-footer { bottom: 24px; right: 32px; }
  .share-cta { width: auto; padding: 0 22px; }
}
@media (hover: hover) {
  .row-btn:hover { background: var(--fill-2); }
  .btn:hover:not(:disabled) { filter: brightness(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
