.greetings-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 24px;
  flex: 1;
}

.greetings-beta-banner {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 6px 14px;
  text-align: center;
}

#greetings_animation_container {
  position: relative;
  width: 675px;
  height: 300px;
  background: #999;
  border-radius: 4px;
  overflow: visible;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#greetings_canvas {
  position: absolute;
  display: block;
  background: #999;
}

#greetings_dom_overlay {
  pointer-events: none;
  overflow: hidden;
  width: 675px;
  height: 300px;
  position: absolute;
  left: 0; top: 0;
  display: block;
}

/* ── Character picker (mirrors Studio cv-char-list pattern) ── */
.greetings-char-picker {
  width: 675px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.greetings-picker-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.greetings-char-list-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 180px;
  scrollbar-width: thin;
}

.greetings-char-list-wrap::-webkit-scrollbar { width: 8px; }

.greetings-char-list-wrap::-webkit-scrollbar-track {
  background: var(--chrome-lo);
  border-left: 1px solid var(--border);
  border-radius: 0 8px 8px 0;
}

.greetings-char-list-wrap::-webkit-scrollbar-thumb {
  background: var(--border-lo);
  border: 2px solid var(--chrome-lo);
  border-radius: 4px;
  min-height: 28px;
}

.greetings-char-list-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.greetings-char-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 4px;
  padding: 5px;
  box-sizing: border-box;
}

.greetings-char-btn {
  background: linear-gradient(180deg, #f6f6f6 0%, #e8e8e8 100%);
  border: none;
  outline: none;
  border-radius: 5px;
  padding: 4px 2px 3px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  width: 100%;
  height: 72px;
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), background 0.15s ease;
  will-change: transform;
}

.greetings-char-btn:hover {
  background: linear-gradient(180deg, #f0f0f0 0%, #e2e2e2 100%);
  transform: translateY(-3px);
}

.greetings-char-btn.active {
  background: linear-gradient(180deg, rgba(74,158,192,0.2) 0%, rgba(42,126,160,0.12) 100%);
}

.greetings-char-btn.active:hover { transform: translateY(0); }
.greetings-char-btn:focus { outline: none; }

.greetings-char-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.greetings-char-thumb img {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  flex-shrink: 0;
  image-rendering: pixelated;
  display: block;
}

.greetings-char-label {
  font-size: 9px;
  color: var(--text-dim);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 4px);
  line-height: 1.3;
  pointer-events: none;
}

.greetings-char-btn.active .greetings-char-label {
  color: var(--accent-text);
}

/* ── Loading overlay (ported from Studio pattern) ── */
.greetings-loading {
  position: absolute;
  inset: 0;
  background: rgba(200,205,212,0.55);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-mid);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.greetings-loading.show {
  opacity: 1;
  pointer-events: all;
}

.greetings-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: greetings-spin 0.7s linear infinite;
}

@keyframes greetings-spin {
  to { transform: rotate(360deg); }
}

.tab-badge.beta {
  font-size: 9px;
  font-weight: 700;
  background: #f59e0b;
  color: #fff;
  border-radius: 3px;
  padding: 1px 5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
