.cheerio-shell {
  font-family: var(--nio-font-sans, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 42%);
}

.cheerio-wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

@media (min-width: 640px) {
  .cheerio-wrap {
    padding: 2rem 2rem 3rem;
  }
}

.cheerio-disclaimer {
  border: 1px solid #fde68a;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-radius: 1rem;
  padding: 1rem 1.15rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #78350f;
  box-shadow: 0 1px 2px rgba(120, 53, 15, 0.06);
}

.cheerio-disclaimer strong {
  color: #92400e;
}

.cheerio-disclaimer a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cheerio-stage {
  margin-top: 1.5rem;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 1.25rem;
  overflow: visible;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 40px rgba(15, 23, 42, 0.06);
}

.cheerio-canvas {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(68vh, 520px);
  padding: 1.25rem;
  background: #ffffff;
  border-radius: 1.25rem 1.25rem 0 0;
  overflow: hidden;
}

#meme-image {
  max-width: 100%;
  max-height: min(68vh, 520px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.65rem;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#meme-image.is-loading {
  opacity: 0.35;
  transform: scale(0.985);
}

#loading {
  display: none;
}

#loading.active {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
}

.cheerio-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 3px solid #e4e4e7;
  border-top-color: #2563eb;
  animation: cheerio-spin 0.75s linear infinite;
}

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

.cheerio-footer {
  border-top: 1px solid #f4f4f5;
  padding: 1.15rem 1.25rem 1.35rem;
  background: #ffffff;
  border-radius: 0 0 1.25rem 1.25rem;
}

.cheerio-caption {
  padding: 0.9rem 1.1rem;
  min-height: 4.5rem;
  background: #f8fafc;
  border: 1px solid #e4e4e7;
  border-radius: 0.85rem;
}

#meme-title {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 500;
  color: #3f3f46;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.cheerio-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.cheerio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.72rem 1.15rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.cheerio-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cheerio-btn--ghost {
  color: #3f3f46;
  background: #ffffff;
  border: 1px solid #d4d4d8;
}

.cheerio-btn--ghost:hover:not(:disabled) {
  background: #fafafa;
  border-color: #a1a1aa;
}

.cheerio-btn--primary {
  color: #ffffff;
  background: #2563eb;
  border: 1px solid #2563eb;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.cheerio-btn--primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.cheerio-btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

