/* Dueto — sistema visual "amigo gordinho", contido. Encorpado nos controles; a obra é a protagonista. */
:root {
  /* paleta própria, de pigmento: azul Klein, vermelhão, ocre, sobre papel */
  --bg: #FBF7F1; --surface: #FFFFFF; --sunk: #F3EDE4; --ink: #1B1A1F; --muted: #615C66; --line: #E6DED2;
  --accent: #2445E0; --accent-lip: #1A31A6; --accent-soft: #E6EBFF; --accent-ink: #1F3FD1;
  --warm: #C9461F; --warm-lip: #95321A; --warm-soft: #FCE7DF; --warm-ink: #B83D17;
  --good: #187A50; --good-lip: #0F5638; --good-soft: #DDF3E8; --good-ink: #146B46;
  --ochre: #F0C454; --ochre-lip: #C99A22; --ochre-soft: #FBF0D2; --ochre-ink: #7A5A00;
  --red: #C93535; --red-soft: #FDE4E4; --red-ink: #B42B2B;
  --shadow: 0 10px 30px rgba(40, 30, 20, .12);
  --r-sm: 12px; --r: 16px; --r-lg: 22px; --r-xl: 30px;
  /* escala tipográfica: 9 tamanhos, 4 pesos (600 texto, 700 rótulo, 800 título e botão, 900 só número grande) */
  --t-xs: 12px; --t-sm: 13px; --t-body: 15px; --t-md: 17px; --t-lg: 20px; --t-xl: 24px; --t-2xl: 30px; --t-3xl: 36px; --t-4xl: 44px;
  --spring: cubic-bezier(.34, 1.4, .64, 1); --spring-soft: cubic-bezier(.25, 1.1, .5, 1);
  --font: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabs-h: 74px; --top: max(14px, env(safe-area-inset-top)); --bottom: max(12px, env(safe-area-inset-bottom));
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #16151A; --surface: #211F27; --sunk: #2A2830; --ink: #F4F1EC; --muted: #ABA5B0; --line: #34313B;
  --accent: #3F5BF0; --accent-lip: #2A40B8; --accent-soft: #252B52; --accent-ink: #B6C2FF;
  --warm: #D2532C; --warm-lip: #9A3A1E; --warm-soft: #3A2219; --warm-ink: #FF8A66;
  --good: #1E8A5A; --good-lip: #136140; --good-soft: #15302A; --good-ink: #5CC892;
  --ochre-soft: #3A3018; --ochre-ink: #F0C454; --red-soft: #3A1E22; --red-ink: #FF8A8A;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: #E9E2D7; color: var(--ink); font-family: var(--font); font-size: var(--t-body); font-weight: 600; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow: hidden; }
:root[data-theme="dark"] body { background: #0E0D11; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

/* ---------- moldura de celular no computador ---------- */
#stage { height: 100dvh; display: grid; place-items: center; }
#phone { position: relative; overflow: hidden; background: var(--bg); width: 100vw; height: 100dvh; }
@media (min-width: 520px) and (min-height: 700px) {
  #phone { width: 390px; height: min(844px, calc(100dvh - 40px)); border-radius: 48px; border: 10px solid #18171C; box-shadow: 0 30px 80px rgba(40, 30, 20, .28), 0 2px 0 #000; }
  :root { --top: 18px; --bottom: 12px; }
}
#screen { position: absolute; inset: 0; }
body.has-tabs #screen { bottom: calc(var(--tabs-h) + var(--bottom) + 2px); }

/* ---------- telas ---------- */
.view { position: absolute; inset: 0; display: flex; flex-direction: column; padding: var(--top) 16px 16px; background: var(--bg); outline: none; }
.view.scroll, .view .scroll { overflow-y: auto; overscroll-behavior: contain; }
.view.scroll { padding-bottom: 32px; }
.view.scroll > * { flex-shrink: 0; }
.view-dark { background: #141317; color: #fff; }
.view.enter { animation: viewIn 260ms var(--spring-soft) both; }
.view.enter-back { animation: viewBack 240ms var(--spring-soft) both; }
.view.leave { animation: viewOut 180ms ease-in both; pointer-events: none; }
@keyframes viewIn { from { opacity: 0; transform: translateX(18px); } }
@keyframes viewBack { from { opacity: 0; transform: translateX(-18px); } }
@keyframes viewOut { to { opacity: 0; } }

/* ---------- topo ---------- */
.topbar { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 8px; }
.topbar-title { flex: 1; text-align: center; display: flex; flex-direction: column; line-height: 1.15; }
.topbar-title b { font-size: var(--t-md); font-weight: 800; }
.topbar-title small { font-size: 12px; color: var(--muted); font-weight: 700; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); position: relative; flex: none; transition: transform 120ms; }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-spacer { width: 42px; flex: none; }
.dot-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.page-head { padding: 6px 2px 14px; display: flex; align-items: flex-start; gap: 10px; }
.page-head > div { flex: 1; }
.page-head h1 { font-size: var(--t-2xl); font-weight: 800; }
.page-head p { color: var(--muted); font-weight: 600; margin-top: 4px; }

/* ---------- botões gordinhos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: var(--r); font-weight: 800; font-size: var(--t-md); letter-spacing: .01em; transition: transform 120ms ease, box-shadow 120ms ease, background 160ms, opacity 160ms; position: relative; overflow: hidden; user-select: none; text-align: center; }
.btn-lg { min-height: 58px; font-size: var(--t-md); width: 100%; }
.btn-sm { min-height: 40px; font-size: var(--t-body); padding: 0 14px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-lip); }
.btn-primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--accent-lip); }
.btn-warm { background: var(--warm); color: #fff; box-shadow: 0 4px 0 var(--warm-lip); }
.btn-warm:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--warm-lip); }
.btn-good { background: var(--good); color: #fff; box-shadow: 0 4px 0 var(--good-lip); }
.btn-good:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--good-lip); }
.btn-light { background: var(--surface); color: var(--ink); box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px var(--line); }
.btn-light:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line), inset 0 0 0 2px var(--line); }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 4px 0 #8E2424; }
.btn-ghost { color: var(--accent-ink); min-height: 44px; font-weight: 800; padding: 0 10px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255, 255, 255, .2); pointer-events: none; }
.btn > span, .btn > b { position: relative; }
.mini { font-size: var(--t-sm); font-weight: 700; color: var(--muted); padding: 6px 10px; border-radius: 999px; background: var(--sunk); }
.mini:active { transform: scale(.95); }

/* ---------- cartões e listas ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: 0 0 0 2px var(--line); }
.card-tap { transition: transform 120ms; text-align: left; width: 100%; }
.card-tap:active { transform: scale(.98); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.hrow { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 2px 10px; }
.sec h2 { font-size: var(--t-lg); font-weight: 800; }
.kicker { font-size: var(--t-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.muted { color: var(--muted); font-weight: 600; }
.fine { color: var(--muted); font-size: 13px; font-weight: 700; }
.err { color: var(--red-ink); font-weight: 800; font-size: 14px; margin-top: 8px; }
.row-btn { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 0 0 2px var(--line), 0 4px 0 var(--line); font-weight: 800; transition: transform 120ms, box-shadow 120ms; }
.row-btn:active { transform: translateY(4px); box-shadow: 0 0 0 2px var(--line), 0 0 0 var(--line); }
.row-btn .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); font-size: 22px; flex: none; overflow: hidden; }
.row-btn .ico img { width: 100%; height: 100%; object-fit: cover; }
.row-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-txt b { overflow: hidden; text-overflow: ellipsis; }
.row-txt small { color: var(--muted); font-weight: 700; font-size: 13px; }
.row-right { color: var(--muted); font-weight: 800; font-size: var(--t-lg); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); font-weight: 800; font-size: 14px; white-space: nowrap; transition: transform 160ms var(--spring), background 160ms; }
.chip.on { background: var(--accent); color: #fff; box-shadow: none; }
.chip:active { transform: scale(.94); }
.fam-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--sunk); font-weight: 800; font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: var(--t-xs); font-weight: 800; background: var(--accent-soft); color: var(--accent-ink); }
.badge.ochre { background: var(--ochre); color: #3B2A00; }
.badge.warm { background: var(--warm-soft); color: var(--warm-ink); }
.badge.good { background: var(--good-soft); color: var(--good-ink); }
.badge.ad { background: var(--sunk); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); font-weight: 800; font-size: var(--t-body); white-space: nowrap; }
.stat-box { background: var(--surface); border-radius: var(--r); padding: 12px; text-align: center; box-shadow: 0 0 0 2px var(--line); }
.stat-box b { display: block; font-size: var(--t-xl); font-weight: 900; }
.stat-box span { font-size: 12px; color: var(--muted); font-weight: 800; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 16px; }
.empty b { font-size: var(--t-lg); font-weight: 800; }
.empty p { color: var(--muted); font-weight: 600; max-width: 280px; }

/* ---------- barras, segmentos, interruptores, formulários ---------- */
.bar { height: 12px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); transition: width 700ms var(--spring-soft); }
.bar.warm i { background: var(--warm); }
.bar.good i { background: var(--good); }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 16px; background: var(--sunk); }
.seg button { flex: 1; padding: 9px 8px; border-radius: 12px; font-weight: 800; font-size: 14px; color: var(--muted); transition: background 160ms, color 160ms; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 0 var(--line); }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; cursor: pointer; }
.toggle-row > span { flex: 1; display: flex; flex-direction: column; }
.toggle-row small { color: var(--muted); font-weight: 700; font-size: 13px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 52px; height: 32px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background 200ms; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform 260ms var(--spring); }
.toggle-row input:checked + .switch { background: var(--good); }
.toggle-row input:checked + .switch::after { transform: translateX(20px); }
.toggle-row input:focus-visible + .switch { outline: 3px solid var(--accent); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea, .input { font-size: 17px; font-weight: 700; color: var(--ink); padding: 13px 14px; border-radius: var(--r); border: 0; box-shadow: inset 0 0 0 2px var(--line); background: var(--surface); width: 100%; }
.field input:focus, .input:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 3px var(--accent); }
.write-box { position: relative; }
.write-box textarea { width: 100%; resize: none; font-size: 17px; font-weight: 700; padding: 14px 14px 26px; border-radius: var(--r); border: 0; box-shadow: inset 0 0 0 2px var(--line); background: var(--surface); }
.write-box textarea:focus { outline: none; box-shadow: inset 0 0 0 3px var(--accent); }
.write-box .count { position: absolute; right: 12px; bottom: 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; transition: box-shadow 160ms; position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .dot { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--muted); flex: none; transition: box-shadow 200ms var(--spring); }
.opt:has(input:checked) { box-shadow: inset 0 0 0 3px var(--accent); }
.opt:has(input:checked) .dot { box-shadow: inset 0 0 0 7px var(--accent); }
.opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt > span { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.opt b { font-weight: 800; }
.opt small { color: var(--muted); font-weight: 700; }
.opt em { font-style: normal; font-weight: 800; font-size: var(--t-md); }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); font-weight: 800; cursor: pointer; }
.check-row input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; margin: 0; }

