/* ==========================================================================
   COMPONENTES
   ========================================================================== */

/* ---------- Botões ---------- */
.btn {
  --btn-bg: var(--primary); --btn-fg: var(--text-on-primary); --btn-sh: var(--brand-marrom-terra);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 52px; padding: 0 var(--sp-6);
  border-radius: var(--r-md);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-sub); font-weight: 700; font-size: var(--fs-md); letter-spacing: .01em;
  box-shadow: 0 4px 0 0 var(--btn-sh);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-fast), opacity var(--t-fast);
  user-select: none; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { background: color-mix(in srgb, var(--btn-bg) 92%, white); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 0 var(--btn-sh); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; box-shadow: none; }
.btn--block { width: 100%; }
.btn--secondary { --btn-bg: var(--secondary); --btn-fg: #fff; --btn-sh: var(--brand-folha-escuro); }
:root[data-theme="dark"] .btn--secondary { --btn-fg: #1A2213; --btn-sh: #56672D; }
.btn--ghost { --btn-bg: var(--surface); --btn-fg: var(--text); --btn-sh: var(--border-strong); border: 2px solid var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--text { --btn-bg: transparent; --btn-fg: var(--link); box-shadow: none; min-height: 44px; padding: 0 var(--sp-3); }
.btn--text:hover { background: var(--surface-2); }
.btn--text:active { transform: none; }
.btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-sh: #7d2a21; }
.btn--sm { min-height: 40px; padding: 0 var(--sp-4); font-size: var(--fs-sm); border-radius: var(--r-sm); box-shadow: 0 3px 0 0 var(--btn-sh); }
.btn--lg { min-height: 58px; font-size: var(--fs-lg); }
.btn .ico { width: 20px; height: 20px; }
.btn.is-loading { pointer-events: none; color: transparent; position: relative; }
.btn.is-loading::after { content: ""; position: absolute; width: 22px; height: 22px; border: 3px solid var(--btn-fg); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 44px; height: 44px; border-radius: var(--r-pill);
  display: inline-grid; place-items: center; color: var(--text);
  transition: background-color var(--t-fast), transform var(--t-fast);
  flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn--filled { background: var(--surface); box-shadow: var(--sh-1); border: 1px solid var(--border); }
.icon-btn--glass { background: rgba(22,26,18,.46); color: #fff; border: 1px solid rgba(255,255,255,.3); box-shadow: 0 2px 12px rgba(0,0,0,.28); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.icon-btn--glass:hover { background: rgba(22,26,18,.62); }
.icon-btn--glass .ico { filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
/* Fechar / sair / voltar sempre visíveis, sobre qualquer fundo (foto, cor ou modo noturno) */
.icon-btn[data-close], .icon-btn[data-quit],
.icon-btn[data-exit]:not(.icon-btn--glass),
.topbar--transparent .icon-btn:not(.icon-btn--glass) {
  background: color-mix(in srgb, var(--surface) 86%, transparent); color: var(--text);
  border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(36,48,27,.14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.icon-btn[data-close]:hover, .icon-btn[data-quit]:hover, .icon-btn[data-exit]:not(.icon-btn--glass):hover { background: var(--surface-2); }

.social-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  width: 100%; min-height: 52px; border-radius: var(--r-md);
  background: var(--surface); border: 2px solid var(--border-strong);
  font-family: var(--font-sub); font-weight: 600; font-size: var(--fs-sm);
  box-shadow: 0 3px 0 0 var(--border-strong);
}
.social-btn:active { transform: translateY(3px); box-shadow: none; }
.social-btn svg { width: 20px; height: 20px; }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-family: var(--font-sub); font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
.field__control { position: relative; display: flex; align-items: center; }
.field__control > .ico { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.input {
  width: 100%; min-height: 52px; padding: 0 var(--sp-4);
  border-radius: var(--r-md); border: 2px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field__control > .ico ~ .input { padding-left: 46px; }
.input::placeholder { color: color-mix(in srgb, var(--text-muted) 80%, transparent); }
.input:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--secondary) 18%, transparent); }
.field.has-error .input { border-color: var(--danger); }
.field__error { font-size: var(--fs-xs); color: var(--danger); min-height: 0; display: flex; gap: 4px; align-items: center; }
.field__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field__toggle { position: absolute; right: 4px; }
.checkbox { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.checkbox input { -webkit-appearance: none; appearance: none; flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; margin-top: 1px; transition: background var(--t-fast), border-color var(--t-fast); }
.checkbox input:checked { background: var(--secondary); border-color: var(--secondary); }
.checkbox input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength span { height: 4px; border-radius: 4px; background: var(--border); transition: background var(--t-med); }
.strength[data-score="1"] span:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] span:nth-child(-n+2) { background: var(--warning); }
.strength[data-score="3"] span:nth-child(-n+3) { background: var(--brand-dourado-suave); }
.strength[data-score="4"] span { background: var(--success); }
.divider { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-muted); font-size: var(--fs-xs); font-family: var(--font-sub); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Switch */
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; }
.switch input { -webkit-appearance: none; -moz-appearance: none; appearance: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 99px; background: var(--border-strong); cursor: pointer; transition: background var(--t-fast); }
.switch input:checked { background: var(--secondary); }
/* a bolinha e um elemento de verdade: o Safari nao desenha ::after em input */
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); pointer-events: none; transition: transform var(--t-med) var(--ease-spring); }
.switch input:checked + i { transform: translateX(22px); }
.switch input:disabled { opacity: .55; cursor: default; }

/* Segmented */
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--border); }
.segmented button { flex: 1; min-height: 40px; border-radius: var(--r-sm); font-family: var(--font-sub); font-weight: 600; font-size: var(--fs-sm); color: var(--text-muted); transition: background var(--t-fast), color var(--t-fast); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--border); box-shadow: var(--sh-1); padding: var(--sp-5); }
.card--flat { box-shadow: none; }
.card--tint { background: var(--surface-2); border-color: transparent; }
.card--link { display: block; color: inherit; text-decoration: none !important; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast); }
.card--link:hover { box-shadow: var(--sh-2); }
.card--link:active { transform: scale(.985); }

