/* ============================================================== modais */
.scrim {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(3, 4, 8, .68); backdrop-filter: blur(5px);
  animation: fade-in .16s var(--ease);
}
.modal {
  width: min(560px, 100%); max-height: min(86vh, 760px);
  display: flex; flex-direction: column;
  background: var(--bg-main);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop-in .22s var(--ease);
}
.modal.wide { width: min(880px, 100%); }
.modal-head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.modal-head .sub { font-size: 13px; color: var(--text-faint); }
.modal-head .spacer { flex: 1 1 auto; }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot {
  flex: none; display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-void) 40%, transparent);
}
.modal-foot .spacer { flex: 1 1 auto; }

/* Modal de configurações com abas laterais */
.settings { display: grid; grid-template-columns: 196px minmax(0, 1fr); min-height: 0; flex: 1 1 auto; }
@media (max-width: 720px) {
  .settings { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .settings-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-nav hr { display: none; }
  .settings-nav button { white-space: nowrap; }
}
.settings-nav {
  border-right: 1px solid var(--line); padding: 14px 10px;
  display: flex; flex-direction: column; gap: 2px;
  background: color-mix(in srgb, var(--bg-void) 35%, transparent);
}
.settings-nav button {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; color: var(--text-muted);
  transition: background var(--fast), color var(--fast); text-align: left;
}
.settings-nav button:hover { background: var(--bg-hover); color: var(--text-soft); }
.settings-nav button.active { background: var(--accent-soft); color: var(--accent-text); }
.settings-nav button svg { width: 17px; height: 17px; flex: none; }
.settings-nav hr { border: 0; border-top: 1px solid var(--line); margin: 8px 4px; }
.settings-pane { padding: 20px 22px 26px; display: flex; flex-direction: column; gap: 20px; }

.setting-group { display: flex; flex-direction: column; gap: 12px; }
.setting-group > h3 { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.setting-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap; }
.setting-row .label { flex: 1 1 200px; min-width: 0; }
.setting-row > :not(.label) { flex: 0 1 auto; max-width: 100%; }
.setting-row .select, .setting-row select { max-width: 100%; }
.setting-row .label b { display: block; font-size: 14px; font-weight: 600; }
.setting-row .label span { display: block; font-size: 12.5px; color: var(--text-faint); line-height: 1.45; margin-top: 1px; }

.note {
  display: flex; gap: 10px; padding: 12px 14px;
  border-radius: var(--r-md); font-size: 13px; line-height: 1.55;
  background: var(--bg-raised); border: 1px solid var(--line); color: var(--text-soft);
}
.note svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.note.warn { border-color: color-mix(in srgb, var(--yellow) 38%, transparent); background: color-mix(in srgb, var(--yellow) 8%, var(--bg-raised)); }
.note.warn svg { color: var(--yellow); }
.note.good { border-color: color-mix(in srgb, var(--green) 38%, transparent); background: color-mix(in srgb, var(--green) 8%, var(--bg-raised)); }
.note.good svg { color: var(--green); }
.note code, .code-block {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--bg-void); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.note code { padding: .1em .4em; }
.code-block {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; overflow-x: auto; white-space: pre; color: var(--accent-text);
}
.code-block .cp { margin-left: auto; flex: none; }

/* Paleta de cores */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid transparent; transition: transform var(--fast), border-color var(--fast);
  position: relative;
}
.swatch:hover { transform: scale(1.12); }
.swatch[aria-pressed="true"] { border-color: var(--text); }
.swatch[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--bg-main);
}

