/* =====================================================================
   STORY BOSS — Estilos
   Fontes: Instrument Sans e Instrument Serif (SIL Open Font License)
   ===================================================================== */
:root {
  --font-sans: "Instrument Sans";
  --font-serif: "Instrument Serif";
}

:root,
:root[data-theme="dark"] {
  --bg: #050505;
  --surface: #151515;
  --surface-2: #1d1d1d;
  --surface-3: #262626;
  --border: #393939;
  --border-soft: #262626;
  --text: #f5f4f0;
  --text-2: #a3a3a3;
  --text-3: #6f6f6f;
  --accent: #eae7de;
  --accent-ink: #0a0a0a;
  --danger: #e6a5a0;
  --success: #b9d3b0;
  --overlay: rgba(0, 0, 0, 0.62);
  --checker-a: #1a1a1a;
  --checker-b: #202020;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --surface-3: #e6e2d8;
  --border: #d6d2c7;
  --border-soft: #e6e2d8;
  --text: #121212;
  --text-2: #5e5c57;
  --text-3: #8f8c85;
  --accent: #1a1a1a;
  --accent-ink: #f6f4ef;
  --danger: #a3483f;
  --success: #3f6b3a;
  --overlay: rgba(20, 18, 14, 0.38);
  --checker-a: #f3f1ec;
  --checker-b: #e9e6df;
  --shadow: 0 18px 48px rgba(40, 32, 20, 0.14);
  color-scheme: light;
}

:root {
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-xl: 32px;
  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --page-max: 640px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Rolagem estável: a tela só anda para cima e para baixo, nunca para os lados */
html,
body {
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  max-width: 100%;
}
.app { overflow-x: clip; }
/* Sem pinça/zoom acidental: o zoom deslocava a tela para os lados */
html { touch-action: pan-x pan-y; }
/* Campos com 16px ou mais: o iPhone não dá zoom ao tocar para digitar */
input, textarea, select { font-size: max(16px, 1em); }
/* Deslizar uma esteira até o fim não arrasta a página junto */
.rail-track, .ed-tabs, .adm-tabs, [data-feed-tabs] { overscroll-behavior-x: contain; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans), system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.serif {
  font-family: var(--font-serif), "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Estrutura ---------- */

.app {
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 28px);
}

.page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: calc(var(--safe-t) + 22px) 18px 0;
}
/* telas fora da navegação principal (login etc.) mantêm a entrada suave */
.auth .page, main.page:not(.view main) { animation: pageIn 0.45s var(--ease) both; }

@media (min-width: 900px) {
  :root {
    --page-max: 980px;
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow {
  color: var(--text-2);
  font-size: 14px;
  margin: 0 0 6px;
}

.display {
  font-size: clamp(38px, 11vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0;
}

.display .serif {
  font-weight: 400;
  letter-spacing: -0.02em;
}

.h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
}

.muted {
  color: var(--text-2);
}

.small {
  font-size: 13px;
}

.section {
  margin-top: 34px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spacer {
  flex: 1;
}

/* ---------- Botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.2s var(--ease), opacity 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-quiet {
  color: var(--text-2);
  height: 40px;
  padding: 0 12px;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.2s var(--ease), background 0.2s;
  flex-shrink: 0;
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn:disabled {
  opacity: 0.35;
}

/* ---------- Campos ---------- */

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  color: var(--text-2);
}

.input {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0 16px;
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--accent);
}

textarea.input {
  height: auto;
  min-height: 100px;
  padding: 14px 16px;
  resize: vertical;
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 52px;
}

.input-wrap .input-action {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text-2);
}

.search {
  position: relative;
}

.search .input {
  padding-left: 46px;
  border-radius: 999px;
  background: var(--surface);
}

.search > svg {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  pointer-events: none;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-2);
  margin: 6px 0 18px;
}

.check input {
  margin-top: 2px;
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.alert-error {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger);
}

.alert-ok {
  border-color: color-mix(in srgb, var(--success) 45%, transparent);
  color: var(--success);
}

/* ---------- Abas / filtros ---------- */

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.25s var(--ease);
}

.tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

/* ---------- Cards de tema ---------- */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 900px) {
  .theme-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.theme-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  isolation: isolate;
  transition: transform 0.35s var(--ease);
}

.theme-card:active {
  transform: scale(0.98);
}

.theme-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.6s var(--ease);
}

.theme-card:hover img {
  transform: scale(1.04);
}

.theme-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.78) 100%);
}

.theme-card .placeholder {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 80% at 20% 10%, #2a2925 0%, transparent 60%),
    radial-gradient(90% 70% at 90% 90%, #1e1d1a 0%, transparent 60%),
    #121212;
}

.theme-card .placeholder span {
  font-family: var(--font-serif), Georgia, serif;
  font-style: italic;
  font-size: 64px;
  color: rgba(234, 231, 222, 0.16);
}

.theme-card .label {
  position: absolute;
  left: 14px;
  right: 54px;
  bottom: 14px;
  color: #f5f4f0;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  hyphens: auto;
  overflow-wrap: break-word;
}

.theme-card .go {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(245, 244, 240, 0.92);
  color: #0a0a0a;
}

/* ---------- Carrossel horizontal (Temas) ---------- */

.rail {
  position: relative;
}

.rail-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 46%;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: 0 -18px;
  padding: 0 18px;
  scroll-padding: 0 18px;
}

@media (min-width: 640px) {
  .rail-track {
    grid-auto-columns: 30%;
  }
}

@media (min-width: 900px) {
  .rail-track {
    grid-auto-columns: 22%;
  }
}

.rail-track::-webkit-scrollbar {
  display: none;
}

.rail-track > * {
  scroll-snap-align: start;
}

.rail-arrows {
  display: flex;
  gap: 8px;
}

.rail-arrows .icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  transition: opacity 0.2s, background 0.2s;
}
.rail-arrows .icon-btn:not(:disabled):active { background: var(--surface-2); }
.rail-arrows .icon-btn:disabled { opacity: 0.35; cursor: default; }

/* ---------- Inspirações (Início): Stories 9:16 em tamanho menor ---------- */
.rail-track.insp-track { grid-auto-columns: 31%; gap: 10px; }
@media (min-width: 640px) { .rail-track.insp-track { grid-auto-columns: 20%; } }
@media (min-width: 900px) { .rail-track.insp-track { grid-auto-columns: 14%; } }
.insp-card {
  position: relative; display: block; aspect-ratio: 9 / 16; padding: 0; border: 1px solid var(--border-soft);
  border-radius: 16px; overflow: hidden; background: #151515; cursor: pointer; isolation: isolate;
  transition: transform 0.35s var(--ease); font: inherit; color: inherit;
}
.insp-card:active { transform: scale(0.97); }
.insp-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.insp-card .label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 9px 9px; text-align: left;
  color: #f5f4f0; font-size: 12px; font-weight: 600; line-height: 1.2;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.insp-viewer {
  position: fixed; inset: 0; z-index: 200; background: rgba(5, 5, 5, 0.96); color: #f5f4f0;
  display: grid; grid-template-rows: auto 1fr auto; animation: insp-in 0.2s var(--ease);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.insp-viewer.closing { animation: insp-out 0.18s var(--ease) forwards; }
@keyframes insp-in { from { opacity: 0; transform: scale(0.98); } }
@keyframes insp-out { to { opacity: 0; } }
.insp-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px 18px; }
.insp-top .icon-btn, .insp-nav { color: #f5f4f0; background: rgba(255, 255, 255, 0.1); border-radius: 999px; width: 42px; height: 42px; }
.insp-count { font-size: 13px; color: rgba(245, 244, 240, 0.7); }
.insp-stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 0 16px; touch-action: pan-y; }
.insp-stage img { max-width: 100%; max-height: 100%; aspect-ratio: 9 / 16; object-fit: contain; border-radius: 18px; background: #151515; user-select: none; -webkit-user-drag: none; }
.insp-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; }
.insp-nav.prev { left: 10px; } .insp-nav.next { right: 10px; }
.insp-nav:disabled { opacity: 0; pointer-events: none; }
.insp-bottom { display: grid; gap: 12px; padding: 12px 18px 18px; }
.insp-bottom strong:empty { display: none; }
.insp-actions { display: flex; gap: 10px; }
.insp-actions > * { flex: 1; }
.insp-viewer .btn-ghost { color: #f5f4f0; border-color: rgba(255, 255, 255, 0.25); }
.insp-viewer .btn-primary { background: #f5f4f0; color: #0a0a0a; }
@media (min-width: 700px) { .insp-bottom { width: min(440px, 100%); margin: 0 auto; } }

/* Painel → Inspirações */
.adm-inspgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 700px) { .adm-inspgrid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1000px) { .adm-inspgrid { grid-template-columns: repeat(7, 1fr); } }
.adm-insp { position: relative; display: grid; gap: 6px; min-width: 0; }
.adm-insp .pic { position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-soft); background: #151515; padding: 0; cursor: pointer; }
.adm-insp .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.adm-insp.off .pic img { opacity: 0.35; }
.adm-insp .pic .badge { position: absolute; top: 6px; left: 6px; height: 18px; padding: 0 6px; font-size: 10px; background: var(--bg); }
.adm-insp .pic .num { position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: rgba(0,0,0,.6); color: #fff; }
.adm-insp .nm { font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-insp .ord { display: flex; gap: 6px; }
.adm-insp .ord .icon-btn { flex: 1; height: 30px; border: 1px solid var(--border-soft); border-radius: 10px; }
.adm-insp .ord .icon-btn:disabled { opacity: .3; }
.adm-qitem .pic.tall { aspect-ratio: 9 / 16; width: 40px; height: auto; background: #151515; }
.adm-qitem .pic.tall img { width: 100%; height: 100%; object-fit: cover; }
.adm-preview.tall { height: auto; padding: 12px 0; background: transparent; }
.adm-preview.tall img { aspect-ratio: 9 / 16; width: min(190px, 55%); max-width: none; max-height: none; object-fit: cover; border-radius: 14px; }

/* ---------- Grade de figurinhas ---------- */

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .sticker-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .sticker-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.sticker-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  animation: cardIn 0.4s var(--ease) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sticker-card .open {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22% 14% 14%;
}

.sticker-card .open img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
  transition: transform 0.35s var(--ease);
}

.sticker-card .open:active img {
  transform: scale(0.95);
}

.sticker-card .corner {
  position: absolute;
  top: 8px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1;
  transition: transform 0.2s var(--ease), color 0.2s;
}

.sticker-card .corner:active {
  transform: scale(0.88);
}

.sticker-card .corner.left {
  left: 8px;
}

.sticker-card .corner.right {
  right: 8px;
}

.sticker-card .corner.on {
  color: var(--text);
}

.heart-pop {
  animation: heartPop 0.42s var(--ease);
}

@keyframes heartPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.32);
  }
  100% {
    transform: scale(1);
  }
}

.skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