.media-card { position: relative; display: block; overflow: hidden; border-radius: var(--r-lg); color: #fff; text-decoration: none !important; background: var(--surface-3); isolation: isolate; box-shadow: var(--sh-2); transition: transform var(--t-fast) var(--ease); }
.media-card:active { transform: scale(.985); }
.media-card .vimg { position: absolute; inset: 0; border-radius: 0; }
.media-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(20, 25, 14, .82)); z-index: 1; pointer-events: none; }
.media-card__body { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--sp-4); z-index: 2; }
.media-card__title { font-family: var(--font-title); font-weight: 600; font-size: var(--fs-lg); line-height: 1.2; color: #fff; }
.media-card__meta { font-size: var(--fs-xs); opacity: .9; margin-top: 4px; display: flex; gap: 8px; align-items: center; font-family: var(--font-sub); font-weight: 600; }
.media-card .chip { position: absolute; top: 12px; left: 12px; z-index: 2; }

/* List item */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); min-height: 60px; color: var(--text); text-decoration: none !important; text-align: left; width: 100%; }
.list-item + .list-item { border-top: 1px solid var(--border); }
button.list-item:hover, a.list-item:hover { background: var(--surface-2); }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-weight: 600; font-size: var(--fs-md); }
.list-item__sub { font-size: var(--fs-sm); color: var(--text-muted); }
.list-item__icon { width: 42px; height: 42px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex: none; }

