/* Arara — guarda-roupa virtual */
:root {
  --bg: #f3f2ef;
  --surface: #fbfaf8;
  --surface-2: #ebe9e4;
  --board: #e6e6e3;
  --tile: #ecebe8;
  --ink: #171716;
  --ink-2: #3a3936;
  --muted: #74726c;
  --line: #dcdad4;
  --accent: #1f3d2b;
  --on-accent: #fbfaf8;
  --wish: #9a6a14;
  --wish-bg: #f5e9d2;
  --danger: #b3261e;
  --ok: #2f6b3e;
  --shadow: 0 12px 40px rgba(20, 18, 14, .16);
  --radius: 16px;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  --tabbar-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --surface: #1b1b1a;
    --surface-2: #262624;
    --board: #dededa;
    --tile: #2a2a28;
    --ink: #f2f1ed;
    --ink-2: #d2d0ca;
    --muted: #9c9a93;
    --line: #32312e;
    --accent: #a9d0b3;
    --on-accent: #10140f;
    --wish: #e2b458;
    --wish-bg: #3a2f1a;
    --shadow: 0 12px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; }
body { overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
svg.ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

#app {
  height: 100vh; height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
  max-width: 560px; margin: 0 auto;
}

/* ---------- Topo ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
}
.brand { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -.01em; margin: 0; }
.seg {
  display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px;
}
.seg button {
  padding: 7px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 550; color: var(--muted);
  transition: background .2s, color .2s;
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg button[data-v="wish"][aria-selected="true"] { color: var(--wish); }

main { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; position: relative; min-height: 0; }
main.no-scroll { overflow: hidden; }

/* ---------- Barra inferior ---------- */
.tabbar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 550; color: var(--muted);
}
.tabbar button[aria-current="page"] { color: var(--ink); }
.tabbar .ti svg.ic { width: 23px; height: 23px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 16px; border-radius: 12px; font-weight: 600; font-size: 15px;
  background: var(--surface-2); color: var(--ink);
  transition: transform .12s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.accent { background: var(--accent); color: var(--on-accent); }
.btn.wish { background: var(--wish-bg); color: var(--wish); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--ink);
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn.on { background: var(--ink); color: var(--bg); }
.badge-count {
  min-width: 18px; height: 18px; border-radius: 9px; background: var(--ink); color: var(--bg);
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; padding: 0 5px;
}

/* ---------- Montador ---------- */
.builder { height: 100%; display: flex; flex-direction: column; padding: 0 12px 10px; gap: 8px; }
.build-bar { display: flex; align-items: center; gap: 4px; }
.build-bar .spacer { flex: 1; }
.build-bar .chip-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); font-size: 13.5px; font-weight: 600;
}
.build-bar .chip-btn.on { background: var(--ink); color: var(--bg); }

.board {
  --board-ink: #1a1a18;
  position: relative; flex: 1; min-height: 0; background: var(--board); border-radius: 22px;
  display: grid; gap: 2%; padding: 3.5% 3%;
  overflow: hidden;
}
.board.layout-coluna {
  grid-template-columns: 1fr 2.5fr 1fr;
  grid-template-rows: 1fr 1.55fr .5fr;
  grid-template-areas: "acc top acc2" "acc bottom acc2" "acc shoes acc2";
}
.board.layout-colagem {
  grid-template-columns: 1fr 1.6fr;
  grid-template-rows: 1fr 1.25fr .75fr;
  grid-template-areas: "acc top" "acc bottom" "shoes bottom";
}
.zone { min-height: 0; min-width: 0; position: relative; }
.zone-top { grid-area: top; }
.zone-bottom { grid-area: bottom; }
.zone-shoes { grid-area: shoes; }
.zone-acc, .zone-acc2 { display: flex; flex-direction: column; justify-content: center; gap: 4%; }
.zone-acc { grid-area: acc; }
.zone-acc2 { grid-area: acc2; }
.layout-colagem .zone-acc2 { display: none; }
.layout-colagem .zone-acc { justify-content: flex-start; }
.zone-acc .slot, .zone-acc2 .slot { flex: 0 1 22%; min-height: 0; }
.layout-colagem .zone-acc .slot { flex: 0 1 19%; }

