:root {
  --bg0: #05080f;
  --bg1: #0a1220;
  --bg2: #121c30;
  --ink: #eef6ff;
  --muted: #8fa3bc;
  --line: rgba(238, 246, 255, 0.14);
  --cyan: #22d3ee;
  --cyan-2: #38bdf8;
  --coral: #ff5a36;
  --coral-2: #ff7a45;
  --accent: var(--coral);
  --accent-2: var(--cyan);
  --danger: #ff5c7a;
  --radius: 18px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Source Serif 4", Georgia, serif;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --glow-cyan: 0 0 40px rgba(34, 211, 238, 0.25);
  --glow-coral: 0 0 36px rgba(255, 90, 54, 0.22);
}

* { box-sizing: border-box; }
/* Author `display` on .btn etc. would otherwise override the UA [hidden] rule. */
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 640px at 8% -8%, rgba(34, 211, 238, 0.28), transparent 55%),
    radial-gradient(900px 560px at 100% 0%, rgba(255, 90, 54, 0.26), transparent 52%),
    radial-gradient(700px 400px at 55% 100%, rgba(56, 189, 248, 0.12), transparent 60%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 42%, #070d18);
  overflow-x: hidden;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.top, .stage, .foot { position: relative; z-index: 1; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5, 8, 15, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(238, 246, 255, 0.06);
  padding-top: max(0.85rem, env(safe-area-inset-top));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  text-shadow: 0 0 28px rgba(34, 211, 238, 0.35);
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow: var(--glow-cyan);
}

.hero {
  padding-top: 1.5rem;
  animation: rise 0.7s ease both;
}

.page-hero {
  padding-top: 0.85rem;
}
.page-hero h1 {
  font-size: clamp(1.7rem, 5.5vw, 2.55rem);
  line-height: 1.12;
  margin-bottom: 0.45rem;
}
.page-hero .lede {
  font-size: 1rem;
  max-width: 36rem;
}

.hero h1 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  background: linear-gradient(115deg, #fff 20%, var(--cyan) 55%, var(--coral) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 0 0 0.6rem;
  background: none;
  color: inherit;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.hero-mark {
  width: clamp(52px, 10vw, 72px);
  height: clamp(52px, 10vw, 72px);
  border-radius: 18px;
  box-shadow: var(--glow-cyan), var(--glow-coral);
  flex-shrink: 0;
}

.hero-brand span {
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 700;
  background: linear-gradient(115deg, #fff 20%, var(--cyan) 55%, var(--coral) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav a,
.nav-logout button {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
}
.nav a:hover,
.nav-logout button:hover { color: var(--cyan); }

.nav-logout {
  display: inline;
  margin: 0;
  padding: 0;
}
.nav-logout button {
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

.credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--glow-cyan);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
a.credits-pill:hover {
  border-color: rgba(34, 211, 238, 0.75);
  background: rgba(34, 211, 238, 0.16);
  transform: translateY(-1px);
}
.credits-pill.is-empty {
  border-color: rgba(255, 90, 54, 0.55);
  background: rgba(255, 90, 54, 0.12);
  color: var(--coral-2);
  box-shadow: var(--glow-coral);
}
.credits-pill span { opacity: 0.85; font-weight: 500; color: var(--muted); }

.nav .btn.tiny {
  padding: 0.55rem 1rem;
  min-height: 44px;
  font-size: 0.85rem;
  border-radius: 999px;
}

/* Menu compacto no mobile (links duplicados no markup) */
.nav-menu {
  display: none;
  position: relative;
  margin: 0;
}
.nav-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(244, 251, 255, 0.08);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after {
  content: "▾";
  font-size: 0.75rem;
  opacity: 0.8;
}
.nav-menu[open] > summary {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.12);
}
.nav-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 11.5rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.45rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 32, 0.98);
  box-shadow: var(--shadow);
  z-index: 50;
}
.nav-menu-panel a,
.nav-menu-panel .nav-logout button {
  width: 100%;
  justify-content: flex-start;
}

.stage {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto 4rem;
  display: grid;
  gap: 1.75rem;
}

.lede {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.5;
}

.lede strong { color: var(--cyan); font-weight: 600; }

.panel {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.07), rgba(255, 90, 54, 0.04));
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: rise 0.8s 0.08s ease both;
  display: grid;
  gap: 1.25rem;
}

