/* NeXtMail – Emoji-Auswahl (emoji.css). Gemeinsam für Web-Oberfläche und Windows-Client.
   Farben nur über die CSS-Variablen der Seite (mit Rückfall); Dunkel kommt über html[data-theme=dark]. */

.nm-emoji-kn[aria-expanded="true"] { color: var(--akzent-text, #3451c7); background: var(--accent-soft, var(--sel, #e8edfe)); }

.nm-emoji-pop {
  position: fixed; z-index: 10000; left: 0; top: 0;
  width: 352px; height: 380px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel, #fff); color: var(--text, #1c2431);
  border: 1px solid var(--line, #e3e8f0); border-radius: var(--radius, 8px);
  box-shadow: var(--schatten, 0 8px 28px rgba(20, 30, 50, .14));
  font: 13px/1.4 var(--schrift, "Segoe UI", system-ui, -apple-system, sans-serif);
  text-align: left;
}
.nm-emoji-pop *, .nm-emoji-pop *::before, .nm-emoji-pop *::after { box-sizing: border-box; }
.nm-emoji-pop[hidden], .nm-emoji-pop [hidden] { display: none !important; }
.nm-emoji-pop button { font: inherit; color: inherit; margin: 0; -webkit-tap-highlight-color: transparent; }
.nm-emoji-pop button:focus, .nm-emoji-pop .nm-emoji-suche:focus { outline: 2px solid var(--accent, #3b5bdb); outline-offset: -2px; }
.nm-emoji-pop button:focus:not(:focus-visible) { outline: none; }

.nm-emoji-pop .nm-emoji-e, .nm-emoji-pop .nm-emoji-reiter-kn, .nm-emoji-pop .nm-emoji-haut-kn,
.nm-emoji-pop .nm-emoji-haut-opt, .nm-emoji-pop .nm-emoji-fuss-e {
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-weight: normal; font-style: normal;
}

/* Kopf: Suche + Hautfarbe */
.nm-emoji-kopf { position: relative; flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 8px 6px; }
.nm-emoji-pop .nm-emoji-suche {
  flex: 1 1 auto; min-width: 0; height: 32px; margin: 0; padding: 0 10px;
  border: 1px solid var(--line, #e3e8f0); border-radius: var(--radius, 8px);
  background: var(--panel2, #f8fafc); color: var(--text, #1c2431);
  font: inherit; font-size: 14px; -webkit-appearance: none; appearance: none;
}
.nm-emoji-suche::placeholder { color: var(--muted, #56616f); opacity: 1; }
.nm-emoji-pop .nm-emoji-haut-kn {
  flex: none; width: 32px; height: 32px; padding: 0; cursor: pointer; font-size: 18px; line-height: 1;
  border: 1px solid var(--line, #e3e8f0); border-radius: var(--radius, 8px); background: var(--panel2, #f8fafc);
}
.nm-emoji-haut-kn:hover, .nm-emoji-haut-kn[aria-expanded="true"] { background: var(--hover, #f1f4fb); }
.nm-emoji-haut-liste {
  position: absolute; z-index: 3; top: 42px; right: 8px; display: flex; gap: 2px; padding: 4px;
  background: var(--panel, #fff); border: 1px solid var(--line, #e3e8f0); border-radius: var(--radius, 8px);
  box-shadow: var(--schatten, 0 8px 28px rgba(20, 30, 50, .14));
}
.nm-emoji-pop .nm-emoji-haut-opt {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 6px; background: transparent;
  cursor: pointer; font-size: 20px; line-height: 1;
}
.nm-emoji-haut-opt:hover { background: var(--hover, #f1f4fb); }
.nm-emoji-haut-opt[aria-checked="true"] { background: var(--sel, #e8edfe); box-shadow: inset 0 0 0 1px var(--accent, #3b5bdb); }

/* Reiter der Gruppen */
.nm-emoji-reiter {
  flex: none; display: flex; padding: 0 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  border-bottom: 1px solid var(--line, #e3e8f0);
}
.nm-emoji-reiter::-webkit-scrollbar { display: none; }
.nm-emoji-pop .nm-emoji-reiter-kn {
  flex: 1 0 30px; min-width: 30px; height: 34px; padding: 0; cursor: pointer; font-size: 17px; line-height: 1;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent;
  opacity: .6; filter: grayscale(.5);
}
.nm-emoji-reiter-kn:hover { opacity: 1; filter: none; background: var(--hover, #f1f4fb); }
.nm-emoji-pop .nm-emoji-reiter-kn.nm-emoji-an { opacity: 1; filter: none; border-bottom-color: var(--accent, #3b5bdb); }

/* Raster */
.nm-emoji-raster {
  position: relative; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto;
  padding: 0 6px 6px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.nm-emoji-titel {
  position: sticky; top: 0; z-index: 1; padding: 8px 4px 4px;
  background: var(--panel, #fff); color: var(--muted, #56616f); font-size: 12px; font-weight: 600;
}
.nm-emoji-zeilen { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); justify-items: center; }
.nm-emoji-pop .nm-emoji-e {
  width: 38px; max-width: 100%; height: 38px; padding: 0; border: 0; border-radius: 6px; background: transparent;
  cursor: pointer; font-size: 24px; line-height: 38px; text-align: center; overflow: hidden; white-space: nowrap;
}
.nm-emoji-pop .nm-emoji-e:hover { background: var(--hover, #f1f4fb); }
.nm-emoji-pop .nm-emoji-e:focus { background: var(--sel, #e8edfe); }
.nm-emoji-leer { padding: 40px 12px; text-align: center; color: var(--muted, #56616f); }

/* Fußzeile mit Namen */
.nm-emoji-fuss {
  flex: none; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  border-top: 1px solid var(--line, #e3e8f0); background: var(--panel2, #f8fafc); color: var(--muted, #56616f);
}
.nm-emoji-fuss-e { flex: none; font-size: 20px; line-height: 1; }
.nm-emoji-fuss-n { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Schmale Fenster (bis 480px): Blatt unten über die volle Breite */
.nm-emoji-pop.nm-emoji-blatt {
  left: 0 !important; right: 0; top: auto !important; bottom: 0;
  width: 100%; max-width: none; height: 50vh; max-height: none;
  border-width: 1px 0 0; border-radius: 12px 12px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 480px) {
  .nm-emoji-pop {
    left: 0 !important; right: 0; top: auto !important; bottom: 0;
    width: 100%; max-width: none; height: 50vh; max-height: none;
    border-width: 1px 0 0; border-radius: 12px 12px 0 0;
  }
  .nm-emoji-pop .nm-emoji-e { height: 40px; line-height: 40px; }
}