/* Menu de contexto */
.menu {
  position: fixed; z-index: 260;
  min-width: 190px; padding: 5px;
  background: var(--bg-raised); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  animation: pop-in .13s var(--ease);
}
.menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--text-soft); text-align: left;
  transition: background var(--fast), color var(--fast);
}
.menu button:hover { background: var(--bg-hover); color: var(--text); }
.menu button.danger { color: var(--red); }
.menu button.danger:hover { background: color-mix(in srgb, var(--red) 16%, transparent); }
.menu button svg { width: 15px; height: 15px; flex: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.menu .menu-title { padding: 6px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }

/* Cartão de perfil */
.profile-card { width: 300px; padding: 0; overflow: hidden; }
.profile-card .banner { height: 62px; background: linear-gradient(120deg, var(--av-a), var(--av-b)); }
.profile-card .inner { padding: 0 16px 16px; margin-top: -30px; display: flex; flex-direction: column; gap: 10px; }
.profile-card .avatar { --size: 64px; border: 4px solid var(--bg-raised); --dot-ring: var(--bg-raised); }
.profile-card h3 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.profile-card .handle { font-size: 13px; color: var(--text-faint); }
.profile-card .bio { font-size: 13.5px; color: var(--text-soft); line-height: 1.5; border-top: 1px solid var(--line); padding-top: 10px; }

/* Seletor de emoji */
.emoji-pop { width: 312px; padding: 8px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 240px; overflow-y: auto; }
.emoji-grid button { aspect-ratio: 1; border-radius: var(--r-sm); font-size: 19px; transition: background var(--fast), transform var(--fast); }
.emoji-grid button:hover { background: var(--bg-hover); transform: scale(1.14); }
.emoji-pop .emoji-cats { display: flex; gap: 2px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.emoji-pop .emoji-cats button { flex: 1; padding: 5px 0; border-radius: var(--r-sm); font-size: 16px; opacity: .55; }
.emoji-pop .emoji-cats button:hover, .emoji-pop .emoji-cats button.active { opacity: 1; background: var(--bg-hover); }

/* ============================================================ tela de login */
.gate {
  height: 100%; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 620px at 12% -12%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
    radial-gradient(900px 520px at 108% 112%, color-mix(in srgb, var(--purple) 22%, transparent), transparent 60%),
    var(--bg-void);
  position: relative; overflow: hidden;
}
.gate::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0);
  background-size: 28px 28px; mask-image: radial-gradient(closest-side, black, transparent);
}
.gate-card {
  position: relative; width: min(420px, 100%);
  padding: 30px 30px 26px;
  background: color-mix(in srgb, var(--bg-main) 88%, transparent);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 16px;
  animation: pop-in .32s var(--ease);
}
.gate-brand { display: flex; align-items: center; gap: 12px; }
.gate-brand .mark {
  width: 46px; height: 46px; border-radius: var(--r-lg);
  display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, #f04438 16%, var(--panel));
  color: #fff; box-shadow: 0 10px 26px -12px #f04438;
}
.gate-brand .mark svg { width: 24px; height: 24px; }
.gate-brand .mark img { width: 42px; height: 42px; display: block; }
.gate-brand h1 { font-size: 21px; font-weight: 800; letter-spacing: -.025em; }
.gate-brand p { font-size: 13px; color: var(--text-faint); }
.gate form { display: flex; flex-direction: column; gap: 13px; }
.gate .switcher { text-align: center; font-size: 13.5px; color: var(--text-muted); }
.gate .switcher button { color: var(--accent-text); font-weight: 600; }
.gate .switcher button:hover { text-decoration: underline; }
.gate .err {
  font-size: 13px; padding: 9px 12px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--red) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 34%, transparent);
  color: var(--red);
  animation: pop-in .18s var(--ease);
}
.gate .foot { font-size: 11.5px; color: var(--text-faint); text-align: center; line-height: 1.5; }

/* --------------------------------------------------------------- splash */
.splash { height: 100%; display: grid; place-items: center; background: var(--bg-void); gap: 14px; }
.splash .inner { display: flex; flex-direction: column; align-items: center; gap: 14px; animation: fade-in .3s var(--ease); }
.splash .mark {
  width: 56px; height: 56px; border-radius: var(--r-lg); display: grid; place-items: center;
  background: color-mix(in srgb, #f04438 16%, var(--panel)); color: #fff;
}
.splash .mark svg { width: 28px; height: 28px; }
.splash .mark img { width: 52px; height: 52px; display: block; }
.splash p { color: var(--text-faint); font-size: 14px; }