/* ---------- abas ---------- */
#tabs { position: absolute; left: 12px; right: 12px; bottom: var(--bottom); height: var(--tabs-h); z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px; gap: 2px; background: var(--surface); border-radius: 26px; box-shadow: 0 0 0 2px var(--line), 0 10px 30px rgba(40, 30, 20, .12); }
#tabs[hidden] { display: none; }
#tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 18px; font-weight: 700; font-size: var(--t-xs); color: var(--muted); transition: background 160ms, color 160ms; }
#tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 300ms var(--spring); }
#tabs button[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); }
#tabs button[aria-current="page"] svg { transform: translateY(-1px) scale(1.1); }

/* ---------- folhas, camadas, avisos ---------- */
.backdrop { position: absolute; inset: 0; z-index: 40; background: rgba(20, 18, 24, .45); animation: fadeIn 200ms ease both; }
.sheet:focus { outline: none; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92%; display: flex; flex-direction: column; background: var(--bg); border-radius: 30px 30px 0 0; animation: sheetIn 420ms var(--spring-soft) both; box-shadow: 0 -10px 40px rgba(0, 0, 0, .18); transition: transform 120ms; }
.sheet-full { height: 92%; }
.sheet-grab { flex: none; height: 26px; cursor: grab; touch-action: none; }
.sheet-grab::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 10px auto 0; }
.sheet-body { overflow-y: auto; padding: 4px 18px calc(var(--bottom) + 18px); }
.sheet.out { animation: sheetOut 220ms ease-in both; }
.backdrop.out { animation: fadeOut 220ms ease-in both; }
.sheet h2 { font-size: var(--t-xl); font-weight: 800; margin-bottom: 6px; }
.sheet .sub { color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.sheet .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.overlay { position: absolute; inset: 0; z-index: 46; background: var(--bg); animation: fadeIn 220ms ease both; display: flex; flex-direction: column; }
.overlay.zoom { background: #0E0D11; color: #fff; }
.zoom-wrap { flex: 1; overflow: hidden; display: grid; place-items: center; touch-action: none; }
.zoom-img { max-width: 100%; max-height: 100%; transition: transform 200ms ease; transform-origin: center; cursor: grab; user-select: none; }
.zoom-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(var(--bottom) + 10px); }
.zoom-bar span { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.zoom-bar small { opacity: .7; font-weight: 700; }
.zoom-hint { position: absolute; top: calc(var(--top) + 8px); left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 800; opacity: .7; }
#toast { position: absolute; left: 50%; top: calc(var(--top) + 52px); z-index: 60; translate: -50% 0; width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 800; font-size: 15px; opacity: 0; transform: translateY(-12px); transition: opacity 200ms, transform 360ms var(--spring); pointer-events: none; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
#toast.on { opacity: 1; transform: none; }
.banner { position: absolute; left: 10px; right: 10px; top: calc(var(--top) - 4px); z-index: 70; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); box-shadow: 0 12px 30px rgba(0, 0, 0, .18), 0 0 0 1px var(--line); transform: translateY(-140%); transition: transform 420ms var(--spring); }
.banner.on { transform: none; }
.banner-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); font-size: 22px; flex: none; }
.banner-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.banner-txt span { color: var(--muted); font-weight: 700; font-size: 14px; }
.banner-app { font-size: 12px; color: var(--muted); font-weight: 800; align-self: flex-start; }
#confetti { position: absolute; inset: 0; z-index: 55; pointer-events: none; width: 100%; height: 100%; }
.fly { position: absolute; z-index: 50; border-radius: 10px; overflow: hidden; pointer-events: none; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.fly img { width: 100%; height: 100%; object-fit: cover; }
.float-up { position: absolute; z-index: 56; font-weight: 800; font-size: var(--t-body); color: var(--warm-ink); background: var(--warm-soft); padding: 5px 11px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.pop { animation: pop 620ms var(--spring) 1; }
@keyframes pop { 30% { transform: scale(1.4) rotate(-8deg); } 60% { transform: scale(.92) rotate(4deg); } }
.shake { animation: shake 420ms ease 1; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- grade de obras ---------- */
.masonry { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.masonry .col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tile { display: block; width: 100%; position: relative; border-radius: var(--r); overflow: hidden; background: var(--sunk); box-shadow: 0 4px 12px rgba(40, 30, 20, .12); transition: transform 200ms var(--spring); text-align: left; }
.tile:active { transform: scale(.97); }
.tile img { width: 100%; height: auto; }
.tile .rank { position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: #1B1A1F; font-weight: 800; font-size: var(--t-sm); }
.tile .rank.top { background: var(--ochre); color: #3B2A00; }
.tile-badge { position: absolute; top: 8px; right: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(27, 26, 31, .82); color: #fff; font-weight: 800; font-size: var(--t-xs); }
.tile-sub { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; font-weight: 800; font-size: 13px; line-height: 1.2; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }

/* ---------- avatar ---------- */
.av { width: var(--s); height: var(--s); border-radius: 50%; background: var(--av); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: calc(var(--s) * .38); flex: none; overflow: hidden; box-shadow: 0 0 0 2px var(--bg); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-stack { display: flex; }
.av-stack .av + .av { margin-left: -10px; }

/* ---------- Bolota ---------- */
.bolota-wrap { display: inline-block; width: var(--bs); height: var(--bs); flex: none; }
.bolota { width: 100%; height: 100%; overflow: visible; }
.bolota .b-fill { fill: var(--accent); }
.bolota .b-beret { fill: var(--warm); }
.bolota .b-shadow { fill: rgba(0, 0, 0, .08); }
.bolota .b-eyes { transform-origin: 60px 68px; animation: blink 4.2s infinite; }
.bolota .b-arm, .bolota .b-brows, .bolota .b-mouth-o, .bolota .b-sweat, .bolota .b-hearts, .bolota .b-zzz, .bolota .b-brush { opacity: 0; }
.mood-idle .b-body, .mood-wave .b-body { animation: bob 2.6s ease-in-out infinite; }
.mood-idle .b-brush, .mood-think .b-brush { opacity: 1; }
.mood-wave .b-arm { opacity: 1; transform-origin: 96px 74px; animation: wave 1.2s ease-in-out infinite; }
.mood-think .b-brush { transform-origin: 96px 92px; animation: stir 700ms ease-in-out infinite; }
.mood-jump .b-body { animation: jump 900ms var(--spring) infinite; transform-origin: 60px 108px; }
.mood-jump .b-arm { opacity: 1; }
.mood-worried .b-brows, .mood-worried .b-sweat, .mood-worried .b-mouth-o { opacity: 1; }
.mood-worried .b-mouth { opacity: 0; }
.mood-worried .b-body { animation: tremble 1.6s ease-in-out infinite; }
.mood-love .b-hearts { opacity: 1; animation: hearts 1.6s ease-in-out infinite; }
.mood-love .b-body { animation: bob 2s ease-in-out infinite; }
.mood-sleep .b-eyes { transform: scaleY(.12); animation: none; }
.mood-sleep .b-zzz { opacity: 1; animation: zzz 2.4s ease-in-out infinite; }
.mood-proud .b-arm { opacity: 1; transform: rotate(-30deg); transform-origin: 96px 74px; }
.mood-proud .b-body { animation: bob 2.6s ease-in-out infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes wave { 50% { transform: rotate(-28deg); } }
@keyframes stir { 50% { transform: rotate(-24deg); } }
@keyframes jump { 30% { transform: translateY(-18px) scale(1.04, .96); } 60% { transform: translateY(0) scale(1.06, .92); } }
@keyframes tremble { 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
@keyframes hearts { 50% { transform: translateY(-6px); opacity: .7; } }
@keyframes zzz { 50% { transform: translate(3px, -5px); opacity: .5; } }

/* ---------- menos movimento ---------- */
.less-motion *, .less-motion *::before, .less-motion *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
@media (prefers-reduced-motion: reduce) { :root:not(.more-motion) *, :root:not(.more-motion) *::before { animation-iteration-count: 1 !important; } }

/* ================= v3: peças novas ================= */

/* ---------- botão do meio (＋ Fui) ---------- */
#tabs .fui-tab { position: relative; }
#tabs .fui-btn { width: 58px; height: 58px; margin-top: -26px; border-radius: 22px; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-lip), 0 8px 20px rgba(36, 69, 224, .32); transition: transform 160ms var(--spring); }
#tabs .fui-btn svg { width: 30px; height: 30px; stroke-width: 2.8; }
#tabs .fui-tab:active .fui-btn { transform: translateY(4px); box-shadow: 0 0 0 var(--accent-lip); }
#tabs .fui-tab > span:last-child { color: var(--accent-ink); font-weight: 800; }
#tabs .fui-btn { color: #fff; }

/* ---------- nota (estilo Beli) ---------- */
.score { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: none; border-radius: 999px; line-height: 1; font-variant-numeric: tabular-nums; }
.score b { font-weight: 900; }
.score small { font-size: 10px; font-weight: 700; margin-top: 2px; opacity: .85; white-space: nowrap; }
.score-sm { min-width: 42px; height: 42px; padding: 0 6px; } .score-sm b { font-size: var(--t-body); }
.score-md { min-width: 56px; height: 56px; padding: 0 8px; } .score-md b { font-size: var(--t-lg); }
.score-lg { min-width: 108px; height: 108px; } .score-lg b { font-size: var(--t-4xl); } .score-lg small { font-size: var(--t-sm); }
.score-sm small { display: none; }
.s-hi { background: var(--good-soft); color: var(--good-ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--good) 35%, transparent); }
.s-mid { background: var(--ochre-soft); color: var(--ochre-ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ochre) 55%, transparent); }
.s-lo, .s-none { background: var(--sunk); color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); }

/* ---------- gosto ---------- */
.taste-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.taste-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--sunk); font-weight: 700; font-size: var(--t-sm); white-space: nowrap; }

/* ---------- exposições ---------- */
.expo-card { display: flex; flex-direction: column; width: 100%; text-align: left; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: 0 0 0 2px var(--line), 0 4px 0 var(--line); transition: transform 140ms; }
.expo-card:active { transform: translateY(3px); box-shadow: 0 0 0 2px var(--line), 0 1px 0 var(--line); }
.expo-collage { display: grid; height: 150px; gap: 2px; background: var(--sunk); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.expo-collage.n1 { grid-template-columns: 1fr; } .expo-collage.n2 { grid-template-columns: 1fr 1fr; } .expo-collage.n3 { grid-template-columns: 2fr 1fr 1fr; }
.expo-collage img { width: 100%; height: 100%; object-fit: cover; min-width: 0; }
.expo-card-body { display: flex; align-items: center; gap: 12px; padding: 12px 14px 14px; }
.expo-card-body .row-txt b { font-size: var(--t-md); font-weight: 800; line-height: 1.2; white-space: normal; }
.expo-card-body small.free, .expo-row small.free { color: var(--good-ink); }
.expo-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px; border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 0 0 2px var(--line); transition: transform 120ms; }
.expo-row:active { transform: scale(.98); }
.expo-row img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: none; background: var(--sunk); }
.expo-mini { width: 150px; display: flex; flex-direction: column; gap: 2px; text-align: left; position: relative; }
.expo-mini-img { display: block; height: 150px; border-radius: var(--r); overflow: hidden; background: var(--sunk); margin-bottom: 6px; }
.expo-mini-img img { width: 100%; height: 100%; object-fit: cover; }
.expo-mini b { font-size: var(--t-body); font-weight: 800; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.expo-mini small { color: var(--muted); font-weight: 700; font-size: var(--t-sm); }
.expo-mini .score { position: absolute; top: 8px; right: 8px; background: var(--surface); }

/* ---------- pessoas ---------- */
.row-btn .ico.ico-av { background: none; border-radius: 50%; }
.av-more { background: var(--sunk); color: var(--muted); font-size: calc(var(--s) * .34); }

/* ---------- comparação "gostou mais de qual?" ---------- */
.cmp { display: flex; flex-direction: column; gap: 12px; }
.cmp-q { font-size: var(--t-xl); font-weight: 800; }
.cmp-pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-card { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 8px 8px 12px; border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 0 0 2px var(--line), 0 5px 0 var(--line); transition: transform 300ms var(--spring), opacity 220ms, box-shadow 200ms; }
.cmp-card:active { transform: translateY(4px); box-shadow: 0 0 0 2px var(--line), 0 1px 0 var(--line); }
.cmp-img { display: block; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--sunk); margin-bottom: 6px; }
.cmp-img img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cmp-ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: var(--t-3xl); font-weight: 900; color: var(--accent-ink); background: var(--accent-soft); }
.cmp-card b { font-size: var(--t-body); font-weight: 800; line-height: 1.2; padding: 0 4px; }
.cmp-card small { color: var(--muted); font-weight: 700; font-size: var(--t-sm); padding: 0 4px; }
.cmp-check { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(.3); transition: opacity 160ms, transform 340ms var(--spring); }
.cmp-check svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cmp-card.picked { box-shadow: 0 0 0 4px var(--accent), 0 5px 0 var(--accent-lip); transform: translateY(-4px); }
.cmp-card.picked .cmp-check { opacity: 1; transform: none; }
.cmp-card.unpicked { opacity: .5; transform: scale(.96); }
.cmp-or { position: absolute; left: 50%; top: 40%; translate: -50% -50%; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--muted); font-weight: 800; font-size: var(--t-sm); box-shadow: 0 0 0 4px var(--bg); z-index: 2; pointer-events: none; }
.cmp-tools { display: flex; align-items: center; gap: 8px; }
.cmp-tools .fine { margin-left: auto; }

/* ---------- páginas web (fora do app: lista de espera, convite) ---------- */
body.is-web #phone { background: var(--surface); }
.web-bar { display: flex; align-items: center; justify-content: center; gap: 6px; margin: -4px -4px 10px; padding: 8px 12px; border-radius: 12px; background: var(--sunk); color: var(--muted); font-size: var(--t-sm); font-weight: 700; }
.web-bar svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- painel de demonstração (só no computador, fora do celular) ---------- */
#demo { display: none; }
@media (min-width: 900px) and (min-height: 700px) {
  #stage { grid-template-columns: 260px auto; gap: 40px; justify-content: center; }
  #demo { display: flex; flex-direction: column; gap: 8px; width: 260px; padding: 18px; border-radius: 24px; background: rgba(255, 255, 255, .7); box-shadow: 0 0 0 2px rgba(0, 0, 0, .06); color: #1B1A1F; font-family: var(--font); }
  :root[data-theme="dark"] #demo { background: rgba(255, 255, 255, .06); color: #F4F1EC; box-shadow: 0 0 0 2px rgba(255, 255, 255, .08); }
  #demo h2 { font-size: var(--t-md); font-weight: 800; }
  #demo p { font-size: var(--t-sm); font-weight: 600; opacity: .75; margin-bottom: 4px; }
  #demo h3 { font-size: var(--t-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .6; margin-top: 10px; }
  #demo button { text-align: left; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .05); font-weight: 700; font-size: var(--t-sm); }
  :root[data-theme="dark"] #demo button { background: rgba(255, 255, 255, .08); }
  #demo button:hover { background: rgba(36, 69, 224, .12); }
  #demo .demo-now { font-size: var(--t-xs); font-weight: 700; opacity: .7; }
}

/* ---------- utilidades ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn svg, .mini svg, .chip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; position: relative; }
.btn-sm svg, .mini svg, .chip svg { width: 17px; height: 17px; }

/* ================= v4: artwork cards ================= */
.art-mini { width: 148px; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.art-mini-img { position: relative; display: block; height: 168px; border-radius: var(--r); overflow: hidden; background: var(--sunk); margin-bottom: 6px; box-shadow: 0 4px 12px rgba(40, 30, 20, .10); }
.art-mini-img img { width: 100%; height: 100%; object-fit: cover; }
.art-mini b { font-size: var(--t-sm); font-weight: 800; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art-mini small { color: var(--muted); font-weight: 700; font-size: var(--t-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px; border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 0 0 2px var(--line); transition: transform 120ms; position: relative; }
.art-row:active { transform: scale(.98); }
.art-row img { width: 58px; height: 58px; border-radius: 14px; object-fit: cover; flex: none; background: var(--sunk); }
.art-row .row-txt b { font-weight: 800; line-height: 1.25; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art-big { display: flex; flex-direction: column; width: 100%; text-align: left; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: 0 0 0 2px var(--line), 0 4px 0 var(--line); position: relative; transition: transform 140ms; }
.art-big:active { transform: translateY(3px); }
.art-big-img { display: flex; align-items: center; justify-content: center; background: var(--sunk); height: 260px; padding: 14px; overflow: hidden; }
.art-big-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .18)); }
.art-big-body { display: flex; flex-direction: column; padding: 12px 14px 14px; }
.art-big-body b { font-size: var(--t-md); font-weight: 800; line-height: 1.2; }
.art-big-body small, .art-row small { color: var(--muted); font-weight: 700; font-size: var(--t-sm); }
small.reason { color: var(--accent-ink) !important; }
.saved-dot { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--accent-lip); }
.art-row .saved-dot { position: static; flex: none; }
.saved-dot svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.where-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--good-soft); color: var(--good-ink); font-weight: 800; font-size: var(--t-xs); }
.where-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; }