.checker {
  background-color: var(--checker-a);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.count-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 12px;
  font-size: 13px;
  color: var(--text-2);
}

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty .serif {
  display: block;
  font-size: 28px;
  color: var(--text);
  margin-bottom: 6px;
}

/* ---------- Barra inferior ---------- */

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 12px);
  width: min(calc(100% - 24px), 520px);
  height: var(--nav-h);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  z-index: 40;
  padding: 0 6px;
}

.nav-item {
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.01em;
  transition: color 0.25s;
  padding: 6px 0;
}

.nav-item[aria-current="page"] {
  color: var(--text);
}

.nav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.nav-create {
  justify-self: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--ease);
}

.nav-create:active {
  transform: scale(0.92);
}

.nav-create[aria-expanded="true"] svg {
  transform: rotate(45deg);
}

.nav-create svg {
  transition: transform 0.35s var(--ease);
}

/* ---------- Painel deslizante ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 60;
  animation: fadeIn 0.25s var(--ease) both;
  backdrop-filter: blur(2px);
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 10px 20px calc(var(--safe-b) + 24px);
  z-index: 61;
  animation: sheetUp 0.42s var(--ease) both;
}

.sheet.closing {
  animation: sheetDown 0.28s var(--ease) both;
}

.sheet-backdrop.closing {
  animation: fadeOut 0.28s var(--ease) both;
}

.sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  margin: 0 auto 14px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 600;
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

@keyframes sheetDown {
  to {
    transform: translateY(100%);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: left;
  margin-bottom: 10px;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}

.choice:active {
  transform: scale(0.98);
}

.choice .ico {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  flex-shrink: 0;
}

.choice strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.choice small {
  color: var(--text-2);
  font-size: 13px;
}

/* ---------- Ações da figurinha ---------- */

.preview-box {
  border-radius: var(--radius-lg);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 12%;
  border: 1px solid var(--border-soft);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.preview-box img,
.preview-box canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.action {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-weight: 500;
  font-size: 14px;
  transition: transform 0.2s var(--ease), background 0.2s;
}

.action:active {
  transform: scale(0.97);
}

.action:disabled {
  opacity: 0.45;
}

.action.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ---------- Editor de cor ---------- */

.swatches {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.swatch {
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid rgba(128, 128, 128, 0.35);
  transition: transform 0.2s var(--ease);
  position: relative;
}

.swatch[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1.5px solid var(--text);
}

.swatch:active {
  transform: scale(0.9);
}

.color-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-native {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 4px;
  background: var(--surface);
  flex-shrink: 0;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}

.segmented button {
  height: 34px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
}

.segmented button[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
}

.label-sm {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin: 18px 0 10px;
}

/* ---------- Lista de menu (Conta) ---------- */

.menu {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.2s;
}

.menu-item:last-child {
  border-bottom: 0;
}

.menu-item:active {
  background: var(--surface-2);
}

.menu-item .ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-2);
  flex-shrink: 0;
}

.menu-item .txt {
  flex: 1;
  min-width: 0;
}

.menu-item .txt small {
  display: block;
  color: var(--text-2);
  font-size: 12.5px;
}

.menu-item .tail {
  color: var(--text-3);
}

.switch {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--text-2);
  transition: transform 0.3s var(--ease), background 0.25s;
}

.switch[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
}

.switch[aria-checked="true"]::after {
  transform: translateX(18px);
  background: var(--accent-ink);
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-family: var(--font-serif), Georgia, serif;
  font-style: italic;
  color: var(--text);
  overflow: hidden;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--text-2);
}

.badge.on {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

/* ---------- Toast ---------- */

.toast-host {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-b) + 26px);
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(calc(100% - 32px), 440px);
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: var(--bg);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn 0.35s var(--ease) both;
  display: flex;
  gap: 10px;
  align-items: center;
  pointer-events: auto;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* ---------- Autenticação ---------- */

.auth {
  min-height: 100dvh;
  display: grid;
  align-items: center;
  padding: calc(var(--safe-t) + 32px) 22px calc(var(--safe-b) + 32px);
}

.auth-inner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  animation: pageIn 0.5s var(--ease) both;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.32em;
  font-size: 13px;
  margin-bottom: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-family: var(--font-serif), Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  font-size: 18px;
}

.auth h1 {
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0 0 10px;
}

.auth .lead {
  color: var(--text-2);
  margin: 0 0 28px;
}

.auth-foot {
  text-align: center;
  margin-top: 22px;
  color: var(--text-2);
  font-size: 14px;
}

.auth-foot a,
.link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
}

/* ---------- Tutoriais ---------- */

.tutorial-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  text-align: left;
  width: 100%;
  margin-bottom: 10px;
}

.tutorial-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text-2);
}

.tutorial-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tutorial-thumb .dur {
  position: absolute;
  right: 6px;
  bottom: 6px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 1px 6px;
  border-radius: 6px;
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-soft);
}

.video-frame iframe,
.video-frame video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 14px;
  height: 40px;
}

.prose {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}

.prose h2 {
  color: var(--text);
  font-size: 18px;
  margin: 28px 0 8px;
}

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

/* ---------- Específico da versão HTML ---------- */
[hidden] { display: none !important; }
#app:empty::before {
  content: "";
  position: fixed;
  inset: 0;
  margin: auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.setup { max-width: 560px; margin: 0 auto; padding: 48px 22px; }
.setup code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 13px; }

/* =====================================================================
   EDITOR (Stories e figurinhas)
   ===================================================================== */
.ed {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
  overscroll-behavior: none;
  z-index: 30;
}
.ed-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  flex-shrink: 0;
}
.ed-top .icon-btn { width: 40px; height: 40px; }
.ed-top .btn { height: 40px; padding: 0 16px; font-size: 14px; }
.ed-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  padding: 4px 12px;
  overflow: hidden;
}
.ed-stage canvas {
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--border-soft), 0 20px 50px rgba(0, 0, 0, 0.45);
  background: #111;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.ed[data-type="sticker"] .ed-stage canvas { background-color: var(--checker-a); }
