.avatar { overflow: hidden; }
.avatar img { border-radius: 0; }
.photo-crop-overlay { z-index: 60; }
.photo-crop-card { width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--bg-main); border: 1px solid var(--divider); border-radius: 18px; padding: 24px; box-shadow: var(--elev-3), var(--edge-light); }
.photo-crop-card h2 { margin: 0 0 8px; color: var(--text-strong); }
.photo-crop-card p { color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.photo-crop-view { position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: 20px auto; overflow: hidden; border-radius: 12px; background: var(--bg-floating); touch-action: none; cursor: grab; }
.photo-crop-view:active { cursor: grabbing; }
.photo-crop-view img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; pointer-events: none; }
.photo-crop-mask { position: absolute; inset: 0; border: 1px solid #fff9; border-radius: 50%; box-shadow: 0 0 0 80px #0009; pointer-events: none; }
.photo-crop-view.banner { width: 100%; }
.photo-crop-view.banner .photo-crop-mask, .photo-crop-view.background .photo-crop-mask { border-radius: inherit; box-shadow: none; }
.photo-crop-view.background { width: min(240px, 100%); }
/* Fundo na prévia de Meu perfil: atrás da foto e do nome, como no cartão. */
.profile-preview-body { position: relative; }
.profile-preview-body > :not(.profile-preview-bg) { position: relative; z-index: 1; }
.profile-preview-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.profile-preview.has-bg .profile-preview-body .avatar { border-color: var(--pc-surface, var(--bg-panel)); }
.profile-preview.has-bg .profile-preview-body strong { text-shadow: 0 1px 3px rgb(0 0 0 / .6); }
.profile-preview.has-bg .profile-preview-body span { color: var(--text); }
.profile-banner-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.pc-banner, .profile-cover { position: relative; overflow: hidden; }
.pc-banner { border-radius: 12px 12px 0 0; }
.pc-top-actions { z-index: 1; }
.photo-crop-card label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--text); font-size: 14px; }
.photo-crop-card output { margin-left: auto; color: var(--text-muted); }
.photo-crop-card input[type=range] { width: 100%; margin: 6px 0; accent-color: var(--brand); }
.photo-crop-position { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 14px 0; }
.photo-crop-card .confirm-actions { flex-wrap: wrap; margin-top: 20px; }
.sb-card { position: relative; min-width: 0; }
.sb-card .sb-btn { width: 100%; height: 96px; padding-bottom: 30px; }
.sb-preview { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; border: 0; border-radius: 8px; padding: 5px 8px; background: transparent; color: var(--interactive); font-size: 12px; cursor: pointer; }
.sb-preview:hover { background: var(--hover-strong); color: var(--text-strong); }
.sb-btn span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-empty { margin: 4px 12px 12px; color: var(--text-muted); font-size: 13px; }
.sb-add { width: calc(100% - 16px); margin: 0 8px 8px; padding: 10px 12px; display: flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid var(--divider); border-radius: 9px; color: var(--text-strong); background: color-mix(in srgb, var(--brand) 20%, var(--bg-panel)); font-size: 13px; font-weight: 600; }
.sb-add:hover:not(:disabled) { background: var(--brand); color: #fff; }
.sb-add:disabled { opacity: .5; }
.sound-upload-overlay { z-index: 60; }
.sound-dialog-card { display: grid; gap: 20px; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 28px; border: 1px solid var(--divider); border-radius: 20px; background: var(--bg-main); box-shadow: var(--elev-3), var(--edge-light); }
.sound-dialog-head { display: flex; align-items: center; gap: 16px; }
.sound-dialog-head h2 { margin: 0; font-size: 24px; color: var(--text-strong); letter-spacing: -.02em; }
.sound-dialog-head p { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; }
.sound-dialog-emblem { display: grid; place-items: center; width: 54px; height: 54px; flex-shrink: 0; border-radius: 16px; background: var(--brand-gradient); color: #fff; }
.sound-limit-note { display: flex; gap: 8px; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.sound-limit-note .ico { margin-top: 2px; color: var(--interactive); }
.sound-dropzone { display: grid; justify-items: center; gap: 10px; padding: 24px; border: 1px dashed var(--interactive); border-radius: 14px; background: var(--bg-panel); color: var(--text); transition: none; }
.sound-dropzone:hover, .sound-dropzone.dragging { background: color-mix(in srgb, var(--brand) 12%, var(--bg-panel)); border-color: var(--brand); }
.sound-upload-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--hover-strong); color: var(--interactive); }
.sound-dropzone strong { max-width: 100%; overflow-wrap: anywhere; }
.sound-dropzone small { color: var(--text-muted); font-size: 13px; }
.sound-select-label { margin-top: 4px; color: color-mix(in srgb, var(--brand) 65%, white); font-size: 14px; font-weight: 600; }
.sound-dialog-card > label { display: grid; gap: 10px; color: var(--interactive); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.sound-dialog-card input[type=text] { width: 100%; border: 1px solid var(--divider); border-radius: 8px; background: var(--bg-input); padding: 12px 14px; color: var(--text-strong); font-size: 16px; font-weight: 400; }
.sound-dialog-card .sound-status { margin: -8px 0 0; }
.sound-dialog-card .confirm-actions { justify-content: flex-end; gap: 10px; margin: 0; }
.sound-preview { padding: 14px; display: grid; gap: 10px; background: var(--bg-panel); border-radius: 12px; }
.sound-preview-title { display: flex; gap: 8px; align-items: center; color: var(--interactive); font-size: 13px; }
/* Recorte do efeito (sound-trimmer.js): play com a duração embaixo, a onda com as duas bordas e,
   em arquivo longo, a faixa com o arquivo inteiro. */
.sound-trim { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.sound-trim-side { grid-row: 1; display: grid; justify-items: center; gap: 6px; width: 52px; }
.sound-trim-play { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 40%, transparent); transition: transform .12s; }
.sound-trim-play:hover { background: var(--brand-hover, var(--brand)); transform: scale(1.05); }
.sound-trim-play:active { transform: scale(.96); }
.sound-trim-play .ico-play { margin-left: 2px; fill: currentColor; }
.sound-trim-play .ico-stop { fill: currentColor; }
.sound-trim-length { color: color-mix(in srgb, var(--brand) 60%, white); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sound-trim-wave, .sound-trim-overview { grid-column: 2; position: relative; padding: 0 12px; border-radius: 10px; background: var(--bg-floating); border: 1px solid var(--divider); touch-action: none; user-select: none; -webkit-user-select: none; }
.sound-trim-wave { height: 80px; }
.sound-trim-track { position: relative; height: 100%; }
.sound-trim-bars { position: absolute; inset: 10px 0; width: 100%; height: calc(100% - 20px); pointer-events: none; }
.sound-trim-shade { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .45); pointer-events: none; }
.sound-trim-shade.left { left: 0; }
.sound-trim-shade.right { right: 0; }
.sound-trim-window {
  position: absolute; top: 0; bottom: 0; border-block: 2px solid var(--brand); pointer-events: none;
  background: color-mix(in srgb, var(--brand) 10%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--brand) 30%, transparent); transition: none;
}
.sound-trim-wave.dragging .sound-trim-window { box-shadow: 0 0 24px color-mix(in srgb, var(--brand) 50%, transparent); }
/* As bordas ficam por fora do trecho, como colchetes; quem recebe o arraste é a onda inteira. */
.sound-trim-handle {
  position: absolute; top: -2px; bottom: -2px; width: 12px; pointer-events: none;
  background: linear-gradient(#fff, #fff) center / 2px 20px no-repeat, var(--brand); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3);
}
.sound-trim-handle.start { right: 100%; border-radius: 8px 0 0 8px; }
.sound-trim-handle.end { left: 100%; border-radius: 0 8px 8px 0; }
.sound-trim-handle:focus { outline: none; }
.sound-trim-handle:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 5px color-mix(in srgb, var(--brand) 45%, transparent); }
.sound-trim-playhead { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; border-radius: 1px; background: #fff; pointer-events: none; box-shadow: 0 0 6px rgba(255, 255, 255, .6); }
.sound-trim-playhead.hidden { display: none; }
.sound-trim-overview { height: 30px; padding-block: 3px; cursor: pointer; }
.sound-trim-overview .sound-trim-bars { inset: 2px 0; height: calc(100% - 4px); }
.sound-trim-lens { position: absolute; top: -1px; bottom: -1px; min-width: 6px; border: 1.5px solid color-mix(in srgb, var(--text-muted) 80%, transparent); border-radius: 6px; background: rgba(255, 255, 255, .06); cursor: grab; }
.sound-trim-overview.dragging .sound-trim-lens { cursor: grabbing; border-color: var(--text-strong); }
.sound-trim-lens:focus { outline: none; }
.sound-trim-lens:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.sound-trim-caption { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin: 0; font-size: 12px; color: var(--text-muted); }
.sound-trim-times { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sound-file-field { display: grid; gap: 10px; }
.sound-field-label { color: var(--interactive); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.sound-file-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 6px 6px 12px; border: 1px solid var(--divider); border-radius: 8px; background: var(--bg-input); color: var(--interactive); }
.sound-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); font-size: 14px; }
.sound-file-row small { flex-shrink: 0; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sound-file-change { flex-shrink: 0; min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--hover-strong); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--divider); font-size: 13px; font-weight: 600; transition: transform .12s; }
.sound-file-change:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 14%, transparent); }
.sound-file-change:active:not(:disabled) { transform: scale(.97); }
.sound-file-change:disabled { opacity: .45; }
html.touch .sound-trim-wave { height: 88px; }
@media(max-width: 600px) {
  .sound-dialog-card { padding: 20px; gap: 16px; } .sound-dialog-head h2 { font-size: 21px; }
  .sound-dialog-card .confirm-actions { flex-direction: column-reverse; align-items: stretch; gap: 6px; padding: 14px 16px; }
  .sound-preview { padding: 12px; }
  .sound-trim { column-gap: 10px; }
  .sound-trim-side { width: 44px; }
}
.sound-upload { display: grid; gap: 16px; padding: 20px; border-radius: 14px; border: 1px solid var(--divider); background: var(--bg-panel); }
.sound-upload label { display: grid; gap: 8px; color: var(--text); font-size: 14px; }
.sound-upload .btn-primary { justify-self: start; }
.sound-status { min-height: 20px; color: var(--text-muted); font-size: 14px; }
.server-sound-list { display: grid; gap: 8px; margin-top: 20px; }
.server-sound-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--divider); background: var(--bg-panel); border-radius: 12px; padding: 14px; }
.server-sound-row .sound-title { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.server-sound-row small { display: block; color: var(--text-muted); margin-top: 4px; }
.server-sound-row button { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
@media(max-width: 600px) { .server-sound-row { flex-wrap: wrap; } .server-sound-row .sound-title { flex-basis: calc(100% - 40px); } .photo-crop-card { padding: 18px; } }

.nickname-overlay { z-index: 60; }
.nickname-card { width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 28px; border: 1px solid var(--divider); border-radius: 18px; background: var(--bg-main); box-shadow: var(--elev-3), var(--edge-light); display: grid; gap: 16px; }
.nickname-heading { display: flex; align-items: center; gap: 12px; color: var(--text-strong); }
.nickname-heading .ico { color: var(--brand); flex-shrink: 0; }
.nickname-card h2, .nickname-card p { margin: 0; }
.nickname-card h2 { font-size: 23px; line-height: 1.25; }
.nickname-subtitle, .nickname-hint, .nickname-status { color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.nickname-preview { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--bg-panel); border: 1px solid var(--divider); border-radius: 12px; }
.nickname-preview .avatar { width: 48px; height: 48px; flex-shrink: 0; }
.nickname-preview > div:last-child { min-width: 0; }
.nickname-preview strong, .nickname-preview small { display: block; overflow-wrap: anywhere; }
.nickname-preview strong { color: var(--text-strong); font-size: 18px; }
.nickname-preview small { color: var(--text-muted); margin-top: 4px; }
.nickname-card label { display: grid; gap: 8px; font-size: 12px; font-weight: 700; color: var(--interactive); }
.nickname-card input { width: 100%; padding: 12px; font: inherit; font-size: 16px; font-weight: 400; color: var(--text); background: var(--bg-rail); border: 1px solid var(--divider); border-radius: 8px; }
.nickname-card input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.nickname-reset { justify-self: start; padding: 0; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 14px; }
.nickname-reset:hover { text-decoration: underline; }
.nickname-status { min-height: 20px; }
.nickname-card .confirm-actions { margin-top: 0; }
.pc-username { color: var(--text-muted); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
@media(max-width: 600px) { .nickname-card { padding: 20px; } .nickname-card h2 { font-size: 20px; } }

/* ---------- Meu perfil: editor à esquerda, prévia ao vivo fixa à direita ---------- */
#page-profile { container-type: inline-size; --pc-color: #5865f2; }
#page-profile .profile-customization { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 24px; }
#page-profile .profile-editing { display: grid; gap: 24px; min-width: 0; }
#page-profile .profile-preview-column { min-width: 0; order: -1; justify-self: center; width: min(100%, 340px); }
@container (min-width: 520px) {
  #page-profile .profile-customization { grid-template-columns: minmax(0, 1fr) 236px; gap: 20px; }
  #page-profile .profile-preview-column { order: 0; position: sticky; top: 0; width: auto; justify-self: stretch; }
}
@container (min-width: 700px) { #page-profile .profile-customization { grid-template-columns: minmax(0, 1fr) 264px; gap: 24px; } }

/* Grupos */
#page-profile .profile-group { display: grid; gap: 10px; }
#page-profile :is(.profile-media-list, .profile-swatches, .profile-name-row) { border: 1px solid var(--divider); border-radius: 14px; background: var(--bg-panel); }
#page-profile .profile-group.hidden { display: none; }
#page-profile .profile-group-head h2 { margin: 0; color: var(--text-strong); font-size: 15px; font-weight: 700; letter-spacing: -.005em; }
#page-profile .profile-group-head p { margin: 3px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
#page-profile #profile-server-label { color: var(--text); font-weight: 600; }

/* Sobre mim: o campo com o contador no canto */
#page-profile .profile-bio-field { position: relative; }
/* Cresce com o texto (sem rolar por baixo do contador); só rola em textos com muitas linhas vazias. */
#settings .settings-content #profile-bio { display: block; width: 100%; min-height: 104px; max-height: 280px; field-sizing: content; contain: inline-size; padding: 12px 14px 28px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.45; border-radius: 14px; }
#settings .settings-content #profile-bio::placeholder { color: var(--text-muted); }
#page-profile .profile-bio-count { position: absolute; right: 12px; bottom: 8px; color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; pointer-events: none; }
#page-profile .profile-bio-count.near { color: var(--yellow, #f0b232); }

/* Imagens: uma linha por imagem, miniatura no formato real e ações sempre à vista */
#page-profile .profile-media-list { display: grid; overflow: hidden; container: profile-media / inline-size; }
#page-profile .profile-media-card { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 14px; padding: 14px 16px; transition: none; }
#page-profile .profile-media-card + .profile-media-card { border-top: 1px solid var(--divider); }
#page-profile .profile-media-card:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
#page-profile .profile-media-thumb-wrap { display: grid; place-items: center; height: 64px; }
#page-profile .profile-media-thumb { position: relative; display: grid; place-items: center; overflow: hidden; color: color-mix(in srgb, var(--text) 55%, transparent); }
#page-profile .profile-media-thumb:has(img) > .ico { visibility: hidden; }
#page-profile .profile-media-thumb.avatar { width: 60px; height: 60px; border-radius: 50%; font-size: 22px; box-shadow: 0 0 0 1px rgb(255 255 255 / .06), 0 6px 16px rgb(0 0 0 / .3); }
#page-profile .profile-media-banner .profile-media-thumb { width: 84px; height: 34px; border-radius: 8px; background: linear-gradient(160deg, color-mix(in srgb, var(--pc-color) 85%, #fff 15%), color-mix(in srgb, var(--pc-color) 55%, #000 45%)); color: rgb(255 255 255 / .75); }
#page-profile .profile-media-background .profile-media-thumb { width: 84px; height: 60px; border-radius: 8px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--text) 5%, transparent) 0 8px, transparent 8px 16px), color-mix(in srgb, var(--bg-rail) 70%, var(--bg-panel)); }
#page-profile .profile-media-background.is-empty .profile-media-thumb { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 14%, transparent); }
#page-profile .profile-media-main { display: grid; gap: 10px; min-width: 0; }
#page-profile .profile-media-copy h3 { margin: 0 0 2px; color: var(--text-strong); font-size: 14px; font-weight: 650; letter-spacing: 0; text-transform: none; }
#page-profile .profile-media-copy .hint { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
#page-profile .profile-media-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#settings .settings-content .profile-media-actions button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px; font-size: 13px; }
#settings .settings-content .profile-media-actions .profile-media-remove { width: 32px; padding: 0; justify-content: center; color: var(--interactive); }
#settings .settings-content .profile-media-actions .profile-media-remove:hover:not(:disabled) { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 35%, transparent); }
#page-profile .profile-media-card .if-empty, #page-profile .profile-media-card.is-empty .if-filled { display: none; }
#page-profile .profile-media-card.is-empty .if-empty { display: inline; }
#page-profile .profile-media-card.is-empty :is(.profile-media-adjust, .profile-media-remove) { display: none; }
#page-profile .profile-format-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; line-height: 1.5; }
#page-profile .profile-format-note .ico { flex-shrink: 0; margin-top: 2px; }
/* Linha estreita: os botões descem para baixo da miniatura e ocupam a largura toda. */
@container profile-media (max-width: 359px) {
  #page-profile .profile-media-card { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "thumb copy" "actions actions"; gap: 12px; padding: 14px; }
  #page-profile .profile-media-main { display: contents; }
  #page-profile .profile-media-thumb-wrap { grid-area: thumb; height: auto; }
  #page-profile .profile-media-copy { grid-area: copy; }
  #page-profile .profile-media-actions { grid-area: actions; }
  #page-profile .profile-media-banner .profile-media-thumb { width: 64px; height: 26px; }
  #page-profile .profile-media-background .profile-media-thumb { width: 64px; height: 46px; }
  #page-profile .profile-media-thumb.avatar { width: 48px; height: 48px; font-size: 18px; }
}

/* Amostras de cor */
#page-profile .profile-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; }
#settings .settings-content .profile-swatch { position: relative; display: grid; place-items: center; width: 30px; min-height: 0; height: 30px; padding: 0; margin: 0; border: 0; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12); cursor: pointer; transition: transform .12s; }
#settings .settings-content .profile-swatch:hover:not(:disabled) { background: var(--swatch); transform: scale(1.1); }
#settings .settings-content .profile-swatch:focus-visible { outline: 2px solid var(--text-strong); outline-offset: 3px; }
#settings .settings-content .profile-swatch[aria-pressed="true"], #settings .settings-content .profile-swatch-custom.selected { box-shadow: 0 0 0 2px var(--bg-panel), 0 0 0 4px var(--swatch, var(--brand)); }
#page-profile .profile-swatch[aria-pressed="true"]::after { content: ''; width: 6px; height: 11px; margin-top: -3px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); filter: drop-shadow(0 1px 1px rgb(0 0 0 / .5)); }
#settings .settings-content .profile-swatch-custom { flex-direction: row; gap: 0; background: var(--swatch, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--interactive) 60%, transparent); color: var(--interactive); font-size: 0; }
#settings .settings-content .profile-swatch-custom.selected { color: #fff; }
#settings .settings-content .profile-swatch-custom:not(.selected) { background: conic-gradient(from 0deg, #ed4245, #f0b232, #23a55a, #3498db, #9b59b6, #ed4245); }
#settings .settings-content .profile-swatch-custom:not(.selected) .ico { color: #fff; filter: drop-shadow(0 1px 1px rgb(0 0 0 / .6)); }
#settings .settings-content .profile-swatch-custom:focus-within { outline: 2px solid var(--text-strong); outline-offset: 3px; }
#settings .settings-content .profile-swatch-custom input[type=color] { position: absolute; inset: 0; width: 100% !important; height: 100% !important; padding: 0 !important; border: 0 !important; opacity: 0; cursor: pointer; }

/* Nome no servidor */
#page-profile .profile-name-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; }
#page-profile .profile-name-row strong { min-width: 0; color: var(--text-strong); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
#settings .settings-content #profile-name-edit { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; font-size: 13px; }

/* Prévia ao vivo */
#page-profile .profile-preview-label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
/* "Prévia ao vivo": o ponto pisca duas vezes quando a página abre e fica aceso (antes pulsava com box-shadow sem parar). */
#page-profile .profile-live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
#page-profile .profile-live-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--green) 70%, transparent); opacity: 0; animation: profile-live 1s ease-out .3s 2; }
@keyframes profile-live { from { opacity: 1; transform: scale(.5); } to { opacity: 0; transform: scale(1.6); } }
:root[data-reduce-motion="true"] #page-profile .profile-live-dot::after { animation: none; }
@media (prefers-reduced-motion: reduce) { #page-profile .profile-live-dot::after { animation: none; } }
#page-profile .profile-preview { width: 100%; max-width: none; overflow: hidden; border-radius: 16px; background: var(--bg-sidebar); box-shadow: 0 18px 44px rgb(0 0 0 / .32); }
#page-profile .profile-cover { height: 96px; }
#page-profile .profile-preview-body { display: grid; gap: 12px; align-items: start; padding: 0 16px 16px; }
#page-profile .profile-preview-avatar-wrap { position: relative; justify-self: start; width: 84px; height: 84px; margin-top: -42px; }
#page-profile #profile-preview-avatar { width: 84px; height: 84px; margin: 0; border: 6px solid var(--bg-sidebar); font-size: 30px; transition: none; }
#page-profile .profile-preview.has-bg #profile-preview-avatar { border-color: var(--pc-surface, var(--bg-sidebar)); }
#page-profile .profile-preview-info { display: grid; justify-items: start; gap: 6px; padding: 0; min-width: 0; }
#page-profile .profile-preview-info strong { color: var(--text-strong); font-size: 20px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
#page-profile .profile-preview-tag { font-size: 12px; color: var(--interactive); }
#page-profile .profile-preview.has-bg .profile-preview-tag { background: rgb(0 0 0 / .45); backdrop-filter: blur(10px); }

/* Partes clicáveis da prévia: um selo diz o que cada parte é. Aparece ao passar o mouse
   sobre a parte ou sobre a linha correspondente do editor, que também ganha contorno. */
#settings .settings-content .profile-preview-spot { position: absolute; z-index: 2; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px; min-height: 0; height: 26px; padding: 0 10px 0 8px; border: 0; border-radius: 999px; background: rgb(0 0 0 / .6); backdrop-filter: blur(8px); color: #fff; font-size: 12px; font-weight: 600; box-shadow: none; opacity: 0; transition: opacity .15s; }
#settings .settings-content .profile-preview-spot:hover:not(:disabled) { background: rgb(0 0 0 / .8); }
#page-profile .profile-cover::after, #page-profile .profile-preview-body::after { content: ''; position: absolute; inset: 0; z-index: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px transparent; pointer-events: none; transition: none; }
#page-profile .profile-preview-body { border-radius: 0 0 16px 16px; }
#page-profile .profile-cover { border-radius: 16px 16px 0 0; }
#page-profile .profile-cover:hover .profile-preview-spot-banner,
#page-profile .profile-preview-body:not(:has(.profile-preview-avatar-wrap:hover)):hover > .profile-preview-spot-background,
#page-profile:has(.profile-media-banner:hover) .profile-preview-spot-banner,
#page-profile:has(.profile-media-background:hover) .profile-preview-spot-background,
#settings .settings-content .profile-preview-spot:focus-visible { opacity: 1; }
#page-profile:has(.profile-media-banner:hover) .profile-cover::after,
#page-profile:has(.profile-media-background:hover) .profile-preview-body::after { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 75%, #fff); }
#page-profile #profile-preview-avatar { outline: 2px solid transparent; outline-offset: 1px; }
#page-profile:has(.profile-media-photo:hover) #profile-preview-avatar { outline-color: color-mix(in srgb, var(--brand) 75%, #fff); }
#settings .settings-content .profile-preview-edit-photo { position: absolute; z-index: 2; right: -2px; bottom: -2px; display: grid; place-items: center; width: 28px; min-height: 0; height: 28px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--brand); box-shadow: 0 0 0 3px var(--bg-sidebar); opacity: 0; transition: opacity .15s; }
#settings .settings-content .profile-preview-edit-photo:hover:not(:disabled) { background: var(--brand-hover); }
#page-profile .profile-preview-avatar-wrap:hover .profile-preview-edit-photo,
#page-profile:has(.profile-media-photo:hover) .profile-preview-edit-photo,
#settings .settings-content .profile-preview-edit-photo:focus-visible { opacity: 1; }
#settings .settings-content :is(.profile-preview-spot, .profile-preview-edit-photo):disabled { opacity: 0; }
@media (hover: none) { #settings .settings-content :is(.profile-preview-spot, .profile-preview-edit-photo):not(:disabled) { opacity: 1; } }

/* Como a pessoa aparece no chat */
#page-profile .profile-chat-preview { display: grid; gap: 8px; margin-top: 2px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--bg-main) 70%, transparent); }
#page-profile .profile-preview.has-bg .profile-chat-preview { background: rgb(0 0 0 / .42); backdrop-filter: blur(10px); }
#page-profile .profile-chat-label { color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
#page-profile .profile-preview-bio { display: grid; gap: 4px; min-width: 0; }
#page-profile .profile-preview-bio.hidden { display: none; }
#page-profile .profile-preview-bio p { margin: 0; color: var(--text); font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
/* O texto formatado não herda o tamanho do nome e da presença da prévia. */
#page-profile .profile-preview-bio p :is(strong, span) { font-size: inherit; }
#page-profile .profile-preview-bio p span:not([class]) { color: inherit; }
#page-profile .profile-preview-bio p .spoiler:not(.revealed) { color: transparent; }
#page-profile .profile-preview.has-bg .profile-preview-bio p { color: var(--text-strong); text-shadow: 0 1px 3px rgb(0 0 0 / .8); }
#page-profile .profile-chat-message { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
#page-profile #profile-preview-chat-avatar { flex-shrink: 0; width: 36px; height: 36px; margin: 0; border: 0; font-size: 14px; background: var(--pc-color); }
#page-profile .profile-chat-text { min-width: 0; }
#page-profile .profile-chat-text > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
#page-profile .profile-chat-text strong { overflow: hidden; color: var(--text-strong); font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
#page-profile .profile-chat-text time { flex-shrink: 0; color: var(--text-muted); font-size: 11px; }
#page-profile .profile-chat-text p { margin: 2px 0 0; color: var(--text); font-size: 14px; line-height: 1.4; }
#page-profile .profile-preview-note { margin: 12px 2px 0; line-height: 1.5; }