.slot {
  position: relative; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; border-radius: 12px;
  outline: none; container-type: inline-size;
}
@container (max-width: 150px) { .pill .full { display: none; } }
.slot-stage { position: absolute; inset: 0; overflow: visible; }
.slot-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; will-change: transform, opacity;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.02));
}
.slot.empty { cursor: pointer; }
.slot-empty {
  position: absolute; inset: 6%; border: 1.5px dashed rgba(0,0,0,.2); border-radius: 12px;
  display: grid; place-items: center; text-align: center; color: rgba(0,0,0,.45); font-size: 12.5px; font-weight: 600; padding: 6px;
}
.slot-empty svg.ic { width: 18px; height: 18px; margin: 0 auto 4px; display: block; }
.slot-badges { position: absolute; top: 2px; right: 2px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; pointer-events: none; z-index: 2; }
.pill {
  font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 999px; letter-spacing: .01em;
  background: rgba(255,255,255,.88); color: #3b3a36; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.pill.wish { background: #f5e3bf; color: #7b5209; }
.pill.recent { background: #fff; color: #9a3412; }
.slot-lock {
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  color: rgba(0,0,0,.2); z-index: 3;
}
.slot-lock svg.ic { width: 14px; height: 14px; }
.slot.locked .slot-lock { color: #fff; background: rgba(23,23,22,.85); }
.zone-acc .slot-lock, .zone-acc2 .slot-lock { width: 24px; height: 24px; }
.slot-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 44px; display: none; place-items: center; color: rgba(0,0,0,.4); z-index: 3; }
.slot-nav.prev { left: -6px; } .slot-nav.next { right: -6px; }
@media (hover: hover) and (pointer: fine) { .slot:hover .slot-nav { display: grid; } }
.slot.dragging { cursor: grabbing; }
.add-acc {
  align-self: center; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px dashed rgba(0,0,0,.25); color: rgba(0,0,0,.5); flex: none;
}
.board-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 11.5px; color: rgba(0,0,0,.45);
  background: rgba(255,255,255,.7); padding: 4px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap;
  transition: opacity .6s;
}
.shuffle-in { animation: shuffleIn .42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes shuffleIn { from { opacity: 0; transform: scale(.92) translateY(8px); } to { opacity: 1; transform: none; } }

.look-summary {
  min-height: 22px; line-height: 22px; font-size: 13px; color: var(--muted); padding: 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.look-summary .wish-sum { color: var(--wish); font-weight: 650; }
.look-summary button { text-decoration: underline; text-underline-offset: 2px; font-size: 13px; color: inherit; }
.build-actions { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; }
.build-actions .btn { height: 48px; }

/* ---------- Acervo ---------- */
.closet { padding: 4px 0 96px; }
.cat-row {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat {
  flex: none; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px;
}
.cat[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cat .n { font-weight: 500; opacity: .6; font-size: 12px; }
.cat.todo { border-color: var(--wish); color: var(--wish); }
.closet-tools { display: flex; gap: 8px; padding: 0 16px 12px; }
.search {
  flex: 1; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px;
  font-size: 16px; min-width: 0;
}
.banner {
  margin: 0 16px 12px; padding: 12px 14px; border-radius: 14px; background: var(--wish-bg); color: var(--wish);
  display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; width: calc(100% - 32px); text-align: left;
}
.banner span { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 12px; }
.tile {
  position: relative; aspect-ratio: 3 / 4; background: var(--tile); border-radius: 12px; overflow: hidden;
  display: block; width: 100%;
}
.tile img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; }
.tile .mark { position: absolute; top: 6px; right: 6px; }
.tile .mark .pill { font-size: 10px; padding: 2px 6px; }
.tile.pending { outline: 2px dashed var(--wish); outline-offset: -2px; }
.tile:active { transform: scale(.98); }
.fab {
  position: fixed; right: max(18px, calc(50vw - 280px + 18px)); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  width: 58px; height: 58px; border-radius: 20px; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; box-shadow: var(--shadow); z-index: 20;
}
.fab svg.ic { width: 26px; height: 26px; stroke-width: 2; }
.empty-state { text-align: center; padding: 48px 28px; color: var(--muted); }
.empty-state h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--ink); margin: 0 0 8px; }
.empty-state p { margin: 0 0 18px; line-height: 1.45; }

/* ---------- Looks ---------- */
.looks { padding: 4px 0 40px; }
.looks .seg { margin: 0 16px 14px; display: flex; }
.looks .seg button { flex: 1; }
.look-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 12px; }
.look-card { text-align: left; }
.look-card .name { font-weight: 650; font-size: 14px; margin: 6px 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.look-card .sub { font-size: 12px; color: var(--muted); margin: 1px 4px 0; }
.mini { aspect-ratio: 3 / 4.4; border-radius: 14px; pointer-events: none; }
.mini.board { padding: 5% 4%; gap: 2%; border-radius: 14px; flex: none; }
.mini .mini-img { width: 100%; height: 100%; object-fit: contain; display: block; min-height: 0; }
.mini .zone-acc, .mini .zone-acc2 { gap: 3%; }
.mini .zone-acc .mini-img, .mini .zone-acc2 .mini-img { height: 22%; flex: none; }
.section-title { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 18px 16px 10px; }
.history-month { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 16px 8px; }
.history-row { display: flex; gap: 12px; align-items: center; padding: 8px 16px; width: 100%; text-align: left; }
.history-row .mini { width: 64px; }
.history-row .date { font-weight: 650; }
.history-row .pieces { font-size: 13px; color: var(--muted); line-height: 1.35; }
.forgotten { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: none; }
.forgotten::-webkit-scrollbar { display: none; }
.forgotten .tile { width: 92px; flex: none; }
.forgotten .tile .cap { position: absolute; left: 6px; right: 6px; bottom: 5px; font-size: 10px; font-weight: 650; color: #5a5853; text-align: center; }

/* ---------- Ajustes ---------- */
.settings { padding: 4px 16px 40px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 0 0 4px; }
.card .lead { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin: 0 0 14px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 6px; letter-spacing: .01em; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px; font-size: 16px;
}
textarea.input { height: auto; padding: 10px 12px; min-height: 70px; resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.status-line { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.4; }
.status-line.err { color: var(--danger); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 12px; font-size: 14.5px; }
.toggle input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.toggle input:checked { background: var(--ok); }
.toggle input:checked::after { transform: translateX(18px); }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }

/* ---------- Folhas (bottom sheets) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 8, .38); opacity: 0; transition: opacity .25s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 92dvh;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transform: translateY(104%); transition: transform .32s cubic-bezier(.2,.8,.2,1);
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 18px; flex: none; }
.sheet-head h2 { flex: 1; margin: 0; font-family: var(--serif); font-weight: 500; font-size: 21px; }
.sheet-head .sub { font-size: 12.5px; color: var(--muted); font-family: var(--sans); }
.sheet-body { overflow-y: auto; padding: 4px 18px calc(18px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 8px; padding-top: 14px; position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: var(--surface); padding-bottom: 4px; }
.sheet-foot .btn { flex: 1; height: 50px; }

.preview {
  position: relative; background: var(--board); border-radius: 16px; height: 34vh; min-height: 220px; display: grid; place-items: center; overflow: hidden;
}
.preview.checker {
  background-color: #f0f0ee;
  background-image: linear-gradient(45deg, #e2e2df 25%, transparent 25%), linear-gradient(-45deg, #e2e2df 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e2df 75%), linear-gradient(-45deg, transparent 75%, #e2e2df 75%);
  background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}
.preview img, .preview canvas { max-width: 92%; max-height: 92%; object-fit: contain; }
.preview .busy {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(240,240,238,.75); color: #333; font-size: 13.5px; font-weight: 600; text-align: center; padding: 20px;
}
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(0,0,0,.12); border-top-color: #222; animation: spin .8s linear infinite; margin: 0 auto 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.segs { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.segs button { flex: 1; height: 36px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.segs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.range { width: 100%; accent-color: var(--ink); margin: 10px 0 0; }
.cat-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cat-pick button {
  height: 64px; border-radius: 12px; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 650; color: var(--ink-2);
}
.cat-pick button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 32px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.chip.add { border-style: dashed; color: var(--muted); }
.group { margin: 16px 0; }
.group > h4 { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }

.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pick-grid .tile[aria-pressed="true"] { outline: 2.5px solid var(--ink); outline-offset: -2.5px; }
.pick-grid .tile.none { display: grid; place-items: center; font-size: 13px; font-weight: 650; color: var(--muted); }

.detail-img { height: 40vh; }
.stats { display: flex; gap: 8px; margin: 12px 0 4px; }
.stat { flex: 1; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 17px; }
.stat span { font-size: 12px; color: var(--muted); }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.links a { font-size: 13.5px; font-weight: 600; color: var(--ink); display: inline-flex; gap: 5px; align-items: center; text-decoration: none; padding: 7px 11px; border-radius: 10px; background: var(--bg); }
.action-list { display: flex; flex-direction: column; gap: 8px; }
.action-list .btn { justify-content: flex-start; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Avisos ---------- */
#toasts { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 10px); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 300; pointer-events: none; }
.toast {
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 550;
  box-shadow: var(--shadow); max-width: min(92vw, 420px); animation: toastIn .3s cubic-bezier(.2,.8,.2,1);
}
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Entrar / criar conta ---------- */
#auth {
  position: fixed; inset: 0; z-index: 200; background: var(--bg); overflow-y: auto;
  display: flex; align-items: flex-start; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 8vh) 20px calc(env(safe-area-inset-bottom) + 24px);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand img { border-radius: 16px; box-shadow: var(--shadow); }
.auth-brand h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; margin: 14px 0 4px; }
.auth-brand p { color: var(--muted); margin: 0; }
.auth-card .segs { margin-bottom: 18px; }
.auth-card .btn.block { height: 50px; margin-top: 4px; }
.pw-row { display: flex; gap: 6px; align-items: center; }
.pw-row .input { flex: 1; }
.auth-msg { min-height: 20px; font-size: 13.5px; color: var(--danger); margin: 2px 0 10px; line-height: 1.4; }
.auth-msg.info { color: var(--muted); }
.auth-hint { text-align: center; line-height: 1.45; margin-top: 14px; }
.spinner.small-spin { width: 16px; height: 16px; border-width: 2px; margin: 0; display: inline-block; vertical-align: -3px; border-color: rgba(255,255,255,.3); border-top-color: currentColor; }

/* imagem ainda chegando da nuvem: espaço de espera suave em vez de tela parada */
.tile:has(img[data-loading]), .preview:has(img[data-loading]) { background-image: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
img[data-loading][src^="data:"] { opacity: 0; }
img.slot-img, .tile img, .mini-img { transition: opacity .25s; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ---------- Montagem em escala real: peças posicionadas pelo cálculo de tamanho ---------- */
.board, .board.layout-coluna, .board.layout-colagem { display: block; padding: 0; }
.board > .slot {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  transition: left .34s cubic-bezier(.2,.8,.2,1), top .34s cubic-bezier(.2,.8,.2,1), width .34s cubic-bezier(.2,.8,.2,1), height .34s cubic-bezier(.2,.8,.2,1);
}
.board.no-anim > .slot { transition: none; }
.board > .slot .slot-empty { inset: 0; }
.board > .add-acc { position: absolute; transform: translate(-50%, -50%); margin: 0; transition: left .34s, top .34s; }
.board .slot-lock { left: -6px; top: -6px; }
.mini.board { position: relative; display: block; padding: 0; }
.mini .mini-img { position: absolute; width: auto; height: auto; object-fit: contain; }
.size-cm { margin-top: 10px; }
.size-cm .input { max-width: 140px; }
