/* A biblioteca usa as mesmas superfícies e cores dos demais painéis do Concord. */
#emoji.expressions { width: 480px; max-width: calc(100vw - 16px); height: 510px; max-height: calc(100dvh - 16px); padding: 0; display: flex; flex-direction: column; gap: 0; overflow: hidden; border: 0; border-radius: 14px; background: var(--panel); box-shadow: 0 12px 48px rgba(0,0,0,.48); z-index: 19; }
.xp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 8px; }
.xp-tabs { display: flex; gap: 4px; }
.xp-tabs button { min-height: 36px; padding: 0 12px; color: var(--text-2); font-weight: 600; font-size: 13px; border-radius: 8px; }
.xp-tabs button[aria-selected="true"] { background: var(--hover); color: var(--text); }
.xp-tools { display: flex; align-items: center; gap: 8px; padding: 4px 12px 12px; border-bottom: 1px solid var(--line); }
.xp-search { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; }
.xp-search:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.xp-search > .ic { width: 17px; height: 17px; flex: none; color: var(--text-2); }
#emoji.expressions .esearch { width: 100%; min-width: 0; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; outline: 0; box-shadow: none; }
#emoji.expressions .esearch::placeholder { color: var(--text-2); opacity: 1; }
.xp-tone { width: 53px; height: 38px; padding: 0 5px; border-radius: 8px; font-size: 20px; background: var(--raised); color: var(--text); border: 1px solid var(--line); }
.xp-tone option { font-size: 14px; }
.xp-body { flex: 1; min-height: 0; display: flex; }
.xp-rail { width: 56px; flex: none; padding: 8px 0; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable both-edges; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--bg); }
.xp-rail button { flex: none; width: 36px; max-width: 100%; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--text-2); font-size: 12px; font-weight: 600; }
.xp-rail .ic { width: 19px; height: 19px; }
.xp-rail img { width: 30px; height: 30px; object-fit: cover; border-radius: 9px; }
.xp-rail button:hover, .xp-rail button.on { color: var(--text); background: var(--hover); }
.xp-rail button.on { box-shadow: inset 0 0 0 2px var(--accent); }
.xp-results { flex: 1; min-width: 0; padding: 10px; overflow-y: auto; overscroll-behavior: contain; }
.xp-section { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 30px; margin-bottom: 8px; }
.xp-section h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.xp-section .btn { flex: none; min-height: 30px; font-size: 12px; }
.xp-emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 3px; }
.xp-item { position: relative; min-width: 0; overflow: hidden; border-radius: 8px; display: grid; place-items: center; }
.xp-item:hover, .xp-item:focus-visible, .xp-item.selected { background: var(--hover); }
.xp-item.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.xp-emojis .xp-item { height: 40px; font-size: 29px; line-height: 1; }
.xp-emojis .xp-item img { width: 32px; height: 32px; object-fit: contain; }
.xp-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.xp-media .xp-item { height: 124px; background: var(--raised); padding: 4px; }
.xp-media img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; border-radius: 5px; }
.xp-media.xp-masonry { grid-auto-rows: 1px; gap: 0 8px; align-items: start; }
.xp-media.xp-masonry .xp-item { height: auto; min-height: 32px; padding: 0; background: transparent; border-radius: 5px; }
.xp-media.xp-masonry img { position: static; display: block; width: 100%; height: auto; min-height: 32px; border-radius: inherit; }
.xp-media.xp-masonry .xp-item:hover::after, .xp-media.xp-masonry .xp-item.selected::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--accent); border-radius: inherit; pointer-events: none; }
.xp-back { flex: none; }
.xp-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.xp-topic { position: relative; isolation: isolate; min-height: 104px; padding: 12px; overflow: hidden; border-radius: 5px; background: var(--bg); color: #fff; }
.xp-topic img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.xp-topic::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(0,0,0,.58); }
.xp-topic-favorites { background: var(--accent); }
.xp-topic-favorites::before { background: rgba(0,0,0,.48); }
.xp-topic span { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.xp-topic .ic { width: 18px; height: 18px; flex: none; }
.xp-topic:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.xp-favorite { position: absolute; right: 2px; top: 2px; display: grid; place-items: center; color: var(--accent); background: var(--panel); border-radius: 4px; padding: 2px; }
.xp-favorite .ic { width: 12px; height: 12px; fill: currentColor; }
.xp-topics { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 12px; }
.xp-topics button { padding: 5px 9px; font-size: 12px; color: var(--text-2); background: var(--raised); border-radius: 6px; }
.xp-topics button:hover { color: var(--text); background: var(--hover); }
.xp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 180px; padding: 20px 12px; text-align: center; gap: 10px; }
.xp-empty b { font-size: 14px; font-weight: 600; }
.xp-empty p, .xp-notice { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.xp-notice { padding: 12px; }
.xp-empty .btn { margin-top: 6px; }
.xp-footer { display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 62px; border-top: 1px solid var(--line); flex: none; }
.xp-preview { width: 34px; height: 34px; flex: none; display: grid; place-items: center; font-size: 28px; }
.xp-preview img { width: 100%; height: 100%; object-fit: contain; }
.xp-item-name { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.xp-item-name b { font-size: 12px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.xp-item-name small { font-size: 11px; color: var(--text-2); }
.xp-footer .icon { flex: none; width: 32px; height: 32px; }
.xp-footer .icon[aria-pressed="true"] { color: var(--accent); }
.xp-footer .icon[aria-pressed="true"] .ic { fill: currentColor; }
.xp-hint { flex: 1; font-size: 12px; color: var(--text-2); }
.xp-attribution { font-size: 10px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.xp-more { width: 100%; margin: 12px 0; }
.xp-provider { margin: 18px 0 8px; color: var(--text-2); font-size: 12px; font-weight: 600; }
.custom-emoji { width: 1.55em; height: 1.55em; display: inline-block; vertical-align: -.35em; object-fit: contain; }
/* Telas estreitas: o palco empilha os blocos e a gaveta de canais fica em style.css. */
@media (max-width: 760px) {
  #stage:not(.full):not(.focus) .stage-main { display: flex; flex-direction: column; justify-content: flex-start; overflow-y: auto; }
  #stage:not(.full):not(.focus) .stage-main .tile { flex: none; width: 100%; min-height: 100px; }
  /* um bloco só: centraliza em vez de deixar um vazio enorme embaixo */
  #stage:not(.full):not(.focus) .stage-main:has(> .tile:only-child) { justify-content: center; }
  #stage:not(.full) .stage-strip { justify-content: flex-start; }
  .xp-media .xp-item { height: 104px; }
  .xp-tabs button { padding: 0 9px; }
}
