/* ============================================================
   TextCraft — Text to Image Generator
   Aesthetic: Dark studio / refined creative tool
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&display=swap');

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg:         #e0eaf7;
  --surface:    #0f172a;
  --surface2:   #21253a;
  --surface3:   #868686;
  --border:     #2a2f47;
  --border-hi:  #3d4460;
  --accent:     #6c63ff;
  --accent2:    #e040fb;
  --accent-glo: rgba(108,99,255,.25);
  --text-hi:    #f0f0ff;
  --text-md:    #9da3c4;
  --text-lo:    #bdbdbd;
  --danger:     #ff4b6b;
  --success:    #00d4aa;
  --warn:       #ffc947;
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --sidebar-w:  290px;
  --header-h:   54px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.4);
  --shadow:     0 4px 20px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.6);
  --font:       'DM Sans', system-ui, sans-serif;
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* ─── Reset ─────────────────────────────────────────────── */
#texttoimg-app{
      display: flex;
    flex-direction: column;
    min-height: calc(100vh - 32px);
     height: 100vh;
    /* padding: 2px; */
        width: 96%;
    margin: 16px auto;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.08);
    max-width: 1400px;
}


.ts-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}


.tools-placeholder {
  min-height: calc(100vh - var(--header-h));
  background:
    radial-gradient(circle at 14% 18%, rgba(108,99,255,.08), transparent 26%),
    radial-gradient(circle at 92% 20%, rgba(224,64,251,.05), transparent 20%),
    var(--bg);
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Header ─────────────────────────────────────────────── */
.app-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-radius: 5px 5px 0px 0px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text-hi);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-md);
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-header:hover { border-color: var(--accent); color: var(--text-hi); }
.btn-header.danger:hover { border-color: var(--danger); color: var(--danger); }

.btn-download {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: #fff;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 3px 16px rgba(108,99,255,.4);
}
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(108,99,255,.55); }
.btn-download:active { transform: translateY(0); }

/* ─── Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex: 1;
  gap: 20px;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
  min-height: calc(100vh - var(--header-h) - 48px);
}

.sidebar {
  max-height: calc(100vh - var(--header-h) - 0px);
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* border-radius: var(--radius); */
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 10px 0 10px 0;
}

/* ─── Tabs ───────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface2);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: none;
  background: transparent;
  color: var(--text-lo);
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
}
.tab-btn:hover { color: var(--text-md); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Tab Content ────────────────────────────────────────── */
.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  gap: 0;
}
.tab-content.active { display: flex; flex-direction: column; }

/* ─── Canvas Typing Hint ─────────────────────────────────── */
.canvas-type-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(108,99,255,.1);
  border: 1px solid rgba(108,99,255,.3);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 18px;
  animation: hintPulse 2.5s ease-in-out infinite;
}

.mobile-text-input-wrap {
  display: block;
  margin-bottom: 18px;
}

.mobile-text-input {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text-hi);
  padding: 10px 12px;
  font-family: var(--font);
  font-size: .92rem;
  line-height: 1.4;
  resize: vertical;
}

.mobile-text-input::placeholder {
  color: var(--text-lo);
}

@keyframes hintPulse {
  0%, 100% { border-color: rgba(108,99,255,.3); background: rgba(108,99,255,.08); }
  50% { border-color: rgba(108,99,255,.6); background: rgba(108,99,255,.15); }
}

/* ─── Sections ───────────────────────────────────────────── */
.section {
  margin-bottom: 18px;
}

.section-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-lo);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.section-label span { color: var(--accent); font-weight: 400; text-transform: none; letter-spacing: 0; }
.section-label-sm {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-lo);
  margin-bottom: 5px;
}
.section-label-sm span { color: var(--accent); }

/* ─── Select ─────────────────────────────────────────────── */
.select-wrap {
  position: relative;
}
.select-wrap select {
  width: 100%;
  appearance: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-hi);
  font-family: var(--font);
  font-size: .85rem;
  padding: 8px 32px 8px 10px;
  cursor: pointer;
  transition: var(--transition);
}
.select-wrap select:focus { outline: none; border-color: var(--accent); }
.select-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-lo);
}