/* ---------- Chips / pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r-pill); font-family: var(--font-sub); font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip--glass { background: rgba(255, 255, 255, .9); color: #24301B; }
.chip--primary { background: var(--primary-soft); color: var(--link); }
.chip--secondary { background: var(--secondary-soft); color: var(--secondary); }
:root:not([data-theme="dark"]) .chip--secondary { color: var(--brand-folha-escuro); }
.chip--lock { background: var(--surface-3); color: var(--text-muted); }
.chip .ico { width: 14px; height: 14px; }
.chips { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; padding: 2px var(--sp-5); margin: 0 calc(var(--sp-5) * -1); }
.chips::-webkit-scrollbar { display: none; }
.filter-chip { flex: none; height: 38px; padding: 0 16px; border-radius: var(--r-pill); border: 2px solid var(--border); background: var(--surface); font-family: var(--font-sub); font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
.filter-chip[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--bg); }

.stat-pill { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px 0 8px; border-radius: var(--r-pill); font-family: var(--font-sub); font-weight: 800; font-size: var(--fs-sm); background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.stat-pill .ico, .stat-pill svg { width: 22px; height: 22px; }
.stat-pill--sun { color: var(--brand-marrom-terra); }
:root[data-theme="dark"] .stat-pill--sun { color: var(--primary); }
.stat-pill--seed { color: var(--secondary); }
.stat-pill--muted { color: var(--text-muted); }

/* ---------- Progresso ---------- */
.progress { height: 12px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; position: relative; }
.progress__bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--brand-dourado-suave)); width: 0; transition: width var(--t-slow) var(--ease); position: relative; }
.progress__bar::after { content: ""; position: absolute; top: 3px; left: 8px; right: 8px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.45); }
.progress--green .progress__bar { background: linear-gradient(90deg, var(--secondary), #93AA5C); }
.progress--sm { height: 8px; }
.progress--sm .progress__bar::after { display: none; }

.ring { --size: 64px; --stroke: 7px; --val: 0; --color: var(--primary); width: var(--size); height: var(--size); position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: var(--stroke); }
.ring .ring__track { stroke: var(--surface-3); }
.ring .ring__val { stroke: var(--color); stroke-linecap: round; transition: stroke-dashoffset var(--t-slow) var(--ease); }
.ring__label { position: relative; font-family: var(--font-sub); font-weight: 800; font-size: var(--fs-sm); text-align: center; line-height: 1.1; }

/* ---------- Avatar ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-sub); font-weight: 800; color: #24301B; background: linear-gradient(135deg, var(--brand-laranja-solar), var(--brand-dourado-suave)); flex: none; overflow: hidden; text-transform: uppercase; }
.avatar--lg { width: 96px; height: 96px; font-size: var(--fs-2xl); border: 4px solid var(--surface); box-shadow: var(--sh-2); }

/* ---------- Badge (conquista) ---------- */
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.badge__medal { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; position: relative; background: var(--surface-3); color: var(--text-muted); transform: rotate(-4deg); transition: transform var(--t-med) var(--ease-spring); }
.badge__medal svg { width: 34px; height: 34px; }
.badge.is-earned .badge__medal { background: linear-gradient(145deg, var(--b1, var(--brand-laranja-solar)), var(--b2, var(--brand-dourado-suave))); color: #fff; box-shadow: 0 6px 0 0 color-mix(in srgb, var(--b1, var(--brand-marrom-terra)) 70%, black), var(--sh-2); }
.badge.is-earned:hover .badge__medal { transform: rotate(0) scale(1.06); }
.badge__name { font-family: var(--font-sub); font-weight: 700; font-size: 12px; line-height: 1.2; }
.badge:not(.is-earned) .badge__name { color: var(--text-muted); }
.badge__lock { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; }
.badge__lock svg { width: 13px; height: 13px; }

/* ---------- Imagem com placeholder de prompt ---------- */
.vimg { position: relative; overflow: hidden; background: var(--surface-3); border-radius: var(--r-lg); }
.vimg > img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--t-slow) var(--ease); }
.vimg.is-loaded > img { opacity: 1; }
.vimg__ph { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; color: #24301B;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(242,153,64,.55), transparent 60%),
    radial-gradient(100% 80% at 0% 100%, rgba(100,118,54,.45), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 10px, transparent 10px 20px),
    #F4E3C8; }
:root[data-theme="dark"] .vimg__ph { color: #F6ECDD; background:
    radial-gradient(120% 80% at 80% 0%, rgba(242,153,64,.35), transparent 60%),
    radial-gradient(100% 80% at 0% 100%, rgba(100,118,54,.45), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 10px, transparent 10px 20px),
    #2B3522; }
.vimg.is-missing .vimg__ph { display: flex; }
.vimg__num { font-family: var(--font-sub); font-weight: 800; font-size: 12px; letter-spacing: .12em; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.75); color: #24301B; }
.vimg__label { font-family: var(--font-sub); font-size: 11px; font-weight: 600; opacity: .8; max-width: 90%; line-height: 1.25; }
.vimg__copy { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; background: #24301B; color: #FBF0E1; font-family: var(--font-sub); font-weight: 700; font-size: 11px; position: relative; z-index: 3; }
.vimg__copy svg { width: 14px; height: 14px; }
.vimg__sun { width: 34px; height: 34px; opacity: .55; }
.vimg--sm .vimg__label, .vimg--sm .vimg__sun { display: none; }
.vimg--sm .vimg__ph { gap: 4px; padding: 4px; }
.vimg--sm .vimg__copy { height: 24px; padding: 0 8px; font-size: 10px; }
.media-card .vimg__ph { padding-bottom: 70px; }
html.hide-prompts .vimg__copy, html.hide-prompts .vimg__label { display: none; }

/* ---------- Overlays: sheet / modal / toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 90; background: var(--overlay); opacity: 0; transition: opacity var(--t-med) var(--ease); display: flex; align-items: flex-end; justify-content: center; }
.overlay.is-open { opacity: 1; }
.overlay--center { align-items: center; padding: var(--sp-5); }
.sheet { width: 100%; max-width: var(--app-max); max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: var(--sp-3) var(--sp-5) calc(var(--sp-6) + var(--safe-b)); transform: translateY(100%); transition: transform var(--t-med) var(--ease); overscroll-behavior: contain; }
.overlay.is-open .sheet { transform: none; }
.sheet__grip { width: 44px; height: 5px; border-radius: 5px; background: var(--border-strong); margin: 0 auto var(--sp-4); }
.sheet__head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.sheet__head .t-h2 { flex: 1; }
.dialog { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--r-xl); padding: var(--sp-6); transform: scale(.92); opacity: 0; transition: transform var(--t-med) var(--ease-spring), opacity var(--t-med); box-shadow: var(--sh-3); max-height: 90dvh; overflow: auto; }
.overlay.is-open .dialog { transform: none; opacity: 1; }

.toast-wrap { position: fixed; z-index: 120; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 12px); width: calc(100% - 32px); max-width: 440px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); background: var(--text); color: var(--bg); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--sh-3); animation: toast-in var(--t-med) var(--ease-spring); pointer-events: auto; }
.toast--success .ico { color: #A5D46A; }
.toast--error { background: var(--danger); color: #fff; }
.toast.is-leaving { animation: toast-out var(--t-med) var(--ease) forwards; }
@keyframes toast-in { from { transform: translateY(-16px) scale(.96); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-16px); opacity: 0; } }

/* ---------- Estados ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-3); padding: var(--sp-10) var(--sp-5); color: var(--text-muted); }
.empty .ico { width: 44px; height: 44px; color: var(--border-strong); }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: var(--r-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.notice { display: flex; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); color: var(--text-2); }
.notice .ico { color: var(--link); margin-top: 2px; }
.notice--info { background: var(--secondary-soft); }

/* ---------- Celebração ---------- */
.confetti-canvas { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.celebrate { text-align: center; }
.celebrate__icon { width: 120px; height: 120px; margin: 0 auto var(--sp-4); display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, var(--primary-soft), transparent 70%); animation: pop .6s var(--ease-spring); }
.celebrate__icon svg { width: 84px; height: 84px; }
.celebrate__xp { display: flex; justify-content: center; gap: var(--sp-3); margin: var(--sp-5) 0; }
.reward-box { flex: 1; max-width: 140px; border-radius: var(--r-md); border: 2px solid var(--rb, var(--primary)); overflow: hidden; }
.reward-box__head { background: var(--rb, var(--primary)); color: var(--rbf, #24301B); font-family: var(--font-sub); font-weight: 800; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 4px; }
.reward-box__val { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 4px; font-family: var(--font-sub); font-weight: 800; font-size: var(--fs-xl); color: var(--text); }
.reward-box__val svg { width: 22px; height: 22px; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc, var(--primary)) 55%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
.sheet:focus, .dialog:focus { outline: none; }

/* ---------- Ícones ilustrados 3D (gi) ----------
   PNG em assets/img/icons/{key}.png; enquanto não existir, mostra o vetor de fallback. */
.gi { position: relative; display: inline-block; width: var(--gs, 100%); aspect-ratio: 1; flex: none; vertical-align: middle; line-height: 0; }
.gi > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity var(--t-med) var(--ease), filter var(--t-med), transform var(--t-med) var(--ease-spring); }
.gi.is-loaded > img { opacity: 1; }
.gi__fb { position: absolute; inset: 0; display: grid; place-items: center; }
.gi__fb > svg:not(.ico) { width: 100%; height: 100%; }
.gi.is-loaded > .gi__fb { display: none; }
.gi--inline { vertical-align: -4px; }
/* tamanhos por contexto */
.stat-pill .gi { --gs: 24px; }
.streak-line .gi { --gs: 20px; }
.week-dot i .gi { --gs: 24px; }
.week-dot:not(.is-on) .gi.is-loaded img { filter: grayscale(1) opacity(.35); }
.stat-pill.is-dim .gi.is-loaded img { filter: grayscale(1) opacity(.5); }
.reward-box__val .gi { --gs: 26px; }
.celebrate__icon .gi, .celebrate__icon .lvl { width: 108px; height: 108px; }
.celebrate-streak .gi { --gs: 44px; }
.stat .gi { --gs: 32px; }
.streak-hero__sun .gi { --gs: 88px; }
.streak-hero__sun:not(.is-on) .gi.is-loaded img { filter: grayscale(1) opacity(.45); }
.shop-item__icon .gi { --gs: 56px; }
.onb__sun .gi { --gs: 140px; }
.intention__sun .gi { --gs: 120px; }
.choice .gi { --gs: 48px; margin: -4px 0 -2px -4px; }
.choice .gi .ico { width: 26px; height: 26px; }
/* pilares: ícone grande sobre o bloco colorido */
.pillar-tile__icon:has(.gi.is-loaded) { width: 76px; height: 76px; top: 4px; right: 4px; opacity: 1; }
.pillar-tile__icon .gi .ico { width: 56px; height: 56px; }
.extra-card__icon:has(.gi.is-loaded), .next-card__icon:has(.gi.is-loaded) { background: none; }
.extra-card__icon .gi .ico, .next-card__icon .gi .ico { width: 30px; height: 30px; }
.jpath__deco:has(.gi.is-loaded) { opacity: .9; }
/* conquistas */
.badge__medal .gi { position: absolute; inset: 0; }
.badge__medal .gi .ico { width: 34px; height: 34px; }
.badge__medal .gi__fb > svg:not(.ico) { width: 40px; height: 40px; }
.badge__medal:has(.gi.is-loaded) { background: none !important; box-shadow: none !important; transform: none; }
.badge__medal:has(.gi.is-loaded) .gi { inset: -8px; }
.badge:not(.is-earned) .gi.is-loaded img { filter: grayscale(1) opacity(.4); }
.badge.is-earned:hover .gi.is-loaded img { transform: rotate(-4deg) scale(1.06); }
.badge-big .badge__medal:has(.gi.is-loaded) .gi { inset: -14px; }
.celebrate-badge .gi .ico { width: 34px; height: 34px; color: var(--secondary); }
/* níveis */
.lvl { position: relative; display: block; width: 100%; height: 100%; }
.lvl > .gi { width: 100%; }
.lvl__n { display: none; position: absolute; right: -2px; bottom: -2px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px; place-items: center; background: var(--brand-verde-profundo); color: #FBF0E1; font-family: var(--font-sub); font-weight: 800; font-size: 13px; border: 2px solid var(--surface); }
.lvl:has(.gi.is-loaded) .lvl__n { display: grid; }
/* hábitos */
.habit__icon .gi, .habit-dot .gi, .list-item__icon .gi { width: 100%; }
.feedback-score { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; border: 0; padding: 0; margin: 0; }
.feedback-score label { position: relative; cursor: pointer; }
.feedback-score input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.feedback-score span { display: grid; place-items: center; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 12px; font-weight: 750; background: var(--surface); color: var(--text); }
.feedback-score input:checked + span { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.feedback-score input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.feedback-scale { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--text-muted); }
.habit__icon .gi .ico, .habit-dot .gi .ico, .list-item__icon .gi .ico { width: 22px; height: 22px; }
.habit__icon:has(.gi.is-loaded) { background: none; width: 56px; height: 56px; margin: -6px 0 2px -6px; }
.habit:not(.is-on) .habit__icon .gi.is-loaded img { filter: saturate(.25) opacity(.7); }
.habit.is-on .habit__icon:has(.gi.is-loaded) { transform: rotate(-6deg) scale(1.08); }
.habit-dot:has(.gi.is-loaded) { padding: 4px; }
.habit-dot:not(.is-on) .gi.is-loaded img { filter: saturate(.2) opacity(.6); }
.habit-dot.is-on:has(.gi.is-loaded) { background: color-mix(in srgb, var(--hc) 22%, var(--surface)); }
.list-item__icon:has(.gi.is-loaded) { background: none; }
/* neurojogos e baú */
.game-card__icon:has(.gi.is-loaded) { background: none; width: 72px; height: 72px; margin: -8px 0 0 -8px; }
.game-card__icon .gi .ico { width: 28px; height: 28px; }
.game__badge:has(.gi.is-loaded) { background: none; box-shadow: none; width: 140px; height: 140px; }
.game__badge .gi .ico { width: 40px; height: 40px; }
.chest > span { display: contents; }
.chest .gi { width: 72px; }
.chest .gi .ico { width: 72px; height: 72px; }
.chest:not(.is-open) .chest__open, .chest.is-open .chest__closed { display: none; }
.chest:has(.gi.is-loaded) { background: none; box-shadow: none; }
.chest:has(.gi.is-loaded) .gi.is-loaded { width: 150px; }

.ora-cta__ic .gi, .extra-card__icon .gi { width: 100%; height: 100%; }
.ora-cta__ic .gi__fb img, .extra-card__icon .gi__fb img { width: 100%; height: 100%; object-fit: cover; }
.ora-cta__ic:has(.gi.is-loaded), .extra-card__icon:has(.gi.is-loaded) { overflow: visible !important; }

/* Folhas: topo (alça + título + resumo) fica fixo enquanto a lista rola */
.sheet { padding-top: 0; }
.sheet__top { position: sticky; top: 0; z-index: 3; margin: 0 calc(-1 * var(--sp-5)) var(--sp-2); padding: var(--sp-3) var(--sp-5) 0; background: var(--surface); }
.sheet__top::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; background: linear-gradient(var(--surface), transparent); pointer-events: none; }
.sheet__top .sheet__head { margin-bottom: var(--sp-3); }
.sheet__sticky { padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }

/* cabeçalho compacto (resumo fixo + fechar na mesma linha) */
.sheet__top:has(.sheet__head--compact) { padding-top: 8px; }
.sheet__top:has(.sheet__head--compact) .sheet__grip { margin-bottom: 10px; }
.sheet__head--compact { align-items: center; gap: var(--sp-3); margin-bottom: 0 !important; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.level-head { display: flex; align-items: center; gap: var(--sp-3); }
.level-head .level-emblem { --le: 52px; width: 52px; height: 52px; flex: none; }
.level-head .level-emblem > * { width: 100%; height: 100%; }
.level-head__t { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-title); font-size: var(--fs-lg); font-weight: 600; line-height: 1.1; margin-bottom: 6px; }
.level-head__t small { font-family: var(--font-sub); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--link); }
.level-head__s { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-muted); }
.list--compact .list-item { padding-top: 10px; padding-bottom: 10px; min-height: 0; }
.list--compact .list-item__icon { width: 36px; height: 36px; }
.list--compact .list-item__icon svg { width: 18px; height: 18px; }
.list--compact .list-item.is-current { background: var(--primary-soft); }
/* medalhas: a imagem ocupa a área definida pelo inset (antes a largura fixa de 100% a empurrava para cima e para a esquerda) */
.badge__medal .gi { width: auto; height: auto; aspect-ratio: auto; }

/* ---------- Sino + central de notificações ---------- */
.stat-pill--bell { position: relative; width: 34px; padding: 0 !important; justify-content: center; }
.stat-pill--bell svg { width: 18px; height: 18px; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; font: 800 10px/1 var(--font-sub); font-style: normal; color: #fff; background: #D9482B; box-shadow: 0 0 0 2px var(--bg); }
.bell-count[hidden] { display: none; }
.inbox-head { display: flex; flex-direction: column; gap: 10px; }
.inbox-head > b { font-family: var(--font-title); font-size: var(--fs-xl); font-weight: 600; }
.inbox-tabs { display: flex; gap: 6px; }
.inbox-tabs button { flex: 1; height: 36px; border-radius: 99px; font: 700 var(--fs-sm) var(--font-sub); color: var(--text-muted); background: var(--surface-2, #f3ede3); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.inbox-tabs button[aria-selected="true"] { background: var(--primary-soft); color: var(--link); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.inbox-tabs i { font-style: normal; font-size: 11px; min-width: 18px; padding: 1px 6px; border-radius: 99px; background: var(--primary); color: #fff; }
.inbox-tabs i:empty { display: none; }
.inbox-list { display: flex; flex-direction: column; gap: 8px; }
.inbox-item { display: flex; align-items: flex-start; gap: 4px; padding: 10px 6px 10px 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); transition: opacity .2s, transform .2s; }
.inbox-item.is-unread { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.inbox-item.is-out { opacity: 0; transform: translateX(30px); }
.inbox-item__main { flex: 1; display: flex; gap: 10px; text-align: left; min-width: 0; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; }
.inbox-item__ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ic); background: color-mix(in srgb, var(--ic) 15%, transparent); }
.inbox-item__ic svg { width: 18px; height: 18px; }
.inbox-item__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-item__txt b { font-size: var(--fs-sm); line-height: 1.25; position: relative; }
.inbox-item.is-unread .inbox-item__txt b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--primary); vertical-align: 2px; }
.inbox-item__txt span { font-size: var(--fs-xs); color: var(--text-2, var(--text)); line-height: 1.35; }
.inbox-item__txt small { font-size: 11px; color: var(--text-muted); }
.inbox-item__act { flex: none; width: 34px; height: 34px; color: var(--text-muted); }
.inbox-item__act svg { width: 17px; height: 17px; }
.inbox-item__acts { display: flex; }
.inbox-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--text-muted); }
.inbox-empty svg { width: 34px; height: 34px; opacity: .6; }
.inbox-foot { display: flex; gap: 8px; justify-content: center; margin-top: var(--sp-4); flex-wrap: wrap; }
.inbox-sheet .sheet__head--compact { align-items: flex-start; }
/* chips com ícone: ícone e texto na mesma linha */
.filter-chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.filter-chip > svg { width: 16px; height: 16px; flex: none; }

