/* ╔══════════════════════════════════════════════════════════════╗
   ║  Himmelsgeflüster Editor — Deep-Space Observatory Theme     ║
   ╚══════════════════════════════════════════════════════════════╝ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Design Tokens ────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-void:      #05080f;
  --bg-base:      #090e1a;
  --bg-panel:     #0d1424;
  --bg-elevated:  #111827;
  --bg-card:      #141d30;
  --bg-hover:     #1a2540;
  --bg-input:     #080d19;

  /* Borders */
  --border-faint:  rgba(148, 163, 184, 0.06);
  --border:        rgba(148, 163, 184, 0.11);
  --border-strong: rgba(148, 163, 184, 0.18);
  --border-accent: rgba(56, 189, 248, 0.35);

  /* Accents */
  --cyan:          #38bdf8;
  --cyan-dim:      rgba(56, 189, 248, 0.12);
  --cyan-glow:     rgba(56, 189, 248, 0.28);
  --violet:        #a78bfa;
  --violet-dim:    rgba(167, 139, 250, 0.12);
  --emerald:       #34d399;
  --emerald-dim:   rgba(52, 211, 153, 0.12);
  --amber:         #fbbf24;
  --amber-dim:     rgba(251, 191, 36, 0.12);
  --rose:          #fb7185;
  --rose-dim:      rgba(251, 113, 133, 0.12);

  /* Text */
  --text-bright:   #f1f5f9;
  --text-primary:  #cbd5e1;
  --text-secondary:#64748b;
  --text-muted:    #374151;

  /* Radii */
  --r-sm:   8px;
  --r:      11px;
  --r-lg:   14px;
  --r-xl:   18px;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
  --shadow:    0 4px 16px rgba(0,0,0,0.55);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.7);
  --glow-cyan: 0 0 20px rgba(56, 189, 248, 0.18);

  /* Fonts */
  --font-display: 'Sora', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t:    0.17s;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ── Scrollbars ──────────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.12) transparent;
}
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.15);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.28); }

/* ── App Layout ──────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 300px 1fr 380px;
  height: 100vh;
  transition: grid-template-columns var(--t) var(--ease);
}
.app.left-collapsed               { grid-template-columns: 12px 1fr 380px; }
.app.right-collapsed              { grid-template-columns: 300px 1fr 12px; }
.app.left-collapsed.right-collapsed { grid-template-columns: 12px 1fr 12px; }

/* ── Panels ──────────────────────────────────────────────────── */
.panel {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow: auto;
}
.panel.right {
  border-right: none;
  border-left: 1px solid var(--border);
}

.sidebar { position: relative; min-width: 0; }
.sidebar.collapsed { overflow: hidden; }
.sidebar-left.collapsed  > *:not(.pin-btn) { opacity: 0; pointer-events: none; }
.sidebar-right.collapsed > *:not(.pin-btn) { opacity: 0; pointer-events: none; }

/* ── Pin Button ──────────────────────────────────────────────── */
.pin-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 20;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}
.pin-btn:hover {
  border-color: var(--border-accent);
  color: var(--cyan);
  background: var(--cyan-dim);
}
.pin-btn.active {
  background: var(--cyan-dim);
  border-color: var(--border-accent);
  color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

/* ── Sidebar Toggle (floating) ───────────────────────────────── */
.sidebar-toggle {
  position: fixed;
  top: 12px;
  z-index: 60;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), color var(--t), box-shadow var(--t);
}
.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--cyan);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
}
.sidebar-toggle-left  { left: 8px; }
.sidebar-toggle-right { right: 8px; }
.sidebar-toggle.hidden { display: none; }

/* ── Sections ────────────────────────────────────────────────── */
.section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
}

h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.muted {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
  opacity: 0.8;
}

/* ── Form Elements ───────────────────────────────────────────── */
input, textarea, select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
input::placeholder, textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--border-accent);
  background: var(--bg-input);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
input[disabled], textarea[disabled], select[disabled] {
  background: var(--bg-panel);
  color: var(--text-secondary);
  opacity: 0.45;
  cursor: not-allowed;
}
textarea {
  min-height: 90px;
  resize: vertical;
}