.ed-checker {
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.ed-start {
  position: absolute;
  inset: 4px 12px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 24px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  z-index: 2;
}
.ed-start h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.ed-start .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ed-big {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  font-weight: 600;
  transition: transform 0.2s var(--ease);
}
.ed-big small { font-weight: 400; color: var(--text-2); font-size: 12.5px; margin-top: -6px; }
.ed-big.wide { grid-column: 1 / -1; }
.ed-big.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ed-big.primary small { color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }
.ed-big:active { transform: scale(0.97); }
.ed-drafts { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.ed-draft { border-radius: 10px; overflow: hidden; border: 1px solid var(--border-soft); background: var(--surface); aspect-ratio: 9 / 16; }
.ed[data-type="sticker"] .ed-draft { aspect-ratio: 1; }
.ed-draft img { width: 100%; height: 100%; object-fit: cover; }

.ed-panel {
  flex-shrink: 0;
  max-height: 42dvh;
  overflow-y: auto;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  padding: 12px 14px 4px;
}
.ed-panel:empty { display: none; }
.ed-rail {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 10px 10px;
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
}
.ed-rail::-webkit-scrollbar { display: none; }
.ed-tool {
  flex: 0 0 auto;
  min-width: 64px;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  color: var(--text-2);
}
.ed-tool[aria-pressed="true"] { color: var(--text); background: var(--surface-2); }
.ed-tool:disabled { opacity: 0.35; }

.ed-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.ed-tabs::-webkit-scrollbar { display: none; }
.ed-tabs button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.ed-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.ed-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ed-hscroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; margin-bottom: 8px; }
.ed-hscroll::-webkit-scrollbar { display: none; }
.ed-chip {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 17px;
  white-space: nowrap;
}
.ed-chip[aria-pressed="true"] { border-color: var(--text); background: var(--surface-3); }
.ed-chip.sm { height: 36px; font-size: 13px; padding: 0 12px; }
.ed-sw {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(128, 128, 128, 0.4);
  position: relative;
}
.ed-sw[aria-pressed="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 999px; border: 1.5px solid var(--text); }
.ed-sw.none { background: linear-gradient(135deg, transparent 45%, #e66 45%, #e66 55%, transparent 55%), var(--surface-2); }
.ed-color { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 999px; padding: 0; overflow: hidden; flex: 0 0 auto; background: none; }
.ed-color::-webkit-color-swatch-wrapper { padding: 0; }
.ed-color::-webkit-color-swatch { border: 0; border-radius: 999px; }
.ed-slider { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--text-2); }
.ed-slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.ed-slider input { width: 100%; accent-color: var(--accent); }
.ed-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 10px; }
.ed-actions button {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 2px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-2);
}
.ed-actions button.danger { color: var(--danger); }
.ed-actions button[aria-pressed="true"] { color: var(--text); background: var(--surface-3); }
.ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.ed-grid button {
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text);
  overflow: hidden;
}
.ed-grid button img { width: 80%; height: 80%; object-fit: contain; }
.ed-emoji { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.ed-emoji button { font-size: 28px; height: 48px; border-radius: 10px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.ed-emoji button:active { background: var(--surface-2); }
.ed-filters { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.ed-filters::-webkit-scrollbar { display: none; }
.ed-filter { flex: 0 0 auto; display: grid; gap: 6px; justify-items: center; font-size: 12px; color: var(--text-2); }
.ed-filter img, .ed-filter span.ph { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 2px solid transparent; background: var(--surface-2); }
.ed-filter[aria-pressed="true"] { color: var(--text); }
.ed-filter[aria-pressed="true"] img { border-color: var(--text); }
.ed-bgs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.ed-bgs button { flex: 0 0 auto; width: 44px; height: 64px; border-radius: 10px; border: 1px solid var(--border); }
.ed-bgs button[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.ed-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.ed-templates button { display: grid; gap: 6px; font-size: 12px; color: var(--text-2); text-align: center; }
.ed-templates img { width: 100%; aspect-ratio: 9 / 16; border-radius: 10px; border: 1px solid var(--border-soft); object-fit: cover; }
.ed-layers .menu-item { padding: 10px 12px; gap: 10px; }
.ed-layers .menu-item[aria-current="true"] { background: var(--surface-2); }
.ed-layers .mini { display: flex; gap: 2px; }
.ed-layers .mini button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--text-2); }
.ed-layers .mini button[aria-pressed="true"] { color: var(--text); background: var(--surface-3); }
.ed-final img { width: 100%; max-height: 46dvh; object-fit: contain; border-radius: 14px; border: 1px solid var(--border-soft); }
.ed-hint { font-size: 12.5px; color: var(--text-2); margin: 10px 2px 0; }
.ed-sticker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ed-sticker-grid button { aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; padding: 12%; }
.ed-sticker-grid img { width: 100%; height: 100%; object-fit: contain; }
@media (min-width: 900px) {
  .ed-panel { max-height: 34dvh; }
}
/* No editor, os avisos aparecem no topo para não cobrir as ferramentas */
body:has(.ed) .toast-host { bottom: auto; top: calc(var(--safe-t) + 62px); }
/* Área transparente da figurinha: xadrez claro fixo, para enxergar cores escuras e claras */
.ed[data-type="sticker"] .ed-stage canvas.ed-checker {
  background-color: #f3f1ec;
  background-image:
    linear-gradient(45deg, #e4e0d7 25%, transparent 25%),
    linear-gradient(-45deg, #e4e0d7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e4e0d7 75%),
    linear-gradient(-45deg, transparent 75%, #e4e0d7 75%);
}

/* =====================================================================
   TOPO (logo + notificações)
   ===================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: calc(60px + var(--safe-t));
  padding: var(--safe-t) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.app-header + #page .page { padding-top: 22px; }
.hdr-side.right { display: flex; justify-content: flex-end; }
.logo { display: inline-flex; align-items: baseline; color: var(--text); line-height: 1; white-space: nowrap; }
.logo-story { font-family: var(--font-sans), system-ui, sans-serif; font-weight: 700; font-size: 25px; letter-spacing: -0.045em; }
.logo-boss { font-family: var(--font-serif), Georgia, serif; font-style: italic; font-size: 29px; letter-spacing: -0.01em; margin-left: 4px; }
.logo-r { font-family: var(--font-sans), system-ui, sans-serif; font-weight: 700; font-size: 11px; align-self: flex-start; margin: 1px 0 0 1px; }
.brand.logo { margin-bottom: 44px; letter-spacing: 0; gap: 0; align-items: baseline; }
.brand.logo .logo-story { font-size: 30px; }
.brand.logo .logo-boss { font-size: 35px; }
.brand.logo .logo-r { font-size: 12px; }
.bell { position: relative; width: 44px; height: 44px; display: grid; place-items: center; color: var(--text); border-radius: 999px; }
.bell:active { background: var(--surface-2); }
.bell-count {
  position: absolute;
  top: 5px;
  right: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg);
}

/* Central de notificações */
.notif-list { display: grid; gap: 8px; }
.notif {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  position: relative;
}
.notif.unread { border-color: var(--border); background: var(--surface-3); }
.notif-ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--text-2); flex-shrink: 0; }
.notif-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.notif-txt strong { font-weight: 600; line-height: 1.3; }
.notif-txt span { color: var(--text-2); font-size: 14px; }
.notif-txt small { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.notif-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); margin-top: 6px; flex-shrink: 0; }

/* Painel administrativo (notificações) */
.adm-card { border: 1px solid var(--border-soft); background: var(--surface); border-radius: var(--radius-lg); padding: 18px; }
.adm-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.adm-row:last-child { border-bottom: 0; }
.adm-row .meta { color: var(--text-3); font-size: 12px; }
.adm-actions { display: flex; gap: 6px; flex-shrink: 0; }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.badge.warn { color: #e8c37a; border-color: color-mix(in srgb, #e8c37a 40%, transparent); }

/* Câmera do editor */
.cam { position: fixed; inset: 0; z-index: 90; background: #000; display: grid; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam video.mirror { transform: scaleX(-1); }
.cam.flash::after { content: ""; position: absolute; inset: 0; z-index: 3; background: #fff; pointer-events: none; animation: fadeOut .35s ease forwards; }
.cam-top, .cam-bottom { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding-inline: max(18px, env(safe-area-inset-left, 0px)) max(18px, env(safe-area-inset-right, 0px)); }
.cam-top { top: calc(env(safe-area-inset-top, 0px) + 14px); }
.cam-bottom { bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); }
.cam-btn { width: 48px; height: 48px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cam-btn.ghost { background: none; }
.cam-shutter { width: 78px; height: 78px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 5px rgba(255,255,255,.35); transition: transform .15s; }
.cam-shutter:active { transform: scale(.92); }
.cam-shutter:disabled { opacity: .4; }
.cam-msg { position: absolute; inset: 0; display: grid; place-content: center; gap: 16px; padding: 32px; text-align: center; color: #F5F4F0; z-index: 1; }
.cam-msg p { margin: 0; color: #cfcfcf; max-width: 320px; }
.ed-fonts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding-bottom: 6px; }
@media (min-width: 640px) { .ed-fonts { grid-template-columns: repeat(3, 1fr); } }
.ed-font { height: 52px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
.ed-font[aria-pressed="true"] { border-color: var(--text); background: var(--surface-3); }
.ed-final-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ed-final-actions .ed-big { min-height: 112px; }
.ed-final-actions .ed-big:disabled { opacity: .45; }

/* Assinatura (Conta) */
.plan-card { border: 1px solid var(--border-soft); background: var(--surface); border-radius: var(--radius-lg); padding: 16px 18px; margin: -6px 0 22px; }
.plan-name { font-family: var(--font-serif), Georgia, serif; font-style: italic; font-weight: 400; font-size: 28px; letter-spacing: -0.01em; }
.plan-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: 14px; }
.plan-meta small { display: block; color: var(--text-3); font-size: 12px; margin-bottom: 2px; }

/* =====================================================================
   TEXTO NO ESTILO DOS STORIES
   ===================================================================== */
.txo { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); color: #fff; animation: fadeIn .2s ease both; }
.txo-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 12px) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)); }
.txo-btn { width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-size: 18px; border: 1.5px solid rgba(255,255,255,.0); }
.txo-btn[aria-pressed="true"] { background: #fff; color: #111; }
.txo-a { display: grid; place-items: center; width: 24px; height: 24px; border: 1.8px solid currentColor; border-radius: 6px; font-weight: 700; font-size: 14px; }
.txo-done { color: #fff; font-weight: 700; font-size: 16px; padding: 8px 4px; }
.txo-size { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); height: 220px; width: 36px; display: grid; place-items: center; }
.txo-size input { width: 200px; transform: rotate(-90deg); accent-color: #fff; }
.txo-center { position: absolute; left: 48px; right: 48px; top: calc(env(safe-area-inset-top, 0px) + 70px); bottom: calc(var(--kb, 0px) + 170px); display: grid; place-items: center; }
.txo-input { width: 100%; max-height: 100%; background: transparent; border: 0; outline: none; resize: none; overflow: hidden; line-height: 1.15; border-radius: .3em; caret-color: #fff; }
.txo-input::placeholder { color: rgba(255,255,255,.5); }
.txo-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 0 calc(env(safe-area-inset-bottom, 0px) + 10px); display: grid; gap: 8px; transition: bottom .15s ease; }
.txo-colors, .txo-groups, .txo-fonts { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 14px; }
.txo-colors::-webkit-scrollbar, .txo-groups::-webkit-scrollbar, .txo-fonts::-webkit-scrollbar { display: none; }
.txo-dot { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 999px; border: 2.5px solid #fff; padding: 0; }
.txo-dot[aria-pressed="true"] { transform: scale(1.18); box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.txo-custom { background: conic-gradient(#e66, #f2c94c, #9bb89a, #3b6fd9, #b9a6de, #e66); overflow: hidden; }
.txo-custom::-webkit-color-swatch-wrapper { padding: 0; }
.txo-custom::-webkit-color-swatch { border: 0; opacity: 0; }
.txo-groups button { flex: 0 0 auto; font-size: 12px; color: rgba(255,255,255,.7); padding: 4px 2px; }
.txo-groups button[aria-pressed="true"] { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 5px; }
.txo-fonts button { flex: 0 0 auto; height: 38px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; font-size: 17px; white-space: nowrap; }
.txo-fonts button[aria-pressed="true"] { background: #fff; color: #111; }

/* =====================================================================
   EDITOR DE STORIES — layout no estilo do Instagram
   ===================================================================== */
.ig { background: #000; padding: 0; }
.ig .ig-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: calc(var(--safe-t) + 6px) 8px 8px; }
.ig-frame { position: relative; border-radius: 16px; overflow: hidden; }
.ig-frame canvas { display: block; border-radius: 16px; touch-action: none; user-select: none; -webkit-user-select: none; background: #111; }
.ig-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 8px; align-items: center; pointer-events: none; z-index: 3; }
.ig-top > * { pointer-events: auto; }
.ig-round { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ig-round:disabled { opacity: .35; }
.ig-tools { position: absolute; top: 60px; right: 10px; display: grid; gap: 10px; z-index: 3; }
.ig-tool { width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .15s; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.ig-tool:active { transform: scale(.9); }
.ig-tool[aria-pressed="true"] { background: #fff; color: #111; }
.ig-aa { font-family: var(--font-sans), system-ui, sans-serif; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.ig-trash { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: 56px; height: 56px; border-radius: 999px; display: grid; place-items: center; color: #fff; border: 2px solid rgba(255,255,255,.85); background: rgba(0,0,0,.35); z-index: 3; transition: transform .15s, background .15s; pointer-events: none; }
.ig-trash.hot { transform: translateX(-50%) scale(1.25); background: #e5484d; border-color: #e5484d; }
.ig .ed-start { inset: 0; border-radius: 16px; background: rgba(0,0,0,.55); z-index: 4; }
.ig .ed-start h2 { color: #fff; }
.ig-panel { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 68px); max-height: 40dvh; overflow-y: auto; z-index: 5; margin: 0 auto; max-width: 560px; background: color-mix(in srgb, #151515 94%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 22px 22px 0 0; border-top: 1px solid #262626; padding: 14px 14px 6px; color: #F5F4F0; animation: sheetUp .3s var(--ease) both; }
.ig-panel:empty { display: none; }
.ig-bottom { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 6px 12px calc(var(--safe-b) + 10px); background: #000; }
.ig-pill { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 999px; background: #1f1f1f; color: #fff; font-size: 14px; font-weight: 600; }
.ig-post { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px; background: #fff; color: #111; font-weight: 700; font-size: 15px; white-space: nowrap; }
.ig-post:active, .ig-pill:active { transform: scale(.97); }
@media (max-width: 460px) {
  .ig-pill { width: 44px; padding: 0; justify-content: center; }
  .ig-pill span { display: none; }
}
.ig-post { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* =====================================================================
   CRIADOR DE FIGURINHAS (página)
   ===================================================================== */
.st-title { font-size: clamp(38px, 11vw, 54px); }
.st-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.st-toolbar .btn { height: 46px; padding: 0 18px; font-size: 15px; font-weight: 500; }
.st-import { display: grid; gap: 8px; margin-bottom: 16px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.st-file { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.st-file small { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-stage { position: relative; width: 100%; aspect-ratio: 1; max-width: 100%; border-radius: 6px; overflow: hidden; }
.st-stage canvas { display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.st-stage canvas.ed-checker {
  background-color: #f3f1ec;
  background-image:
    linear-gradient(45deg, #c9c6bf 25%, transparent 25%),
    linear-gradient(-45deg, #c9c6bf 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c9c6bf 75%),
    linear-gradient(-45deg, transparent 75%, #c9c6bf 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.st-hint { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; text-align: center; font-size: 13px; color: #6f6c66; pointer-events: none; }
.st-panel { margin-top: 14px; border: 1px solid var(--border-soft); background: var(--surface); border-radius: var(--radius-lg); padding: 14px 14px 4px; }
.st-panel:empty { display: none; }
.st-page [data-act][aria-pressed="true"] { border-color: var(--text); background: var(--surface-3); }
.st-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.st-actions .btn { height: 48px; }
.st-page .ed-draft { aspect-ratio: 1; }
/* O editor de Stories é sempre escuro, como o do Instagram */
.ig {
  color-scheme: dark;
  --bg: #050505; --surface: #151515; --surface-2: #1d1d1d; --surface-3: #262626;
  --border: #393939; --border-soft: #262626; --text: #f5f4f0; --text-2: #a3a3a3; --text-3: #6f6f6f;
  --accent: #eae7de; --accent-ink: #0a0a0a; --overlay: rgba(0,0,0,.62);
  color: var(--text);
}

/* Frase da tela Início */
.home-lead { color: var(--text-2); font-size: 17px; margin: 14px 0 0; letter-spacing: 0.005em; }

/* ---------- Pincel de texto / recorte / localização ---------- */
.ig.brushing .ig-tools { opacity: 0; pointer-events: none; }
.ig.brushing .ig-stage, .ig.cutting .ig-stage { cursor: crosshair; touch-action: none; }
.ed-loc-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; margin: 2px 0 14px; border-radius: 10px; border: 0;
  background: #fff; color: #C13584; font: 800 13px/1 "Instrument Sans", system-ui, sans-serif; letter-spacing: .02em;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.ed-loc-btn svg { color: #C13584; }
.ed-sw { flex: none; }
/* barra de ferramentas rola quando não cabe (11 ferramentas), e nunca fica atrás do painel */
.ig-tools { gap: 8px; max-height: calc(100% - 60px - var(--safe-b) - 84px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 2px; margin: -2px; }
.ig-tools::-webkit-scrollbar { display: none; }
.ig:has(.ig-panel:not(:empty)) .ig-tools { max-height: calc(100% - 60px - var(--safe-b) - 68px - var(--panel-h, 40dvh) - 12px); }
/* caixa para colar figurinha (quando o navegador não deixa ler a área de transferência) */
.ed-pastebox { min-height: 150px; border: 1.5px dashed var(--border); border-radius: var(--radius-lg); background: var(--surface-2); display: grid; place-items: center; color: transparent; caret-color: transparent; outline: none; -webkit-user-select: text; user-select: text; }
.ed-pastebox:focus { border-color: var(--accent); }
.ed-pastebox:empty::before { content: "Toque e segure aqui"; color: var(--text-2); font-size: 15px; }
/* prévia da figurinha como imagem real: tocar e segurar → Copiar / Salvar */
.preview-box img.sticker-real { -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; pointer-events: auto; }

/* ---------- Story sempre inteiro à vista enquanto edita ----------
   Com uma ferramenta aberta, o painel deixa de cobrir a imagem: ele ocupa a parte
   de baixo da tela e o Story encolhe para caber inteiro acima dele (como no Instagram). */
.ig .ig-panel { position: relative; left: auto; right: auto; bottom: auto; flex-shrink: 0; width: 100%; max-width: none; max-height: 44dvh; margin: 0; border-radius: 20px 20px 0 0; padding-bottom: calc(var(--safe-b) + 10px); }
.ig.panel-open .ig-bottom { display: none; }
.ig.panel-open .ig-tools { display: none; }
.ig.panel-open .ig-stage { padding-bottom: 10px; }
.ig .ig-frame, .ig .ig-frame canvas { transition: none; }
.ig-done { display: none; height: 40px; padding: 0 16px; border-radius: 999px; background: #fff; color: #111; font-weight: 700; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.ig.panel-open .ig-done { display: inline-flex; align-items: center; }
.ig.brushing .ig-done, .ig.cutting .ig-done { display: none; }
/* botão ocupado enquanto o compartilhar abre */
.ig-post.is-busy, .ig-pill.is-busy { opacity: .6; pointer-events: none; }
@media (min-width: 700px) { .ig .ig-panel { max-width: 560px; margin: 0 auto; } }

/* =====================================================================
   Navegação de aplicativo, carregamento e gestos
   ===================================================================== */
/* Toque: resposta imediata, sem atraso de duplo toque nem seleção acidental */
a, button, [role="tab"], .menu-item, .theme-card, .sticker-card { touch-action: manipulation; }
.bottom-nav, .app-header, .tabs, .btn, .icon-btn, .menu-item, .theme-card, .action, .choice { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.nav-item:active { transform: scale(.94); }
.nav-item { transition: transform .12s ease, color .2s; }
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; } /* sem "pulo" da página no app instalado */
}

/* Troca de tela */
.view-enter { animation: viewIn .26s var(--ease) both; }
.view-show { animation: viewFade .16s ease-out both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes viewFade { from { opacity: .4; } to { opacity: 1; } }
#page { will-change: auto; }

/* Barra de carregamento no topo */
.route-progress {
  position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 300; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  opacity: 0; transition: opacity .2s;
}
.route-progress.on { opacity: 1; animation: progressRun 1s linear infinite; }
@keyframes progressRun { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* Grade com milhares de figurinhas: o navegador só desenha o que está na tela */
.sticker-card { content-visibility: auto; contain-intrinsic-size: auto 180px; }
.sticker-card img { aspect-ratio: 1; }

/* Puxar para atualizar */
.ptr {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 4px); z-index: 250;
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transform: translate(-50%, -60px); opacity: 0; transition: transform .25s var(--ease), opacity .2s; pointer-events: none;
}
.ptr-spin { width: 16px; height: 16px; border-radius: 999px; border: 2px solid var(--text-3); border-top-color: var(--text); }
.ptr.ready .ptr-spin { border-color: var(--accent); border-top-color: var(--text); }
.ptr.loading .ptr-spin { animation: spin .7s linear infinite; }

/* Deslizar da borda para voltar */
.edge-back {
  position: fixed; left: 8px; top: 50%; z-index: 250; width: 38px; height: 38px; border-radius: 999px;
  display: grid; place-items: center; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  transform: translateY(-50%); opacity: 0; pointer-events: none; transition: opacity .15s, background .15s;
}
.edge-back.ready { background: var(--text); color: var(--bg); }

/* Sem internet */
.offline-bar {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 70px); z-index: 260;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow); white-space: nowrap;
}

/* Avisos com ação (ex.: Desfazer) */
.toast-action { margin-left: auto; background: none; border: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px; cursor: pointer; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }

/* Telas grandes: mais conteúdo por linha */
@media (min-width: 1100px) {
  .sticker-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .view-enter, .view-show, .route-progress.on { animation: none; }
}
.sk-line { display: inline-block; width: 140px; height: 20px; border-radius: 8px; }
.theme-card.skeleton { pointer-events: none; }
/* cor personalizada no Desenhar */
.ed-sw-custom { -webkit-appearance: none; appearance: none; padding: 0; border: 0; width: 34px; height: 34px; flex: none; border-radius: 999px; overflow: hidden; cursor: pointer;
  background: conic-gradient(#ff5d5d, #ffd25d, #7dff6b, #5de3ff, #6b7dff, #e05dff, #ff5d5d); }
.ed-sw-custom::-webkit-color-swatch-wrapper { padding: 0; }
.ed-sw-custom::-webkit-color-swatch { border: 0; border-radius: 999px; opacity: 0; }
.ed-sw-custom::-moz-color-swatch { border: 0; opacity: 0; }
/* avisos não bloqueiam toques no que está embaixo (ex.: desenhar no Story); só o botão do aviso é tocável */
.toast { pointer-events: none; }
.toast-action { pointer-events: auto; }

/* =====================================================================
   Planner
   ===================================================================== */
.pl-cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 12px 12px; }
.pl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pl-month { flex: 1; text-align: center; margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.pl-today { display: block; margin: 0 auto 8px; border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; }
.pl-today[hidden] { display: none; }
.pl-week, .pl-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pl-week span { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 4px 0 6px; }
.pl-cell {
  position: relative; aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--text);
  font: inherit; font-size: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer;
  transition: background .15s, transform .1s;
}
.pl-cell:active { transform: scale(.94); }
.pl-cell.out { color: var(--text-3); }
.pl-cell.today > span:first-child { color: var(--accent-ink); background: var(--accent); width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; }
.pl-cell.sel { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.pl-cell.loading { opacity: .5; }
.pl-dots { display: flex; gap: 3px; height: 6px; align-items: center; }
.pl-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); display: block; }
.pl-dot.afazer { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.pl-dot.done { opacity: .35; }
.pl-more { font-style: normal; font-size: 9px; line-height: 1; color: var(--text-2); }
.pl-day .section-head { align-items: center; }
.pl-empty { padding: 26px 10px; }
.pl-list { display: grid; gap: 10px; }
.pl-item { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; }
.pl-item.compromisso { border-left: 3px solid var(--accent); }
.pl-time { flex: none; min-width: 52px; font-weight: 700; font-size: 14px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.pl-check { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 8px; border: 1.5px solid var(--border); background: transparent; color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; }
.pl-check[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.pl-body { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; display: grid; gap: 3px; }
.pl-body strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.pl-body small { color: var(--text-2); font-size: 12.5px; }
.pl-notes { color: var(--text-2); font-size: 13.5px; white-space: pre-line; overflow-wrap: anywhere; }
.pl-item.done .pl-body strong { text-decoration: line-through; color: var(--text-3); }
.pl-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.pl-form .tabs .tab { flex: none; }
@media (min-width: 900px) { .pl-cell { aspect-ratio: auto; height: 64px; } }

/* =====================================================================
   Painel de administração
   ===================================================================== */
.adm-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.adm-stat { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 16px; padding: 14px; display: grid; gap: 4px; }
.adm-stat strong { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.adm-stat span { color: var(--text-2); font-size: 13px; }
@media (min-width: 700px) { .adm-stats { grid-template-columns: repeat(4, 1fr); } }
.menu-item.muted { opacity: .55; }
.adm-members { padding: 4px 14px; }
.adm-member { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--border-soft); color: inherit; font: inherit; text-align: left; cursor: pointer; justify-content: flex-start; }
.adm-member:active { background: var(--surface-2); }
.adm-avatar { flex: none; width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; }
.adm-mtxt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.adm-mtxt strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-mtxt small { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-member .badge { flex: none; }
.badge.bad { color: #f0a0a0; border-color: color-mix(in srgb, #f0a0a0 40%, transparent); }
.adm-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.adm-facts > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; min-width: 0; }
.adm-facts span { color: var(--text-3); font-size: 12px; }
.adm-facts strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.adm-actions { display: grid; gap: 10px; }
.adm-danger { color: #f0a0a0; }
.adm-danger-btn { background: #c0392b !important; color: #fff !important; border-color: #c0392b !important; }
.adm-cred { white-space: pre-wrap; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 14px; margin: 0 0 14px; user-select: all; -webkit-user-select: all; }

/* ---------- Painel: figurinhas ---------- */
.adm-drop { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 22px 16px; margin: 16px 0 14px; border: 1.5px dashed var(--border); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; transition: border-color .2s, background .2s; }
.adm-drop:active, .adm-drop.over { border-color: var(--accent); background: var(--surface-2); }
.adm-drop .ico { width: 46px; height: 46px; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink, #000); }
.adm-drop strong { font-size: 16px; }
.adm-drop small { color: var(--text-2); font-size: 12.5px; max-width: 34ch; }
.adm-toolbar { display: flex; gap: 10px; align-items: center; }
.adm-toolbar select { flex: 1; min-width: 0; height: 44px; }
.adm-toolbar .btn { flex: none; height: 44px; }
.adm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 640px) { .adm-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .adm-grid { grid-template-columns: repeat(6, 1fr); } }
.adm-skel { aspect-ratio: 0.8; border-radius: 14px; display: block; }
.adm-sticker { position: relative; display: grid; gap: 3px; padding: 8px 8px 9px; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; transition: border-color .15s, transform .15s; }
.adm-sticker:active { transform: scale(.97); }
.adm-sticker .pic { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: repeating-conic-gradient(var(--surface-2) 0 25%, transparent 0 50%) 0 0 / 14px 14px; overflow: hidden; }
.adm-sticker .pic img { width: 86%; height: 86%; object-fit: contain; }
.adm-sticker .pic .skeleton { width: 100%; height: 100%; }
.adm-sticker .badge { position: absolute; top: 12px; left: 12px; height: 20px; padding: 0 7px; font-size: 10.5px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.adm-sticker .name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-sticker .where { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-sticker .tick { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; border: 1.5px solid var(--text-2); background: color-mix(in srgb, var(--bg) 60%, transparent); color: transparent; }
.adm-sticker.sel { border-color: var(--accent); }
.adm-sticker.sel .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #000); }
.adm-bulk { position: sticky; bottom: calc(var(--nav-h, 74px) + env(safe-area-inset-bottom) + 10px); z-index: 5; margin-top: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 10px; border-radius: 18px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.adm-bulk > span { flex: 1 1 100%; font-size: 13px; color: var(--text-2); padding: 0 4px 2px; }
.adm-bulk .btn { flex: 1; height: 40px; padding: 0 8px; font-size: 13.5px; }
.adm-queue { display: grid; gap: 8px; margin-bottom: 16px; max-height: 38vh; overflow-y: auto; }
.adm-qitem { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 12px; background: var(--surface-2); }
.adm-qitem .pic { flex: none; width: 52px; height: 52px; border-radius: 9px; display: grid; place-items: center; background: repeating-conic-gradient(var(--surface) 0 25%, transparent 0 50%) 0 0 / 10px 10px; overflow: hidden; }
.adm-qitem .pic img { width: 88%; height: 88%; object-fit: contain; }
.adm-qitem .pic .skeleton { width: 100%; height: 100%; }
.adm-qitem .txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.adm-qitem .input { height: 38px; font-size: 16px; padding: 0 10px; }
.adm-qitem small { font-size: 11.5px; color: var(--text-3); min-height: 14px; }
.adm-qitem.invalid small, .adm-qitem.failed small { color: #f0a0a0; }
.adm-qitem.dup small { color: #e8c37a; }
.adm-qitem.invalid, .adm-qitem.dup { opacity: .7; }
.adm-qitem .ok { color: var(--success); flex: none; width: 36px; display: grid; place-items: center; }
.adm-qitem .spin { flex: none; width: 18px; height: 18px; margin: 0 9px; border-radius: 999px; border: 2px solid var(--border); border-top-color: var(--accent); animation: admSpin .8s linear infinite; }
@keyframes admSpin { to { transform: rotate(360deg); } }
.adm-progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 0 0 12px; }
.adm-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s var(--ease); }
.adm-preview { display: grid; place-items: center; height: 180px; border-radius: 16px; margin-bottom: 10px; background: repeating-conic-gradient(var(--surface-2) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.adm-preview img { max-width: 70%; max-height: 160px; object-fit: contain; }
.adm-colors { display: grid; gap: 8px; margin-bottom: 14px; }
.adm-colors .choice { text-align: left; }
.adm-colors .choice[aria-pressed="true"] { border-color: var(--accent); }
.adm-colors .choice { display: grid; gap: 2px; margin: 0; padding: 12px 14px; }
.adm-colors .choice strong { font-size: 15px; }

/* ---------- Rascunhos: arrastar para a lixeira ---------- */
.ed-draft { touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; transition: opacity .2s, transform .2s; }
.ed-draft img { pointer-events: none; -webkit-user-drag: none; }
.ed-draft.draft-lifted { opacity: .25; transform: scale(.94); }
.draft-ghost { position: fixed; z-index: 3000; margin: 0; pointer-events: none; transform: scale(1.06); box-shadow: 0 18px 40px rgba(0,0,0,.5); border-color: var(--accent); transition: transform .18s var(--ease), opacity .2s; }
.draft-ghost.doomed { transform: scale(.7); opacity: .75; }
.draft-ghost.back { transition: left .2s var(--ease), top .2s var(--ease), transform .2s; transform: none; }
.draft-ghost.gone { transform: scale(.2); opacity: 0; }
html.draft-dragging, html.draft-dragging body { overscroll-behavior: none; cursor: grabbing; }
.draft-trash { position: fixed; z-index: 2999; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 112px); transform: translate(-50%, 60px); display: grid; justify-items: center; gap: 8px; pointer-events: none; opacity: 0; transition: transform .25s var(--ease), opacity .2s; color: #fff; }
.draft-trash svg { width: 60px; height: 60px; padding: 17px; box-sizing: border-box; border-radius: 999px; background: rgba(20,20,20,.75); border: 1.5px solid rgba(255,255,255,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .18s var(--ease), background .18s; }
.draft-trash span { font-size: 12.5px; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.draft-trash.show { transform: translate(-50%, 0); opacity: 1; }
.draft-trash.hot svg { transform: scale(1.22); background: #e0443a; border-color: #e0443a; }
/* Balão de conversa (Elementos) */
.ed-chat-btn { position: relative; display: inline-flex; align-items: center; padding: 8px 16px; margin: 2px 10px 14px 0; border: 0; border-radius: 999px; background: #C9B9C6; color: #2B2B2B; font: 500 15px/1 "Instrument Sans", system-ui, sans-serif; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.ed-chat-btn::after { content: ""; position: absolute; right: -7px; top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-left: 9px solid #C9B9C6; border-right: 0; }
.ed-chatchip i { display: inline-block; width: 12px; height: 12px; border-radius: 999px; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
textarea.input[data-chattext] { height: auto; min-height: 64px; padding: 12px 14px; resize: none; line-height: 1.35; }

/* ---------- Painel: temas e capas ---------- */
.adm-themes { display: grid; gap: 10px; }
.adm-theme { display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 16px; border: 1px solid var(--border-soft); background: var(--surface); }
.adm-theme.sm { padding: 6px; border-radius: 14px; background: var(--surface-2); }
.adm-theme-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.adm-theme-main .badge { flex: none; }
.adm-theme .cov { flex: none; width: 52px; height: 65px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; color: var(--text-2); }
.adm-theme.sm .cov { width: 40px; height: 50px; background: var(--surface); }
.adm-theme .cov img { width: 100%; height: 100%; object-fit: cover; }
.adm-order { display: grid; gap: 2px; flex: none; }
.adm-order .icon-btn { width: 32px; height: 28px; border-radius: 8px; }
.adm-order .icon-btn:disabled { opacity: .25; }
.adm-cover { position: relative; display: grid; place-items: center; width: 150px; aspect-ratio: 4 / 5; margin: 0 auto 14px; border-radius: 18px; overflow: hidden; border: 1.5px dashed var(--border); background: var(--surface-2); color: var(--text-2); font: inherit; cursor: pointer; }
.adm-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.adm-cover > span { display: grid; justify-items: center; gap: 6px; font-size: 13px; }
.adm-cover em { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 5px; align-items: center; justify-content: center; padding: 6px; border-radius: 999px; font-style: normal; font-size: 12px; font-weight: 600; color: #fff; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.adm-cover.busy { opacity: .5; pointer-events: none; }
.adm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm-two .btn { padding: 0 10px; font-size: 14px; }
.adm-subs { display: grid; gap: 8px; }

/* ---------- Painel: fontes ---------- */
.adm-fonts { padding: 4px 14px; }
.adm-font { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.adm-font:last-child { border-bottom: 0; }
.adm-font .txt { flex: 1; min-width: 0; display: grid; gap: 4px; }
.adm-font .pv { font-size: 24px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .55; transition: opacity .3s; }
.adm-font .pv.on { opacity: 1; }
.adm-font small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-font .switch { flex: none; }
.adm-fontpv { font-size: 30px; line-height: 1.25; text-align: center; padding: 18px 10px; margin: 0 0 14px; border-radius: 14px; background: var(--surface-2); overflow-wrap: anywhere; }

/* ---------- Painel: relatórios ---------- */
.adm-kpis .adm-stat { gap: 3px; align-content: start; }
.adm-kpis .adm-stat > span { display: flex; gap: 6px; align-items: center; color: var(--text-2); font-size: 12.5px; }
.adm-kpis .adm-stat strong { font-size: 28px; margin-top: 2px; }
.adm-kpis .adm-stat em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--text-3); }
.adm-kpis .adm-stat em.up { color: var(--success); }
.adm-kpis .adm-stat em.down { color: #f0a0a0; }
.adm-kpis .adm-stat small { color: var(--text-3); font-size: 11.5px; }
.adm-card .h3 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.adm-bars { display: flex; align-items: flex-end; gap: 2px; height: 130px; margin-top: 12px; padding-bottom: 18px; }
.adm-bars .b { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.adm-bars .b i { display: block; width: 100%; border-radius: 4px 4px 1px 1px; background: var(--accent); opacity: .85; }
.adm-bars .b small { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px; font-size: 9.5px; color: var(--text-3); white-space: nowrap; }
.adm-ranks { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 760px) { .adm-ranks { grid-template-columns: 1fr 1fr; } }
.adm-rank ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.adm-rank li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.adm-rank li:last-child { border-bottom: 0; }
.adm-rank .pos { flex: none; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.adm-rank .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-rank.warn .pos { background: color-mix(in srgb, #e8c37a 25%, transparent); color: #e8c37a; }
.adm-topstk { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.adm-topstk > div { display: grid; gap: 3px; min-width: 0; }
.adm-topstk .pic { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.adm-topstk img { width: 84%; height: 84%; object-fit: contain; }
.adm-topstk small { font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-topstk strong { font-size: 13px; }
.prose .prose-sec { font-size: 22px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border-soft); } .prose .prose-sec:first-child { margin-top: 8px; padding-top: 0; border-top: 0; }
.adm-theme .cov.wide { width: 74px; height: 48px; }
.adm-cover.wide { width: 100%; max-width: 260px; aspect-ratio: 16 / 9; margin: 0 0 14px; }
textarea.adm-long { height: auto; min-height: 180px; padding: 12px 14px; line-height: 1.45; resize: vertical; font-size: 14.5px; }
.adm-savebar { position: sticky; bottom: calc(var(--nav-h, 72px) + env(safe-area-inset-bottom) + 10px); margin-top: 16px; z-index: 4; }
.adm-card .h3 svg { vertical-align: -3px; margin-right: 4px; }

/* =====================================================================
   Área de administração (layout próprio: cabeçalho + abas no topo)
   ===================================================================== */
.admin-app { min-height: 100dvh; }
.adm-top {
  position: sticky; top: 0; z-index: 36;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: calc(64px + var(--safe-t)); padding: var(--safe-t) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.adm-brand { display: inline-flex; align-items: baseline; gap: 10px; color: var(--text); min-width: 0; }
.adm-brand .logo-story { font-size: 22px; } .adm-brand .logo-boss { font-size: 26px; }
.adm-brand > span:last-child { font-size: 12.5px; color: var(--text-3); letter-spacing: .02em; white-space: nowrap; }
.adm-open { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); font-size: 14px; font-weight: 600; color: var(--text); background: var(--surface); }
.adm-open:active { transform: scale(.97); }
.adm-tabs {
  position: sticky; top: calc(64px + var(--safe-t)); z-index: 35;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  padding: 8px max(12px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-soft); border-top: 1px solid var(--border-soft);
}
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs a { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px; color: var(--text-2); font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s; }
.adm-tabs a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 650; }
.adm-tabs a:active { transform: scale(.97); }
.admin-app .page { max-width: 1120px; padding: 24px 18px 80px; }
/* nas telas do painel, as abas substituem o "voltar" e o rótulo "Administração" */
.admin-app .page > .back, .admin-app .page > .eyebrow { display: none; }
.admin-app .page > h1.display { font-size: clamp(30px, 8vw, 42px) !important; }
.admin-app .adm-bulk, .admin-app .adm-savebar { bottom: calc(env(safe-area-inset-bottom) + 14px); }
@media (min-width: 900px) {
  .adm-tabs { justify-content: safe center; gap: 2px; }
  .adm-tabs a { padding: 0 11px; font-size: 14px; gap: 7px; }
  .admin-app .page { padding: 32px 28px 80px; }
}

/* Visão geral */
.adm-h1 { margin: 0; }
.adm-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.adm-filters .field { margin: 0; }
.adm-filters select { height: 48px; }
@media (min-width: 700px) { .adm-filters { grid-template-columns: repeat(3, 1fr); } }
.adm-kgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 900px) { .adm-kgrid { grid-template-columns: repeat(4, 1fr); } }
.adm-kpi { display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: 18px; border: 1px solid var(--border-soft); background: var(--surface); color: inherit; min-width: 0; }
a.adm-kpi:active { transform: scale(.98); }
.adm-kpi .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); margin-bottom: 6px; }
.adm-kpi .lb { color: var(--text-2); font-size: 13.5px; }
.adm-kpi strong { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.adm-kpi small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-two-col { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 900px) { .adm-two-col { grid-template-columns: 1fr 1fr; } }
.adm-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.adm-sec-head .h3 { margin: 0; }
.adm-list { list-style: none; margin: 0; padding: 0; }
.adm-list li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); min-width: 0; }
.adm-list li:last-child { border-bottom: 0; }
.adm-list li.tap { cursor: pointer; }
.adm-list li.tap:active { opacity: .7; }
.adm-list .badge { flex: none; }
.adm-avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.adm-sale { display: grid; justify-items: end; gap: 3px; flex: none; }
.adm-sale small { font-size: 12px; color: var(--text-2); }
.adm-alert { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: inherit; }
.adm-alert > span { flex: 1; display: grid; gap: 2px; font-size: 13px; color: var(--text-2); }
.adm-alert strong { color: var(--text); font-size: 14.5px; }
.adm-alert.bad { border-color: color-mix(in srgb, #f0a0a0 45%, transparent); background: color-mix(in srgb, #f0a0a0 8%, var(--surface)); }

/* Integrações */
.adm-platforms { display: grid; gap: 10px; }
@media (min-width: 900px) { .adm-platforms { grid-template-columns: repeat(3, 1fr); } }
.adm-platform { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1px solid var(--border-soft); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.adm-platform:active { transform: scale(.98); }
.adm-platform .logo { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 19px; }
.adm-platform .badge { flex: none; }
.adm-steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.adm-steps strong { color: var(--text); }
.adm-steps code, .adm-rules code { font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 6px; }
.adm-copy { display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.adm-copy code { flex: 1; min-width: 0; font-size: 12.5px; overflow-wrap: anywhere; line-height: 1.35; }
.adm-copy .btn { flex: none; }
.adm-events { list-style: none; margin: 0; padding: 0; }
.adm-events li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.adm-events li:last-child { border-bottom: 0; }
.adm-events .ic { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); margin-top: 2px; }
.adm-events .ic.on { color: var(--success); } .adm-events .ic.bad { color: #f0a0a0; } .adm-events .ic.warn { color: #e8c37a; }
.adm-events .adm-mtxt small.msg { white-space: normal; color: var(--text-2); }
.adm-events li.failed .msg { color: #f0a0a0; }
.adm-evact { flex: none; display: grid; gap: 6px; justify-items: end; }
.adm-rules ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.adm-rules strong { color: var(--text); }
.segmented.sm button { height: 32px; font-size: 13px; padding: 0 12px; }
/* Elementos em PNG do painel, no criador */
.ed-grid-png button { padding: 8px; }
.ed-grid-png img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.ed-grid-png button.is-busy { opacity: .45; }

/* ---------- Administração: elementos ---------- */
.adm-elgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
@media (min-width: 700px) { .adm-elgrid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1000px) { .adm-elgrid { grid-template-columns: repeat(8, 1fr); } }
.adm-el { position: relative; display: grid; gap: 4px; padding: 6px; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.adm-el:active { transform: scale(.96); }
.adm-el .pic { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: repeating-conic-gradient(var(--surface) 0 25%, transparent 0 50%) 0 0 / 12px 12px; overflow: hidden; }
.adm-el img { width: 84%; height: 84%; object-fit: contain; }
.adm-el .nm { font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.adm-el.off .pic { opacity: .4; }
.adm-el .badge { position: absolute; top: 8px; left: 8px; height: 18px; padding: 0 6px; font-size: 10px; background: var(--bg); }

/* ---------- Administração: ícone do app ---------- */
.ico-card { display: flex; align-items: center; gap: 14px; }
.ico-card img { width: 56px; height: 56px; border-radius: 13px; flex: none; box-shadow: 0 0 0 1px var(--border-soft); }
.ico-card > div { flex: 1; min-width: 0; }
.ico-card .h3 { margin: 0 0 2px; }
.ico-prev { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 16px; border-radius: 18px; background: linear-gradient(160deg, #cfe3e1, #b9d4d8); color: #2a3b3b; }
.ico-prev > div { display: grid; justify-items: center; gap: 6px; }
.ico-prev small { font-size: 11.5px; font-weight: 600; }
.ico-prev .cur img { width: 72px; height: 72px; border-radius: 16px; opacity: .85; }
.ico-prev canvas { border-radius: 22.5%; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.ico-prev [data-big] { width: 150px; height: 150px; }
.ico-prev [data-mid] { width: 60px; height: 60px; }
.ico-prev [data-small] { width: 32px; height: 32px; }
.ico-prev .tiny { grid-template-columns: auto auto; align-items: end; column-gap: 10px; }
.ico-prev .tiny small { grid-column: 1 / -1; }
.ico-prev .arrow { opacity: .55; }
.ico-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.ico-presets button { display: grid; justify-items: center; gap: 4px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.ico-presets span { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-family: "Instrument Serif", serif; font-style: italic; font-size: 20px; box-shadow: 0 0 0 1px var(--border); }
.ico-presets button[aria-pressed="true"] span { box-shadow: 0 0 0 2px var(--accent); }
.ico-presets small { font-size: 11px; color: var(--text-2); }
.ico-color { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.ico-color input { width: 40px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; }

/* Quadros das figurinhas: sempre escuros, também no modo claro
   (figurinhas brancas ou claras somem num fundo branco) */
:root[data-theme="light"] .sticker-card { background: #151515; border-color: #262626; }
:root[data-theme="light"] .sticker-card.skeleton { background: #1d1d1d; }
:root[data-theme="light"] .sticker-card .corner { color: #d9d7d1; background: rgba(5, 5, 5, .55); }
:root[data-theme="light"] .sticker-card .corner.on { color: #f5f4f0; }
:root[data-theme="light"] .preview-box.checker { --checker-a: #1a1a1a; --checker-b: #202020; border-color: #262626; }
:root[data-theme="light"] .adm-sticker .pic,
:root[data-theme="light"] .adm-preview,
:root[data-theme="light"] .adm-qitem .pic,
:root[data-theme="light"] .adm-topstk .pic { background: #1a1a1a; }
/* figurinha ocupa mais o quadro */
.sticker-card .open { padding: 16% 9% 9%; }
/* Editar cor: figurinha menor e fixa no topo, para ver a cor mudar enquanto escolhe na paleta */
.preview-box.compact { position: sticky; top: 0; z-index: 3; width: min(58%, 230px); margin: 0 auto 14px; padding: 9%; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }

/* ---------- Tela de abertura (enquanto o app carrega) ---------- */
.splash {
  position: fixed; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: var(--bg); color: var(--text); padding: 24px; text-align: center;
  animation: splashIn .5s ease both;
}
.splash .logo { font-size: 0; }
.splash .logo-story { font-size: 38px; }
.splash .logo-boss { font-size: 44px; }
.splash .logo-r { font-size: 13px; }
.splash p { margin: 0; font-size: 12.5px; letter-spacing: .02em; color: var(--text-3, rgba(234,231,222,.5)); animation: splashPulse 1.6s ease-in-out infinite; }
@keyframes splashIn { from { opacity: 0; transform: scale(.97); } }
@keyframes splashPulse { 50% { opacity: .45; } }

/* Prévia da figurinha: fundo preto ou branco, à escolha */
.preview-bg { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 12px; }
.preview-bg > span { font-size: 13px; color: var(--text-2); }
.segmented.sm { flex: none; min-width: 156px; }
.segmented.sm button { height: 30px; padding: 0 14px; font-size: 12.5px; }
.preview-box.bg-dark { background: #0d0d0d; border-color: #262626; }
.preview-box.bg-light { background: #ffffff; border-color: #e3e0d8; }
.preview-box { transition: background-color .2s ease; }


/* Criador de figurinha: lixeira ao arrastar */
.st-trash { bottom: 14px; background: rgba(0, 0, 0, .55); border-color: rgba(255, 255, 255, .9); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }

/* Login: primeiro acesso + campo de código */
.first-access { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.first-access > span:first-child { flex: 1; display: grid; gap: 2px; }
.first-access small { color: var(--text-2); font-size: 13px; }
.first-access:active { transform: scale(.99); }
.code-input { font-size: 24px !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-foot button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* Localização: aparência e personalizar */
.loc-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.loc-tile { display: grid; place-items: center; height: 54px; border-radius: 14px; border: 1.5px solid var(--border-soft); background: var(--surface-2); padding: 0; cursor: pointer; }
.loc-tile[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
.loc-mini { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.loc-mini b { font-size: 14px; font-weight: 800; line-height: 1; }
.loc-mini.clear { box-shadow: none; background: repeating-conic-gradient(#8a857c 0 25%, #5a5650 0 50%) 0 0 / 10px 10px !important; }
.loc-custom { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 4px; border: 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); background: none; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; margin-bottom: 6px; }
.loc-custom span { flex: 1; text-align: left; }
.loc-custom .dot { width: 22px; height: 22px; border-radius: 999px; border: 1.5px solid var(--border); }
.loc-custom svg:last-child { transition: transform .2s; }
.loc-custom[aria-expanded="true"] svg:last-child { transform: rotate(90deg); }
.loc-custom-body { padding-bottom: 6px; }

/* Elementos: Marcador, Balão, Lugar e Realce */
.ed-specials { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.ed-specials button { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 84px; padding: 10px 4px 8px; border-radius: 16px; border: 1px solid var(--border-soft); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.ed-specials button:active { transform: scale(.97); }
.ed-specials small { font-size: 12px; color: var(--text-2); }
.ed-specials span { font: 500 16px/1 "Instrument Sans", system-ui, sans-serif; display: inline-flex; align-items: center; gap: 4px; }
.sp-marker { position: relative; background: #111; color: #fff; padding: 7px 16px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.sp-marker::after { content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #111; border-bottom: 0; }
.sp-bubble { position: relative; background: #3B82F6; color: #fff; padding: 7px 14px; border-radius: 12px; }
.sp-bubble::after { content: ""; position: absolute; right: -5px; bottom: 2px; border: 5px solid transparent; border-left: 7px solid #3B82F6; border-right: 0; }
.sp-place { background: #fff; color: #111; padding: 6px 10px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.sp-highlight { position: relative; background: rgba(168,200,245,.9); color: #fff; padding: 7px 12px; }
.sp-highlight i { position: absolute; width: 2px; background: #3B82F6; top: -5px; bottom: 0; left: -1px; }
.sp-highlight i:last-child { left: auto; right: -1px; top: 0; bottom: -5px; }
.sp-highlight i::after { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 99px; background: #3B82F6; }
.sp-highlight i:last-child::after { top: auto; bottom: -3px; }

/* Opções de Elementos e de Aparência: cartões mais finos e delicados */
.ed-specials { gap: 6px; }
.ed-specials button { min-height: 66px; padding: 8px 2px 6px; gap: 6px; border-radius: 12px; border: 0.5px solid var(--border-soft); background: transparent; }
.ed-specials small { font-size: 11px; letter-spacing: .01em; }
.ed-specials span { font-size: 12px; font-weight: 500; }
.sp-marker { padding: 4px 11px; border-radius: 4px; box-shadow: 0 0 0 0.5px rgba(255,255,255,.18); }
.sp-marker::after { bottom: -4px; border-width: 4px; border-top-width: 4px; }
.sp-bubble { padding: 4px 11px; border-radius: 9px; }
.sp-bubble::after { right: -4px; border-width: 4px; border-left-width: 5px; }
.sp-place { padding: 4px 8px; border-radius: 5px; box-shadow: 0 0 0 0.5px rgba(0,0,0,.15); }
.sp-place svg { width: 11px; height: 11px; }
.sp-highlight { padding: 4px 9px; }
.sp-highlight i { width: 1.5px; top: -4px; }
.sp-highlight i:last-child { bottom: -4px; }
.sp-highlight i::after { width: 6px; height: 6px; left: -2.25px; top: -2px; }
.sp-highlight i:last-child::after { bottom: -2px; }
.loc-styles { gap: 6px; }
.loc-tile { height: 44px; border-radius: 10px; border-width: 0.5px; background: transparent; }
.loc-tile[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.loc-mini { padding: 3px 8px; border-radius: 5px; gap: 4px; box-shadow: 0 0 0 0.5px rgba(0,0,0,.2); }
.loc-mini b { font-size: 11px; }
.loc-mini svg { width: 10px; height: 10px; }

/* ---------- Criador de figurinhas (tela cheia) ---------- */
.st { background: var(--bg); color: var(--text); }
.st-head { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 8px; padding: 10px 14px 6px; }
.st-head h1 { margin: 0; text-align: center; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.st-round { width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; border: 1px solid var(--border-soft); background: var(--surface); color: var(--text); padding: 0; cursor: pointer; }
.st-round:disabled { opacity: .35; }
.st-export { height: 40px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font: 600 15px/1 var(--font-sans), system-ui, sans-serif; cursor: pointer; }
.st-bar { display: flex; justify-content: center; gap: 8px; padding: 6px 12px 4px; }
.st-bar .st-round { width: 40px; height: 40px; }
.st-bg i { width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--border); }
.st-bg.black i { background: #000; }
.st-bg.white i { background: #fff; }
.st-bg.checker i { background: conic-gradient(#d9d6cf 0 25%, #fff 0 50%, #d9d6cf 0 75%, #fff 0) 0 0 / 11px 11px; }
.st-bg[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.st .st-stage { flex: 1; min-height: 0; width: auto; aspect-ratio: auto; max-width: none; border-radius: 0; overflow: visible; display: grid; place-items: center; padding: 8px 12px; }
.st-frame { position: relative; border-radius: 22px; overflow: hidden; }
.st-frame canvas { display: block; border-radius: 22px; touch-action: none; user-select: none; -webkit-user-select: none; }
.st .st-hint { bottom: 16px; color: rgba(245,244,240,.55); }
.st .st-panel { margin: 0 10px 6px; max-height: 42vh; overflow-y: auto; overscroll-behavior: contain; border-radius: 20px; }
.st-tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--border-soft); padding: 6px 4px calc(6px + var(--safe-b, 0px)); background: var(--bg); }
.st .st-tabs { padding-bottom: 6px; }
.st-tab { display: grid; justify-items: center; gap: 4px; padding: 8px 2px; border: 0; background: none; color: var(--text-2); font: 500 12px/1.1 var(--font-sans), system-ui, sans-serif; cursor: pointer; }
.st-tab svg { color: var(--text); }
.st-tab[aria-pressed="true"] { color: var(--text); }
.st-tab[aria-pressed="true"] span { font-weight: 700; }
/* botões flutuantes da seleção */
.st-float { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.st-float-top, .st-float-bottom { position: absolute; display: flex; gap: 10px; transform: translateX(-50%); pointer-events: auto; }
.st-float button { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 0; padding: 0; cursor: pointer; touch-action: none; }
.st-float-top button { background: rgba(40,42,48,.92); color: #fff; }
.st-float-bottom button { background: #fff; color: #111; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
/* mais opções */
.st-more { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.st-more button { display: grid; justify-items: center; gap: 6px; padding: 14px 4px; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--surface-2); color: var(--text); font: 500 12px/1 var(--font-sans), system-ui, sans-serif; cursor: pointer; }

/* Criador de figurinha: topo do painel (voltar / concluir) */
.st-panel-head { display: flex; justify-content: space-between; align-items: center; margin: -4px -2px 8px; position: sticky; top: -14px; z-index: 2; background: var(--surface); padding: 4px 0; }
.st-back { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text); cursor: pointer; padding: 0; }
.st-ok { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; padding: 0; }
.ed-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.ed-specials { grid-template-columns: repeat(3, 1fr); }
/* Lista de fontes (cartões) */
.fn-top { display: flex; gap: 8px; margin-bottom: 10px; }
.fn-search { flex: 1; height: 46px; border-radius: 999px; padding: 0 18px; }
.fn-favs { display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-soft); background: transparent; color: var(--text); font: 500 14px/1 var(--font-sans), system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.fn-favs[aria-pressed="true"] { border-color: var(--text); }
.fn-list { display: grid; gap: 8px; padding-bottom: 6px; }
.fn-card { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 76px; padding: 12px 12px 12px 16px; border-radius: 16px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.fn-card[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.fn-txt { flex: 1; min-width: 0; display: grid; gap: 4px; }
.fn-txt small { font-size: 12px; color: var(--text-2); }
.fn-txt b { font-weight: 400; font-size: 24px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-heart { flex: none; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.fn-heart[aria-pressed="true"] { color: #E8577D; }
.fx-chips { margin-bottom: 10px; }

/* Rodapé do criador de figurinha: arraste para o lado para ver todas as ferramentas */
.st-tabs { display: flex; grid-template-columns: none; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tab { flex: 0 0 auto; min-width: 74px; max-width: 92px; scroll-snap-align: start; text-align: center; }
.st-tab span { white-space: normal; line-height: 1.15; }
/* Agrupar */
.grp-list { display: grid; gap: 6px; max-height: 30vh; overflow-y: auto; }
.grp-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-soft); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.grp-item .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border); display: grid; place-items: center; color: transparent; flex: none; }
.grp-item[aria-pressed="true"] { border-color: var(--text); }
.grp-item[aria-pressed="true"] .box { background: var(--text); border-color: var(--text); color: var(--bg); }
.grp-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-item small { color: var(--text-2); font-size: 11px; }
/* Ajustar posição */
.pos-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pos-pad { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 44px); gap: 6px; justify-content: center; }
.pos-pad button { border-radius: 12px; border: 1px solid var(--border-soft); background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.pos-pad button:nth-child(1) { grid-column: 2; grid-row: 1; }
.pos-pad button:nth-child(2) { grid-column: 1; grid-row: 2; }
.pos-pad button:nth-child(3) { grid-column: 3; grid-row: 2; }
.pos-pad button:nth-child(4) { grid-column: 2; grid-row: 3; }

/* Editor de texto: botão de fonte e lista em cartões */
.txo-fontbtn { justify-self: center; display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 28px); height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: 16px; }
.txo-fontbtn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txo-sheet { position: absolute; left: 0; right: 0; bottom: 0; height: min(68vh, 620px); display: flex; flex-direction: column; background: var(--surface); color: var(--text); border-radius: 22px 22px 0 0; padding: 12px 14px calc(env(safe-area-inset-bottom, 0px) + 8px); box-shadow: 0 -8px 30px rgba(0,0,0,.25); animation: txoUp .22s ease both; }
@keyframes txoUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.txo-sheet[hidden] { display: none; }
.txo-sheet .st-panel-head { position: static; margin: 0 0 8px; background: transparent; }
.txo-sheet .st-panel-head b { font-size: 16px; }
.txo-sheet .fn-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; align-content: start; }

/* Texto sendo digitado direto na arte */
.txi { position: absolute; z-index: 6; min-width: 1ch; width: max-content; white-space: pre-wrap; overflow-wrap: anywhere; outline: none; border-radius: .3em; cursor: text; -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; box-shadow: 0 0 0 1.5px rgba(127,127,127,.55); }
.txi:empty::before { content: attr(data-ph); opacity: .45; }

/* Story: ferramentas numa faixa na base da imagem, cada uma com o nome embaixo */
.ig-tools { inset: auto 0 12px 0; top: auto; right: 0; display: block; gap: 0; max-height: none; overflow: visible; padding: 0; margin: 0; z-index: 3; }
.ig:has(.ig-panel:not(:empty)) .ig-tools { max-height: none; }
.ig-reel { display: flex; align-items: flex-start; gap: 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 4px 10px; -webkit-overflow-scrolling: touch; }
.ig-reel::-webkit-scrollbar { display: none; }
.ig-tool { flex: none; width: 64px; height: auto; border-radius: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; filter: none; color: #fff; padding: 0; scroll-snap-align: start; }
.ig-tool[aria-pressed="true"] { background: none; color: #fff; }
.ig-ico { width: 50px; height: 50px; border-radius: 999px; display: grid; place-items: center; background: rgba(20,20,20,.62); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 3px 10px rgba(0,0,0,.3); transition: transform .15s, border-color .15s; }
.ig-ico svg { width: 23px; height: 23px; }
.ig-tool:active .ig-ico { transform: scale(.92); }
.ig-tool[aria-pressed="true"] .ig-ico { border-color: rgba(255,255,255,.75); }
.ig-lbl { font: 600 11px/1.15 var(--font-sans), system-ui, sans-serif; text-align: center; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.75); max-width: 64px; }
.ig:has(.ig-trash:not([hidden])) .ig-tools { opacity: 0; pointer-events: none; }
/* Story: seta de voltar no topo dos painéis */
.ig-panel .ig-panel-head { position: sticky; top: -14px; margin: -8px -6px 4px; padding: 2px 0; background: transparent; z-index: 2; justify-content: flex-start; }
.ig-panel .ig-panel-head .st-back { width: auto; height: 36px; padding: 0 12px 0 4px; gap: 2px; display: inline-flex; align-items: center; color: #F5F4F0; background: rgba(255,255,255,.08); border-radius: 999px; font: 600 13px/1 var(--font-sans), system-ui, sans-serif; }

/* Câmera: revisar a foto antes de usar */
.cam-hd { font: 800 13px/1 var(--font-sans), system-ui, sans-serif; letter-spacing: .04em; }
.cam-review { position: absolute; inset: 0; z-index: 2; background: #000; }
.cam-review[hidden] { display: none; }
.cam-review img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-review-actions { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 30px); display: flex; justify-content: center; gap: 12px; padding: 0 16px; }
.cam-review-actions button { flex: 1; max-width: 190px; height: 56px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 700 16px/1 var(--font-sans), system-ui, sans-serif; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.cam-discard { background: rgba(20,20,20,.62); color: #F5F4F0; border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cam-use { background: #EAE7DE; color: #0a0a0a; }
.cam.reviewing .cam-top, .cam.reviewing .cam-bottom { display: none; }

/* Story: segurar para ver a foto original */
.ig-orig { margin-left: 8px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ig-orig.on { background: #fff; color: #111; }
.ig.showing-original .ig-tools, .ig.showing-original .ig-top > :not(.ig-orig), .ig.showing-original .ig-panel, .ig.showing-original .ig-bottom > * { opacity: 0; pointer-events: none; transition: opacity .12s; }
.ig.showing-original .ig-frame::after { content: "Original"; position: absolute; left: 50%; top: 70px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font: 600 12px/1 var(--font-sans), system-ui, sans-serif; pointer-events: none; z-index: 4; }

/* Câmera: flash, trocar câmera e layouts (coluna da direita) */
.cam-side { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 76px); display: grid; gap: 12px; justify-items: end; z-index: 2; }
.cam-btn[aria-pressed="true"] { background: #EAE7DE; color: #0a0a0a; }
.cam-btn svg { display: block; }
.cam-layouts { display: grid; grid-template-columns: repeat(2, 58px); gap: 8px; padding: 12px; border-radius: 22px; background: #F6F4EF; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: fadeIn .15s ease both; }
.cam-layouts[hidden] { display: none; }
.cam-layouts button { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; color: #1a1a1a; background: transparent; }
.cam-layouts button[aria-pressed="true"] { background: #1a1a1a; color: #F6F4EF; }
.cam-grid { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.cam-grid[hidden] { display: none; }
.cam-cell { position: absolute; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.85); background: rgba(0,0,0,.55); overflow: hidden; }
.cam-cell.now { background: transparent; box-shadow: inset 0 0 0 3px #fff; }
.cam-cell.done { background: #000; }
.cam-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-screenflash { position: absolute; inset: 0; z-index: 5; background: #fff; pointer-events: none; }
.cam-screenflash[hidden] { display: none; }
.cam.reviewing .cam-side, .cam.reviewing .cam-grid { display: none; }
.cam-top, .cam-bottom { z-index: 2; }

/* Story: na tela inicial (Tirar foto / Galeria / Fundo liso) não aparecem as ferramentas nem os botões de baixo */
.ig:has(.ed-start:not([hidden])) .ig-tools,
.ig:has(.ed-start:not([hidden])) .ig-bottom > * { visibility: hidden; pointer-events: none; }
/* Story: na tela inicial (Tirar foto / Galeria / Fundo liso) não aparecem os botões de baixo */
.ig:has(.ed-start:not([hidden])) .ig-bottom, .ig:has(.ed-start:not([hidden])) .ig-tools { visibility: hidden; pointer-events: none; }

/* Story: tela inicial sem os botões de baixo e com seta para voltar */
.ig:has(.ed-start:not([hidden])) .ig-bottom { display: none; }
.ed-start-back { position: absolute; top: 14px; left: 14px; width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.1); }
.ed-start-back:active { transform: scale(.94); }

/* Figurinhas no Story: filtro por categoria e tema */
.st-search .input { padding-right: 58px; }
.st-filter-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; color: var(--text); background: var(--surface-2); border: 0; }
.st-filter-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.st-filters { display: grid; gap: 10px; margin-top: 12px; }
.st-filters[hidden] { display: none; }
.st-fbox { display: grid; gap: 8px; padding: 14px 14px 12px; border: 1px solid var(--border-soft); border-radius: 18px; background: var(--surface); }
.st-fbox[hidden] { display: none; }
.st-fbox > span { font-weight: 600; font-size: 14px; }
.st-fbox select.input { height: 46px; border-radius: 14px; }

/* Administração → Filtros */
.adm-fmt-tip { margin: 10px 2px 0; line-height: 1.45; }
.adm-fgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 10px; }
@media (min-width: 700px) { .adm-fgrid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .adm-fgrid { grid-template-columns: repeat(4, 1fr); } }
.adm-filter { position: relative; display: grid; gap: 6px; padding: 8px; border-radius: 16px; border: 1px solid var(--border-soft); background: var(--surface-2); min-width: 0; }
.adm-filter.off { opacity: .6; }
.adm-filter .pic { aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; padding: 0; border: 0; background: var(--surface); cursor: pointer; }
.adm-filter .pic img, .adm-filter .pic .skeleton { width: 100%; height: 100%; object-fit: cover; display: block; }
.adm-filter .nm { display: grid; gap: 2px; min-width: 0; cursor: pointer; }
.adm-filter .nm strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-filter .ord { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; }
.adm-filter .ord .icon-btn { width: 30px; height: 30px; background: rgba(0,0,0,.55); color: #fff; border: 0; }
.adm-filter .ord .icon-btn:disabled { opacity: .35; }
.adm-fq .pic { width: 84px; aspect-ratio: 3 / 2; height: auto; }
.adm-fq .pic img { object-fit: cover; }
.adm-fpreview img { width: 100%; border-radius: 14px; display: block; }

/* Personalizar cor: botão no lugar do seletor nativo */
input[type="color"].cp-native { display: none !important; }
.cp-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid var(--border-soft); background: var(--surface-2); color: var(--text); font: 600 13px/1 var(--font-sans), system-ui, sans-serif; white-space: nowrap; cursor: pointer; }
.cp-btn .cp-dot { width: 24px; height: 24px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); background: conic-gradient(#e66, #f2c94c, #9bb89a, #3b6fd9, #b9a6de, #e66); }
.ig-panel .cp-btn { background: #262626; border-color: #333; color: #F5F4F0; }

/* Quadro "Personalizar cor" */
.cp { display: grid; gap: 14px; padding-bottom: 6px; }
.cp-wheelbox { position: relative; width: min(236px, 70vw); aspect-ratio: 1; margin: 2px auto 0; touch-action: none; }
.cp-wheel { width: 100%; height: 100%; border-radius: 999px; display: block; cursor: crosshair; touch-action: none; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.cp-knob { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 999px; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 3px 8px rgba(0,0,0,.35); pointer-events: none; }
.cp-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; font-size: 14px; }
.cp-bright { -webkit-appearance: none; appearance: none; height: 14px; border-radius: 999px; background: linear-gradient(90deg, #000, var(--full, #fff)); outline: none; }
.cp-bright::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 999px; background: #fff; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 2px 6px rgba(0,0,0,.3); }
.cp-bright::-moz-range-thumb { width: 22px; height: 22px; border-radius: 999px; background: #fff; border: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.cp-now { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; }
.cp-swatch { width: 46px; height: 46px; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.cp-hex { height: 46px; font-variant-numeric: tabular-nums; letter-spacing: .05em; text-transform: uppercase; }
.cp-drop { height: 46px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--surface-2); color: var(--text); font: 600 14px/1 var(--font-sans), system-ui, sans-serif; cursor: pointer; }
.cp-recents { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-rc { width: 32px; height: 32px; border-radius: 999px; border: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); cursor: pointer; }

/* Conta-gotas */
.cp-sampler { position: fixed; inset: 0; z-index: 200; cursor: crosshair; touch-action: none; }
.cp-sampler-tip { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px); transform: translateX(-50%); width: max-content; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); padding: 8px 8px 8px 14px; border-radius: 999px; background: rgba(17,17,17,.88); color: #fff; font: 600 13px/1.2 var(--font-sans), system-ui, sans-serif; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.cp-sampler-tip button { flex: none; height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: #fff; color: #111; font-weight: 700; }
.cp-loupe { position: absolute; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 999px; pointer-events: none; background: radial-gradient(circle, transparent 0 9px, var(--c, transparent) 10px); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 8px 20px rgba(0,0,0,.35); }
.cp-loupe::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 999px; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(0,0,0,.55); }
body.cp-sampling .st-float, body.cp-sampling .ig-tools, body.cp-sampling .ig-top { opacity: 0 !important; pointer-events: none !important; }