.field { display: grid; gap: 0.55rem; }
.label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.opt { text-transform: none; letter-spacing: 0; opacity: 0.8; }

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.chip {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.chip:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 90, 54, 0.5);
}
.chip.is-active {
  border-color: rgba(34, 211, 238, 0.75);
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.18), rgba(255, 90, 54, 0.1));
  box-shadow: var(--glow-cyan);
}
.chip.is-disabled { opacity: 0.4; cursor: not-allowed; }
.chip-title { display: block; font-weight: 600; }
.chip-sub { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.85rem; }
button.linkish {
  appearance: none;
  background: none;
  border: 0;
  padding: 0.55rem 0;
  min-height: 44px;
  color: var(--cyan);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
button.linkish:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Seletor de teclado (marca + modelo) */
.target-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background:
    linear-gradient(120deg, rgba(34, 211, 238, 0.12), rgba(255, 90, 54, 0.08)),
    rgba(0, 0, 0, 0.28);
  color: var(--ink);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  font: inherit;
  box-shadow: var(--glow-cyan);
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.target-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(126, 236, 255, 0.75);
}
.target-trigger.is-empty {
  border-style: dashed;
  border-color: rgba(238, 246, 255, 0.28);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: none;
}
.target-trigger.is-empty .target-keyboard {
  color: var(--muted);
  font-weight: 550;
}
.target-trigger.is-empty .target-format {
  color: #9adff0;
}
.target-trigger-main { display: grid; gap: 0.2rem; min-width: 0; }
.target-brand {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9adff0;
  font-weight: 600;
}
.target-keyboard {
  font-size: 1.12rem;
  font-weight: 650;
  color: #f7fbff;
}
.target-trigger-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.target-format {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.target-chevron {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f4fbff;
  color: #0b2740;
  font-size: 0.75rem;
  font-weight: 700;
}
.target-hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.target-modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(560px, calc(100vw - 1.5rem));
  width: 100%;
  color: var(--ink);
}
.target-modal::backdrop {
  background: rgba(4, 10, 20, 0.72);
  backdrop-filter: blur(6px);
}
.target-modal-inner {
  background: linear-gradient(180deg, rgba(18, 28, 48, 0.98), rgba(10, 18, 32, 0.98));
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow), 0 0 0 1px rgba(34, 211, 238, 0.08);
  overflow: hidden;
  display: grid;
  max-height: min(80dvh, 80vh, 640px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.target-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem 0.85rem;
  align-items: flex-start;
}
.target-modal-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  color: #f7fbff;
}
.target-modal-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.target-close {
  appearance: none;
  border: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: rgba(244, 251, 255, 0.12);
  color: #f4fbff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.target-close:hover {
  background: #f4fbff;
  color: #0b2740;
}
.target-search-wrap { padding: 0 1.25rem 0.85rem; }
.target-search {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font: inherit;
  outline: none;
}
.target-search::placeholder { color: #6f849a; }
.target-search:focus {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.target-list {
  overflow: auto;
  padding: 0 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.target-option {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  display: grid;
  gap: 0.2rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, background 0.15s;
}
.target-option:hover:not(.is-soon) {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: var(--glow-cyan);
  background: rgba(34, 211, 238, 0.08);
}
.target-option.is-selected {
  border-color: rgba(34, 211, 238, 0.75);
  box-shadow: var(--glow-cyan);
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.16), rgba(255, 90, 54, 0.08));
}
.target-option.is-soon {
  opacity: 0.55;
  cursor: not-allowed;
}
.target-option[hidden],
.target-option.is-filtered-out {
  display: none !important;
}
.target-option-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.target-option-brand {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9adff0;
  font-weight: 700;
}
.target-option-keyboard {
  font-size: 1.05rem;
  font-weight: 650;
  color: #f7fbff;
}
.target-option-format {
  font-size: 0.85rem;
  color: var(--muted);
}
.target-pill {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}
.target-pill.ready {
  background: rgba(34, 211, 238, 0.18);
  color: #9adff0;
}
.target-pill.soon {
  background: rgba(255, 90, 54, 0.14);
  color: var(--coral-2);
}
.target-empty {
  margin: 0;
  padding: 0 1.25rem 1.25rem;
  color: var(--muted);
  text-align: center;
}

.dropzone {
  border: 1.5px dashed rgba(34, 211, 238, 0.35);
  border-radius: var(--radius);
  min-height: 180px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.25s, box-shadow 0.25s;
  background:
    radial-gradient(500px 180px at 50% 0%, rgba(34, 211, 238, 0.14), transparent 70%),
    rgba(0, 0, 0, 0.22);
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-drag {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  background:
    radial-gradient(500px 180px at 50% 0%, rgba(34, 211, 238, 0.24), transparent 70%),
    rgba(0, 0, 0, 0.28);
  outline: none;
}
.dropzone.has-file {
  border-style: solid;
  border-color: rgba(255, 90, 54, 0.65);
  box-shadow: var(--glow-coral);
}
.dropzone.is-busy {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.drop-inner { text-align: center; padding: 1.5rem; }
.drop-title { margin: 0; font-size: 1.15rem; font-weight: 600; }
.drop-sub { margin: 0.4rem 0 0; color: var(--muted); }
.file-label {
  margin: 0;
  padding: 0 1rem 1.25rem;
  color: var(--coral-2);
  font-weight: 500;
  text-align: center;
}

.actions { display: flex; justify-content: flex-end; gap: 0.75rem; flex-wrap: wrap; }
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, opacity 0.15s, background 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.primary {
  background: #f4fbff;
  color: #0b2740;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.18);
}
.btn.primary:hover:not(:disabled) {
  background: #ffffff;
  color: #08304a;
  box-shadow: 0 8px 24px rgba(255, 122, 69, 0.18);
}
.btn.ghost {
  margin-top: 0.9rem;
  background: rgba(244, 251, 255, 0.14);
  border: 1px solid rgba(244, 251, 255, 0.45);
  color: #f4fbff;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.1);
}
.btn.ghost:hover {
  background: #f4fbff;
  border-color: #ffffff;
  color: #0b2740;
  box-shadow: 0 8px 22px rgba(34, 211, 238, 0.2);
}
.btn.block { width: 100%; margin-top: 0.35rem; }

/* Auth pages — card no mesmo tom do painel escuro */
.page-auth .stage {
  width: min(560px, calc(100% - 2rem));
}
.auth-shell {
  display: grid;
  gap: 1.35rem;
  animation: rise 0.65s ease both;
}
.auth-intro { padding-top: 0.75rem; }
.auth-kicker {
  margin: 0 0 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9adff0;
  font-weight: 600;
}
.auth-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: var(--glow-cyan);
}
.auth-title {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #f7fbff;
}
.auth-lede {
  margin: 0;
  color: #b7c7da;
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 28rem;
}
.auth-lede strong { color: #9af1ff; font-weight: 600; }

.auth-card {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.07), rgba(255, 90, 54, 0.04));
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(1.35rem, 3.5vw, 1.85rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 1rem;
  color: var(--ink);
}
.auth-form {
  display: grid;
  gap: 1rem;
}
.auth-card .label {
  color: var(--muted);
}
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}
.auth-card input::placeholder { color: #6f849a; }
.auth-card input:focus {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
}
.check-row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--cyan);
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.auth-note a { color: var(--cyan); font-weight: 600; }
.auth-card .auth-note {
  color: var(--muted);
  text-align: center;
  padding-top: 0.15rem;
}
.auth-card .auth-note a { color: var(--cyan); }
.auth-card .hint-pix {
  color: var(--muted);
  text-align: center;
}
.auth-card .hint-pix em { color: var(--coral-2); }

.profile-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e8f4ff;
  letter-spacing: -0.01em;
}
.profile-dl {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}
.profile-dl > div {
  display: grid;
  gap: 0.15rem;
}
.profile-dl dt {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.profile-dl dd {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  word-break: break-word;
}
.profile-dl dd a { color: var(--cyan); font-weight: 600; }
.profile-dl dd strong { color: #9af1ff; }
.profile-danger {
  border-color: rgba(255, 90, 54, 0.35);
  background: linear-gradient(180deg, rgba(255, 90, 54, 0.08), rgba(255, 90, 54, 0.03));
}
.btn.danger {
  background: linear-gradient(135deg, #ff5a36, #e11d48);
  color: #fff8f5;
  border: none;
  box-shadow: 0 8px 22px rgba(255, 90, 54, 0.25);
}
.btn.danger:hover {
  filter: brightness(1.06);
}

.flash {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 90, 54, 0.4);
  background: rgba(255, 90, 54, 0.12);
  color: var(--coral-2);
  font-size: 0.95rem;
  word-break: break-word;
}
.flash.ok {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}
.hint-pix {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.hint-pix em { color: var(--coral-2); font-style: normal; font-weight: 600; }

.status {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  animation: rise 0.4s ease both;
}
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem 1rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.status-meta {
  color: var(--muted);
  font-size: 0.9rem;
  min-width: 0;
  word-break: break-word;
}
.bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--coral));
  transition: width 0.35s ease;
}
.bar-fill.is-pulse {
  width: 35%;
  animation: pulse 1.2s ease-in-out infinite;
}
.error { color: var(--danger); margin: 0.75rem 0 0; }

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.history-table th,
.history-table td {
  text-align: left;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.history-table th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.history-table a { color: var(--cyan); text-decoration: none; font-weight: 600; }
.history-table a:hover { color: var(--coral-2); }
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.done { background: rgba(34, 211, 238, 0.15); color: var(--cyan); }
.badge.error { background: rgba(255, 92, 122, 0.15); color: var(--danger); }
.badge.queued, .badge.processing {
  background: rgba(255, 122, 69, 0.15);
  color: var(--coral-2);
}
.history-table tr.is-live .job-status {
  animation: badge-pulse 1.4s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.notice-hero {
  text-align: center;
  max-width: 36rem;
  margin-inline: auto;
}
.notice-hero .auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.notice-hero .auth-mark {
  border-radius: 8px;
}
.notice-panel {
  max-width: 32rem;
  margin: 0 auto;
  text-align: center;
  gap: 1rem;
}
.notice-detail {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}
.notice-file {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  word-break: break-word;
}
.notice-file .label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}
.empty-state {
  margin: 0;
  color: var(--muted);
  text-align: center;
  padding: 1.5rem 0;
}

.faq-panel {
  gap: 0.65rem;
  padding: clamp(0.85rem, 2vw, 1.15rem);
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.faq-item[open] {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  user-select: none;
  transition: color 0.15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--cyan);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.faq-item[open] summary::after {
  content: "−";
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.55);
}
.faq-item summary:hover { color: var(--cyan); }

.faq-body {
  padding: 0 1.15rem 1.15rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
  animation: rise 0.35s ease both;
}
.faq-body p { margin: 0 0 0.75rem; }
.faq-body p:last-child { margin-bottom: 0; }
.faq-body strong { color: var(--ink); font-weight: 600; }
.faq-body em {
  color: var(--coral-2);
  font-style: normal;
  font-weight: 600;
}
.faq-body a { color: var(--cyan); font-weight: 600; text-decoration: none; }
.faq-body a:hover { color: var(--coral-2); }
.faq-body code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.88em;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}
.faq-body ul,
.faq-steps {
  margin: 0.35rem 0 0.85rem;
  padding-left: 1.25rem;
}
.faq-body li { margin: 0.35rem 0; }
.faq-body ul + p,
.faq-steps + p { margin-top: 0.85rem; }

