:root {
  --fundo: #F8EEE8; --cartao: #FFFAF7; --linha: #E9D3C4; --nude: #D9B9A5;
  --blush: #E8B4BC; --rosa: #D98BA3; --rosa-forte: #C2607F; --rosa-fraco: #FBE7EA;
  --ouro: #B8924A; --ouro-escuro: #8C6A2B; --texto: #4A2C22; --suave: #8A6E63;
  --verde: #5E9B6E; --ambar: #C99A2E; --verm: #C2504F;
  --sombra: 0 6px 24px rgba(140, 90, 70, .10); --raio: 18px;
  --serifa: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: Inter, Poppins, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 16px/1.5 var(--sans); padding-bottom: 88px; }
h1, h2, h3 { font-family: var(--serifa); color: var(--ouro); font-weight: 600; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.25rem; color: var(--ouro-escuro); }
p { margin: .3em 0; }
.suave { color: var(--suave); font-size: .92rem; }
header.topo { text-align: center; padding: 22px 16px 6px; }
header.topo .marca { font-family: var(--serifa); font-size: 2.1rem; color: var(--ouro); letter-spacing: .08em; }
header.topo .marca b { color: var(--rosa-forte); font-weight: 600; }
header.topo .filete { height: 1px; width: 120px; margin: 8px auto 0; background: linear-gradient(90deg, transparent, var(--ouro), transparent); }
main { max-width: 980px; margin: 0 auto; padding: 12px 16px 24px; }
.cartao { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; margin: 14px 0; box-shadow: var(--sombra); }
.grade { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
label.campo { display: block; font-size: .85rem; color: var(--suave); margin: 8px 0 2px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--nude); border-radius: 12px;
  background: #fff; color: var(--texto); font: inherit; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--rosa); outline-offset: 2px; }
button { min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--nude); background: #fff; color: var(--texto);
  font: 600 .95rem var(--sans); cursor: pointer; }
button.principal { background: var(--rosa-forte); border-color: var(--rosa-forte); color: #fff; }
button.principal:hover { background: #AE506F; }
button.fantasma { background: transparent; }
button.perigo { color: var(--verm); }
button:disabled { opacity: .5; cursor: default; }
.linha { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.linha > .cresce { flex: 1 1 160px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--rosa-fraco); color: var(--rosa-forte); }
.chip.verde { background: #E4F1E7; color: #3F7A50; } .chip.amarelo { background: #FBF1D6; color: #8A6410; } .chip.vermelho { background: #F8DEDE; color: #A23B3A; }
nav.abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; gap: 2px;
  background: rgba(255, 250, 247, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--linha); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
nav.abas button { flex: 1; border: 0; background: transparent; border-radius: 14px; color: var(--suave); font-size: .78rem; min-height: 52px; padding: 4px; }
nav.abas button[aria-current="true"] { color: var(--rosa-forte); background: var(--rosa-fraco); }
.slot { border: 2px dashed var(--nude); border-radius: 16px; background: #fff; display: grid; place-items: center; text-align: center;
  aspect-ratio: 1; width: 100%; max-width: 260px; cursor: pointer; overflow: hidden; position: relative; color: var(--suave); font-size: .9rem; padding: 8px; }
.slot img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.slot .rot { position: absolute; left: 6px; bottom: 6px; z-index: 1; }
.opcao { border: 2px solid var(--linha); border-radius: 16px; padding: 12px; background: #fff; cursor: pointer; text-align: left; }
.opcao[aria-pressed="true"] { border-color: var(--rosa-forte); background: var(--rosa-fraco); }
.opcao b { color: var(--ouro-escuro); font-family: var(--serifa); font-size: 1.15rem; }
.folha-svg { width: 100%; max-width: 360px; height: auto; background: #fff; border: 1px solid var(--linha); border-radius: 8px; box-shadow: var(--sombra); }
.folhas { display: flex; gap: 14px; flex-wrap: wrap; }
.num { font-family: var(--serifa); font-size: 1.8rem; color: var(--ouro); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
th { font-size: .8rem; color: var(--suave); font-weight: 600; }
td input { min-width: 90px; }
.aviso { border-left: 4px solid var(--ambar); background: #FBF1D6; padding: 8px 12px; border-radius: 8px; margin: 8px 0; font-size: .92rem; }
.aviso.erro { border-color: var(--verm); background: #F8DEDE; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(74, 44, 34, .45); display: grid; place-items: center; padding: 12px; }
.modal > div { background: var(--cartao); border-radius: 22px; max-width: 520px; width: 100%; max-height: 92vh; overflow: auto; padding: 18px; }
.editor { position: relative; width: min(86vw, 380px); aspect-ratio: 1; margin: 10px auto; overflow: hidden; border-radius: 14px; background: #ddd;
  touch-action: none; cursor: grab; }
.editor img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.editor .mascara { position: absolute; inset: 0; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 60; background: var(--texto); color: #fff; padding: 10px 18px;
  border-radius: 999px; max-width: 90vw; font-size: .92rem; }
.biblioteca { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.biblioteca img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 2px solid transparent; cursor: pointer; }
.biblioteca img:hover { border-color: var(--rosa); }
pre.prompt { white-space: pre-wrap; background: #fff; border: 1px solid var(--linha); border-radius: 12px; padding: 12px; font: .9rem/1.5 var(--sans); }
@media (min-width: 760px) {
  body { padding-bottom: 24px; padding-top: 64px; }
  nav.abas { top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--linha); justify-content: center; padding: 8px; }
  nav.abas button { flex: 0 0 auto; padding: 8px 22px; font-size: .95rem; min-height: 44px; }
  .toast { bottom: 28px; }
}