/* Custom select arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* File input */
input[type="file"] {
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
}
input[type="file"]::-webkit-file-upload-button {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 3px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
  margin-right: 8px;
  transition: background var(--t), border-color var(--t);
}
input[type="file"]::-webkit-file-upload-button:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
}

/* Number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  filter: invert(1) opacity(0.3);
}

/* ── Buttons ─────────────────────────────────────────────────── */
button {
  width: 100%;
  padding: 8px 14px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--cyan);
  color: #020c18;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  line-height: 1.4;
  transition:
    background var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    transform 0.1s var(--ease),
    border-color var(--t) var(--ease),
    color var(--t) var(--ease),
    opacity var(--t) var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover {
  background: #7dd3fc;
  box-shadow: 0 0 18px var(--cyan-glow);
}
button:active {
  transform: scale(0.96);
}

button.secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
button.secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
  color: var(--cyan);
  box-shadow: none;
}

button.danger {
  background: var(--rose-dim);
  color: var(--rose);
  border-color: rgba(251, 113, 133, 0.25);
}
button.danger:hover {
  background: rgba(251, 113, 133, 0.20);
  border-color: var(--rose);
  box-shadow: 0 0 14px rgba(251,113,133,0.18);
  color: #fecdd3;
}

button.ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
button.ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: none;
}

/* ── Layout Utilities ────────────────────────────────────────── */
.row   { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.stack { display: grid; gap: 8px; }

/* ── Story List ──────────────────────────────────────────────── */
.story-list { display: grid; gap: 5px; }
.story-item {
  border: 1px solid var(--border);
  padding: 9px 12px;
  border-radius: var(--r);
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color var(--t), background var(--t), color var(--t);
}
.story-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}
.story-item.active {
  border-color: var(--border-accent);
  background: var(--cyan-dim);
  color: var(--cyan);
}

/* ── Canvas ──────────────────────────────────────────────────── */
.canvas-wrap {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-void);
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  cursor: grab;
}
.canvas-wrap.panning       { cursor: grabbing; }
.canvas-wrap.node-dragging { cursor: default; }