/* ─── Range Sliders ──────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface3);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  accent-color: var(--accent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(0,0,0,.5), 0 0 0 3px var(--accent-glo);
  cursor: grab;
  transition: box-shadow var(--transition);
}
input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; box-shadow: 0 1px 6px rgba(0,0,0,.5), 0 0 0 5px var(--accent-glo); }

/* ─── Color Pickers ──────────────────────────────────────── */
.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-swatch {
  -webkit-appearance: none;
  width: 36px;
  height: 36px;
  border: 2px solid var(--border-hi);
  border-radius: var(--radius-sm);
  padding: 2px;
  background: var(--surface2);
  cursor: pointer;
  transition: border-color var(--transition);
}
.color-swatch.big { width: 44px; height: 44px; }
.color-swatch:hover { border-color: var(--accent); }
.color-swatch::-webkit-color-swatch-wrapper { padding: 0; border-radius: 4px; }
.color-swatch::-webkit-color-swatch { border: none; border-radius: 4px; }

.hex-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-hi);
  font-family: 'Fira Code', monospace;
  font-size: .8rem;
  padding: 8px 10px;
  transition: var(--transition);
}
.hex-input:focus { outline: none; border-color: var(--accent); }

/* ─── Button Groups ──────────────────────────────────────── */
.btn-group {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.btn-group.three .align-btn,
.btn-group.three .bg-type-btn { flex: 1; }

.align-btn, .bg-type-btn, .grad-type-btn, .img-fit-btn, .style-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--text-md);
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
}
.align-btn:hover, .bg-type-btn:hover, .grad-type-btn:hover, .img-fit-btn:hover, .style-btn:hover {
  color: var(--text-hi);
  background: var(--surface3);
}
.align-btn.active, .bg-type-btn.active, .grad-type-btn.active, .img-fit-btn.active, .style-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,99,255,.4);
}

/* ─── Two-col layout ─────────────────────────────────────── */
.row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field { display: flex; flex-direction: column; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-md);
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--text-hi); }
.full-width { width: 100%; margin-top: 10px; }

/* ─── Color Presets ──────────────────────────────────────── */
.color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.color-preset {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}
.color-preset:hover { transform: scale(1.15); border-color: rgba(255,255,255,.4); }

/* ─── BG Panels ──────────────────────────────────────────── */
.bg-panel { display: none; }
.bg-panel.active { display: block; }

/* ─── Gradient Presets ───────────────────────────────────── */
.gradient-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.grad-preset {
  height: 44px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}
.grad-preset:hover { transform: scale(1.04); border-color: rgba(255,255,255,.3); }

/* ─── Upload Zone ────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-hi);
  border-radius: var(--radius);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-lo);
  text-align: center;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(108,99,255,.06);
  color: var(--text-md);
}
.upload-zone p { font-size: .85rem; font-weight: 500; }
.upload-zone span { font-size: .72rem; }

/* ─── Toggle ─────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.toggle {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.toggle input { display: none; }
.toggle-track {
  width: 38px;
  height: 20px;
  background: var(--surface3);
  border: 1px solid var(--border-hi);
  border-radius: 99px;
  transition: var(--transition);
  position: relative;
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--text-lo);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: var(--transition);
}
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); background: #fff; }

/* ─── Effect Blocks ──────────────────────────────────────── */
.effect-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: none;
}
.effect-block.visible { display: block; }

/* ─── Preset Grid ────────────────────────────────────────── */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-md);
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}
.preset-btn:hover { border-color: var(--accent); color: var(--text-hi); }
.preset-btn.active { border-color: var(--accent); background: rgba(108,99,255,.12); color: var(--accent); }
.preset-btn span { font-size: .78rem; font-weight: 500; }
.preset-btn small { font-size: .65rem; color: var(--text-lo); }

.preset-icon {
  background: var(--border-hi);
  border-radius: 2px;
}
.preset-icon.square  { width: 22px; height: 22px; }
.preset-icon.portrait { width: 14px; height: 22px; }
.preset-icon.landscape { width: 26px; height: 16px; }
.preset-icon.wide { width: 28px; height: 15px; }
.preset-icon.banner { width: 30px; height: 10px; }

/* ─── Number Input ───────────────────────────────────────── */
.num-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-hi);
  font-family: var(--font);
  font-size: .85rem;
  padding: 8px 10px;
  transition: var(--transition);
}
.num-input:focus { outline: none; border-color: var(--accent); }

/* ─── Canvas Area ────────────────────────────────────────── */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  /* border-radius: var(--radius); */
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0,0,0,.24);
}