/* ---------- Equalizador "tocando agora" (padrão de todos os áudios) ---------- */
.eq { display: inline-flex; flex: none; flex-direction: row; align-items: flex-end; gap: 2px; width: 16px; height: 12px; vertical-align: -1px; }
.eq i { flex: 1; height: 35%; border-radius: 1px; background: var(--eqc, var(--tc, var(--primary))); }
.eq.is-on i, .is-playing .eq i, [aria-pressed="true"] .eq i, .hc[data-state="playing"]:not([data-paused="true"]) .eq i, .player[data-state="running"]:not([data-paused="true"]) .eq i { animation: eqb .8s ease-in-out infinite; }
.eq i:nth-child(2) { animation-duration: .65s !important; animation-delay: -.2s; }
.eq i:nth-child(3) { animation-duration: .9s !important; animation-delay: -.45s; }
.eq i:nth-child(4) { animation-duration: .7s !important; animation-delay: -.1s; }
.eq--lg { width: 26px; height: 20px; gap: 3px; }
@keyframes eqb { 0%, 100% { height: 25%; } 50% { height: 100%; } }
/* .chips usa margin negativa nas laterais; garante o espaçamento de cima pedido pelas classes mt-* */
.chips.mt-2 { margin-top: var(--sp-2); } .chips.mt-3 { margin-top: var(--sp-3); } .chips.mt-4 { margin-top: var(--sp-4); } .chips.mt-6 { margin-top: var(--sp-6); }
.chips { padding-top: 2px; padding-bottom: 4px; }