.canvas-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  background: rgba(9, 14, 26, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.canvas-stage {
  position: relative;
  width: 100%;
  height: calc(100% - 46px);
  overflow: hidden;
}

.canvas-scale { transform-origin: 0 0; position: absolute; top: 0; left: 0; }
.canvas { position: relative; width: 20000px; height: 20000px; }
svg#connections { position: absolute; inset: 0; pointer-events: none; overflow: visible; }

/* ── Nodes ───────────────────────────────────────────────────── */
.node {
  position: absolute;
  width: 240px;
  min-height: 88px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: move;
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
}
.node:hover {
  border-color: rgba(148, 163, 184, 0.26);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.node.selected {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 2px var(--cyan-dim), var(--shadow-lg), var(--glow-cyan);
  transform: none;
}
.node.incomplete {
  border-color: rgba(251, 113, 133, 0.45) !important;
  box-shadow: 0 0 0 2px rgba(251,113,133,0.12), var(--shadow) !important;
}
.node.incomplete .node-header {
  background: rgba(251,113,133,0.10) !important;
  color: var(--rose) !important;
}

/* Node type headers */
.node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.node.message .node-header {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-bottom-color: rgba(56,189,248,0.14);
}
.node.choice .node-header {
  background: var(--emerald-dim);
  color: var(--emerald);
  border-bottom-color: rgba(52,211,153,0.14);
}
.node.image .node-header {
  background: var(--violet-dim);
  color: var(--violet);
  border-bottom-color: rgba(167,139,250,0.14);
}
.node.end .node-header {
  background: var(--rose-dim);
  color: var(--rose);
  border-bottom-color: rgba(251,113,133,0.14);
}

.node-body {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
  white-space: normal;
}

.node-footer {
  padding: 8px 10px;
  border-top: 1px solid var(--border-faint);
  display: flex;
  gap: 6px;
}

/* ── Mini Buttons (in nodes) ─────────────────────────────────── */
.mini-btn {
  padding: 5px 10px;
  font-size: 10.5px;
  border-radius: var(--r-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border);
}
.mini-btn:hover {
  background: var(--bg-hover);
  color: var(--cyan);
  border-color: var(--border-accent);
  box-shadow: none;
}

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(56,189,248,0.25);
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.badge.warn {
  background: var(--rose-dim);
  color: var(--rose);
  border-color: rgba(251,113,133,0.25);
}

/* ── Choice Chips (node preview) ─────────────────────────────── */
.choice-preview { margin-top: 8px; display: grid; gap: 5px; }
.choice-chip {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
}
.choice-chip[data-color="0"] { border-left: 3px solid #3b82f6; }
.choice-chip[data-color="1"] { border-left: 3px solid #10b981; }
.choice-chip[data-color="2"] { border-left: 3px solid #f59e0b; }
.choice-chip[data-color="3"] { border-left: 3px solid #ef4444; }

/* ── Choice Editor (right panel) ────────────────────────────── */
.choice-item {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  background: var(--bg-card);
  transition: border-color var(--t);
}
.choice-item:hover { border-color: var(--border-strong); }
.choice-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.choice-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 5px currentColor;
}

/* ── Status & Info ───────────────────────────────────────────── */
.status {
  font-size: 12px;
  font-weight: 500;
  color: var(--emerald);
}

.zoom-label {
  min-width: 52px;
  text-align: center;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-secondary);
}

.helper-note {
  padding: 9px 12px;
  border-radius: var(--r);
  background: rgba(56,189,248,0.05);
  border: 1px solid rgba(56,189,248,0.10);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Images ──────────────────────────────────────────────────── */
.image-thumb {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.node-image-preview { margin-top: 8px; }
.node-image-preview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

/* ── Inline Hint ─────────────────────────────────────────────── */
.inline-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-hint button {
  width: auto;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 11px;
}

#storyProfileImageEditor { margin-top: 6px; }

/* ── Emoji Picker ────────────────────────────────────────────── */
.textarea-wrap { position: relative; }
.textarea-wrap textarea { width: 100%; box-sizing: border-box; }

.emoji-picker-btn {
  position: absolute;
  bottom: 8px;
  right: 7px;
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: var(--r-sm);
  opacity: 0.45;
  transition: opacity var(--t), background var(--t);
  z-index: 5;
  width: auto;
  min-width: unset;
}
.emoji-picker-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.05);
}

.emoji-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  width: 264px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0,0,0,0.5);
  z-index: 9999;
  padding: 10px;
}

.emoji-search-row { margin-bottom: 8px; }
.emoji-search-row input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 12.5px;
  background: var(--bg-input);
  color: var(--text-primary);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
}

.emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  height: 30px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t);
  user-select: none;
}
.emoji-item:hover { background: rgba(255,255,255,0.06); }

/* ── First section header (app title) ───────────────────────── */
.section:first-child h1::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ── Canvas toolbar buttons override ────────────────────────── */
.canvas-toolbar button {
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
  min-width: auto;
}
.canvas-toolbar button:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
  color: var(--cyan);
  box-shadow: none;
}

/* ── Subtle star-field overlay on canvas ─────────────────────── */
.canvas-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 12% 15%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 42%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 56% 8%,  rgba(255,255,255,0.30) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 61%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1px 1px at 91% 30%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 22% 77%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 66% 82%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 55%, rgba(255,255,255,0.15) 0%, transparent 100%);
  opacity: 0.6;
}

/* ── Focus-visible (accessibility) ─────────────────────────── */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
/* ── Emoji Picker ── */
.textarea-wrap { position: relative; }
.textarea-wrap textarea { width: 100%; box-sizing: border-box; }

.emoji-picker-btn {
  position: absolute;
  bottom: 8px;
  right: 6px;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
  opacity: 0.7;
  transition: opacity .15s, background .15s;
  z-index: 5;
  width: auto;
  min-width: unset;
}
.emoji-picker-btn:hover { opacity: 1; background: rgba(0,0,0,.06); }

.emoji-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  width: 260px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  z-index: 9999;
  padding: 8px;
}
.emoji-search-row { margin-bottom: 6px; }
.emoji-search-row input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
}
.emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  height: 30px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .1s;
  user-select: none;
}
.emoji-item:hover { background: #f3f4f6; }