.canvas-toolbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.canvas-info { font-size: .75rem; color: var(--text-lo); font-weight: 500; }

.canvas-actions { display: flex; align-items: center; gap: 4px; width: 54%; justify-content: flex-end; max-width: 100%; }
.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-md);
  cursor: pointer;
  transition: var(--transition);
}
.tool-btn:hover { border-color: var(--accent); color: var(--text-hi); }
.zoom-label { font-size: .75rem; font-weight: 600; color: var(--text-md); padding: 0 8px; min-width: 44px; text-align: center; }

/* ─── Canvas Viewport ────────────────────────────────────── */
.canvas-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    radial-gradient(circle at 20% 50%, rgba(108,99,255,.07) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(224,64,251,.05) 0%, transparent 50%);
  background-color: var(--bg);
  position: relative;
}

/* Subtle grid background */
.canvas-viewport::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .3;
  pointer-events: none;
}

.canvas-wrapper {
  position: relative;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  box-shadow:
    0 0 0 1px var(--border),
    0 20px 60px rgba(0,0,0,.6),
    0 4px 16px rgba(0,0,0,.4);
  transform-origin: center;
  will-change: transform;
  max-width: 860px;
  max-height: 760px;
}

/* Canvas focused state: glowing border */
.canvas-wrapper.canvas-focused {
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 20px rgba(108,99,255,.35),
    0 20px 60px rgba(0,0,0,.6);
}

#mainCanvas {
  display: block;
  border-radius: var(--radius-sm);
  cursor: text;
  outline: none;
}

.drag-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-hi);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: .72rem;
  color: var(--text-md);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .4s;
}

/* ─── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-hi);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 9999;
  pointer-events: none;
  max-width: 320px;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.toast.confirm { min-width: 300px; }
.toast-message { display: block; margin-bottom: 10px; color: var(--text-hi); }
.toast-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.toast-btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.08);
  color: var(--text-hi);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: .82rem;
  cursor: pointer;
  transition: var(--transition);
}
.toast-btn:hover {
  background: rgba(255,255,255,.14);
}
.toast-confirm {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 820px) {
  :root { --sidebar-w: 260px; }
}

@media (max-width: 680px) {
  .app-layout { flex-direction: column-reverse; }
  .sidebar {
    width: 100%;
    height: 55vh;
    border-right: none;
    border-top: 1px solid var(--border);
  }
  .canvas-area { height: 45vh; }
  .canvas-viewport { padding: 16px; }
  .header-right .btn-header span,
  .btn-download span { display: none; }
  .btn-header, .btn-download { padding: 7px; }
  .mobile-text-input-wrap { display: block; }
}

@media (max-width: 480px) {
  .row-two { grid-template-columns: 1fr; }
  .preset-grid { grid-template-columns: repeat(4, 1fr); }
  .preset-btn small { display: none; }
  .btn-header { display: none; }
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.canvas-wrapper.rendering { animation: pulse .4s ease; }

/* ─── Focus visible ──────────────────────────────────────── */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* ─── Emoji Picker Modal ─────────────────────────────── */
.emoji-picker-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.emoji-picker-modal.show {
  display: flex;
  animation: modalFadeIn .25s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.emoji-picker-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.emoji-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}

.emoji-picker-header h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-hi);
  font-family: var(--font);
}

.emoji-picker-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-md);
  cursor: pointer;
  transition: var(--transition);
}
.emoji-picker-close:hover {
  border-color: var(--accent);
  color: var(--text-hi);
}

.emoji-picker-search {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.emoji-search-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-hi);
  font-family: var(--font);
  font-size: .85rem;
  padding: 10px 12px;
  transition: var(--transition);
}
.emoji-search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.emoji-search-input::placeholder {
  color: var(--text-lo);
}

.emoji-categories {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
  overflow-x: auto;
}

.emoji-category-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.emoji-category-btn:hover {
  border-color: var(--border-hi);
  background: rgba(108,99,255,.08);
}
.emoji-category-btn.active {
  border-color: var(--accent);
  background: rgba(108,99,255,.15);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition);
  padding: 8px;
}
.emoji-item:hover {
  background: var(--surface3);
  border-color: var(--accent);
  transform: scale(1.1);
}
.emoji-item:active {
  transform: scale(.95);
}

@media (max-width: 480px) {
  .emoji-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .emoji-picker-content {
    width: 95%;
    max-height: 70vh;
  }
}