/* notificações: novas em destaque, vistas em cinza (estilo apps de delivery) */
.inbox-sec { display: flex; align-items: center; gap: 6px; margin: 14px 2px 8px; font: 800 11px var(--font-sub); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.inbox-sec:first-child { margin-top: 2px; }
.inbox-sec span { padding: 1px 7px; border-radius: 99px; background: var(--surface-2, #f1ebe1); font-size: 10px; }
.inbox-item.is-unread { position: relative; background: var(--surface); border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: 0 4px 14px -8px color-mix(in srgb, var(--primary) 70%, transparent); }
.inbox-item.is-unread::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.inbox-item.is-unread .inbox-item__txt b { font-weight: 800; color: var(--text); }
.inbox-item.is-unread .inbox-item__txt span { color: var(--text); }
.inbox-item:not(.is-unread) { background: transparent; border-color: transparent; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.inbox-item:not(.is-unread) .inbox-item__ic { filter: grayscale(1); opacity: .5; }
.inbox-item:not(.is-unread) .inbox-item__txt b { font-weight: 600; color: var(--text-muted); }
.inbox-item:not(.is-unread) .inbox-item__txt span, .inbox-item:not(.is-unread) .inbox-item__txt small { color: var(--text-muted); opacity: .8; }

/* ---------- foto do perfil / avatar ---------- */
.avatar--img img, .avatar--pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--pick { background: var(--av-bg, #FBE3C7); }
.avatar--pick img { object-fit: contain; transform: scale(1.12) translateY(6%); }
.avatar--xl { width: 128px; height: 128px; border: 4px solid var(--surface); box-shadow: var(--sh-2); font-size: 40px; }
.profile-avatar { position: relative; display: inline-block; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.profile-avatar:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.profile-avatar__cam { position: absolute; right: 0; bottom: 2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--primary, #F29940); border: 3px solid var(--surface); box-shadow: var(--sh-1); transition: transform .2s; }
.profile-avatar__cam svg { width: 17px; height: 17px; }
.profile-avatar:hover .profile-avatar__cam { transform: scale(1.08); }
.av-menu__preview { display: flex; justify-content: center; margin-top: 4px; }
.av-remove .list-item__title, .av-remove .list-item__icon { color: var(--danger, #C0392B); }
.av-bgs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.av-bgs button { width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); cursor: pointer; transition: transform .15s; }
.av-bgs button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); transform: scale(1.06); }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; margin-top: 8px; padding-bottom: 76px; }
.av-grid button { aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; overflow: hidden; background: var(--av-bg); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .15s; }
.av-grid button img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.12) translateY(6%); }
.av-grid button[aria-checked="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); transform: scale(1.04); }
.av-foot { position: sticky; bottom: calc(-1 * var(--sp-6) - var(--safe-b, 0px)); margin: 0 calc(-1 * var(--sp-5)); padding: 12px var(--sp-5) calc(14px + var(--safe-b, 0px)); background: linear-gradient(180deg, transparent, var(--surface) 30%); }
.av-crop { position: relative; width: min(100%, 320px); aspect-ratio: 1; margin: 4px auto 0; overflow: hidden; border-radius: 18px; background: #111; touch-action: none; cursor: grab; user-select: none; }
.av-crop:active { cursor: grabbing; }
.av-crop img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.av-crop__mask { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, transparent 0 49.6%, rgba(0,0,0,.55) 50%); }
.av-crop__mask::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.9); }
.av-zoom { display: flex; align-items: center; gap: 10px; max-width: 320px; margin: 12px auto 0; color: var(--text-muted); }
.av-zoom input { flex: 1; accent-color: var(--primary); }
.av-zoom__s svg { width: 14px; height: 14px; } .av-zoom__l svg { width: 22px; height: 22px; }

/* Confirmação digitada (ex.: EXCLUIR) */
.confirm-word{display:block;text-align:left}
.confirm-word .input{text-transform:uppercase;letter-spacing:.08em;font-weight:600}

/* Rótulo sobre a borda do campo (padrão do app inteiro: economiza altura).
   Só quando o rótulo vem logo antes do campo (input, select, textarea ou .field__control);
   grupos de botões e chips mantêm o rótulo normal em cima. */
.field:has(> .field__label:first-child + :is(.input, .field__control)) { position: relative; padding-top: 8px; }
.field > .field__label:first-child:has(+ :is(.input, .field__control)) {
  position: absolute; top: 0; left: 12px; z-index: 2; max-width: calc(100% - 24px);
  padding: 0 6px; font-size: 12px; line-height: 16px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px;
  /* metade de cima some no fundo da tela; metade de baixo cobre a borda do campo */
  background: linear-gradient(to bottom, transparent 7px, var(--surface) 7px);
}
.field > .field__label:first-child + :is(.input, .field__control) { margin-top: 0; }
.field:focus-within > .field__label:first-child:has(+ :is(.input, .field__control)) { color: var(--primary-strong, var(--primary)); }
/* caixas de texto de várias linhas: o texto não encosta no rótulo da borda */
.field > .field__label:first-child + textarea.input { padding-top: 18px; padding-bottom: 12px; line-height: 1.5; min-height: 112px; }
.feedback-scale { margin-top: 2px; margin-bottom: 10px; }

/* Documentos legais no modal */
.legal-sheet__tabs{margin:0;padding:2px 0 4px}
.legal-sheet .legal{font-size:14.5px}

/* Notificação de pessoa: foto de quem seguiu com o ícone pequeno no canto */
.inbox-item__av { position: relative; flex: none; width: 40px; height: 40px; }
.inbox-item__av .avatar { width: 40px; height: 40px; font-size: 14px; }
.inbox-item__av i { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ic); border: 2px solid var(--surface); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ic) 30%, transparent); }
.inbox-item__av i svg { width: 12px; height: 12px; }
.inbox-item:not(.is-unread) .inbox-item__av { opacity: .7; }