.faq-cta {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.95rem;
  animation: rise 0.85s 0.12s ease both;
}

.foot a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 500;
}
.foot a:hover { color: var(--coral-2); }

.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 1rem 2.5rem;
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
}

.foot-brand img {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  opacity: 0.95;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { transform: translateX(0); opacity: 0.85; }
  50% { transform: translateX(120%); opacity: 1; }
}

/* Pacotes de créditos + PIX */
.packs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  animation: rise 0.8s 0.08s ease both;
}

.pack {
  position: relative;
  display: grid;
  gap: 0.55rem;
  padding: 1.25rem 1.15rem 1.2rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08), rgba(255, 90, 54, 0.04));
  box-shadow: var(--shadow);
}

.pack.is-featured {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: var(--shadow), var(--glow-cyan);
}

.pack-badge {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan);
}

.pack-name {
  margin: 0;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.pack-credits {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.pack-credits strong {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 700;
}

.pack-price {
  margin: 0.15rem 0 0;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--coral-2);
}

.pack-unit {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.pack-blurb {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--muted);
  min-height: 2.6em;
}

.packs-foot {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.packs-foot a { color: var(--cyan); font-weight: 600; text-decoration: none; }
.packs-foot a:hover { text-decoration: underline; }

.pix-panel { gap: 1rem; }
.pix-status {
  margin: 0;
  font-weight: 600;
  color: var(--cyan);
}
.pix-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: #fff;
  width: fit-content;
  margin: 0 auto;
}
.pix-qr {
  display: block;
  width: min(220px, 70vw);
  height: auto;
  aspect-ratio: 1;
  border-radius: 8px;
}
.pix-copy {
  width: 100%;
  resize: vertical;
  min-height: 4.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px; /* evita zoom automático no iOS */
  line-height: 1.4;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}
.pix-panel .btn.ghost,
.pix-panel .btn.primary {
  width: 100%;
  margin-top: 0.65rem;
}
.flash a {
  color: var(--cyan);
  font-weight: 600;
}

.history-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  .top {
    align-items: center;
    gap: 0.65rem;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  .brand-name { font-size: 1.15rem; }
  .nav { gap: 0.35rem; justify-content: flex-end; }
  .nav-desk { display: none !important; }
  .nav-menu { display: block; }

  .actions { justify-content: stretch; }
  .actions .btn.primary,
  .status .btn.ghost,
  .status .btn.primary,
  .notice-actions .btn {
    width: 100%;
  }
  .nav .btn.primary.tiny {
    width: auto;
  }

  .packs {
    grid-template-columns: 1fr;
  }
  .pack-blurb { min-height: 0; }

  .page-hero h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .history-scroll { overflow: visible; }
  .history-table { font-size: 0.92rem; }
  .history-table thead { display: none; }
  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table td {
    display: block;
    width: 100%;
  }
  .history-table tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
  }
  .history-table td {
    border: 0;
    padding: 0.28rem 0;
  }
  .history-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.15rem;
    font-weight: 600;
  }
  .history-table td.job-actions {
    padding-top: 0.55rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--line);
  }

  .foot {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .packs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
