/*
 * Wabi DS — Web
 *
 * Mirror of @wabi/web-sdk (react-native-app-template/web-sdk).
 * Source of truth for the WEB Wabi design system.
 *
 * For plain HTML: include this file + use .wabi-* classes.
 * For React: import { ButtonWeb, WabiThemeProviderWeb } from '@wabi/web-sdk' instead.
 *
 * This file aggregates:
 *   web-sdk/src/components/wabi-components.css
 *   web-sdk/src/components/widget/widget.css
 *   web-sdk/src/components/styles/app-orb.css
 *   + default color tokens from WabiThemeProvider (DEFAULT_PALETTE)
 */

@import './fonts.css';

/* === Default color tokens (from WabiThemeProvider DEFAULT_PALETTE) ===
 * Override these by setting them on a wrapper element with the wabi-theme-root class.
 */
:root,
.wabi-theme-root {
  --wabi-color-primary:        #007AFF;
  --wabi-color-secondary:      #5856D6;
  --wabi-color-background:     #FFFFFF;
  --wabi-color-surface:        #F2F2F7;
  --wabi-color-text:           #000000;
  --wabi-color-text-inverse:   #FFFFFF;
  --wabi-color-border:         #E5E5EA;
  --wabi-color-success:        #34C759;
  --wabi-color-warning:        #FF9500;
  --wabi-color-error:          #FF3B30;
}

/* === Base reset === */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--wabi-color-background);
  color: var(--wabi-color-text);
  font-family: 'Selecta', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ───────────────────────────────────────────────────────────────
   FROM: web-sdk/src/components/wabi-components.css
   ─────────────────────────────────────────────────────────────── */

/* ============================================
   Wabi Web Components — Base Styles & Animations
   ============================================ */

/* --- Font stacks ---
 *
 * Use these CSS custom properties for consistent typography across apps.
 * Actual @font-face declarations live in the app's fonts.css.
 *
 * Sans:  'Selecta', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif
 * Serif: 'CaslonIonic', Georgia, 'Times New Roman', serif
 * Mono:  'IBM Plex Mono', 'SF Mono', Menlo, Consolas, monospace
 *
 * Available font families (set via font-family in CSS):
 *   Sans-serif : Selecta (default), Inter, Graphik, Space Grotesk, Neue Haas Grotesk, CoFo Sona
 *   Serif      : CaslonIonic (default), Canela, EB Garamond, Newsreader, Orleans, Fraunces, Delusse, Terza Reader, William Text
 *   Display    : Mattone (bold wide), CoFo Kak (bold narrow)
 *   Monospace  : IBM Plex Mono, ABC Monument Grotesk Semi-Mono, ABC Diatype Mono
 */

/* --- Typography utilities ---
 *
 * Use semantic HTML (h1–h4, p, span, label) with these classes
 * instead of a Typography React component.
 */

.wabi-h1 { font-size: 28px; font-weight: 700; line-height: 1.2; }
.wabi-h2 { font-size: 22px; font-weight: 700; line-height: 1.25; }
.wabi-h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.wabi-h4 { font-size: 16px; font-weight: 600; line-height: 1.35; }

.wabi-body-lg { font-size: 17px; font-weight: 400; line-height: 1.5; }
.wabi-body-lg-medium { font-size: 17px; font-weight: 500; line-height: 1.5; }
.wabi-body { font-size: 15px; font-weight: 400; line-height: 1.5; }
.wabi-body-medium { font-size: 15px; font-weight: 500; line-height: 1.5; }
.wabi-body-sm { font-size: 13px; font-weight: 400; line-height: 1.45; }
.wabi-body-sm-medium { font-size: 13px; font-weight: 500; line-height: 1.45; }
.wabi-body-xs { font-size: 11px; font-weight: 400; line-height: 1.4; }

.wabi-label { font-size: 11px; font-weight: 600; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.5px; }
.wabi-meta { font-size: 12px; font-weight: 400; line-height: 1.4; color: #888; }

.wabi-number-lg { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wabi-number-sm { font-size: 16px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.wabi-button-mono { font-size: 14px; font-weight: 600; line-height: 1.3; font-family: 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, monospace; }

/* Line clamping utility: set --lines via inline style */
.wabi-clamp {
  display: -webkit-box;
  -webkit-line-clamp: var(--lines, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Loading utilities (CSS-only, no React component needed) --- */

.wabi-skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.01) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: wabi-skeleton-shimmer 2.5s ease-in-out infinite;
}

.wabi-spinner {
  border: 2px solid rgba(0,0,0,0.08);
  border-top-color: var(--wabi-color-primary, #007AFF);
  border-radius: 50%;
  animation: wabi-spin 0.8s linear infinite;
}

/* --- Pressable scale (CSS-only, no React component needed) --- */

.wabi-pressable { cursor: pointer; transition: transform 0.15s ease; user-select: none; }
.wabi-pressable:active { transform: scale(0.98); }
.wabi-pressable[disabled] { cursor: default; pointer-events: none; }

/* --- FontAwesome icon helper (CSS-only, no React component needed) ---
 *
 * Usage: <i class="fa-solid fa-heart" style="font-size: 16px; color: red;"></i>
 * Outline: <i class="fa-regular fa-heart"></i>
 * Legacy "-o" suffix: use fa-regular instead (e.g. fa-regular fa-heart)
 */

/* --- Form field label (CSS-only) --- */

.wabi-form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(62, 62, 62, 0.5);
  margin-bottom: 6px;
}

/* --- App header (CSS-only, use semantic <header> element) --- */

.wabi-app-header { padding: 16px 0; }
.wabi-app-header__title { font-size: 28px; font-weight: 700; margin: 0 0 4px; }
.wabi-app-header__subtitle { font-size: 15px; color: #888; margin: 0; }

/* --- Keyframes --- */

@keyframes wabi-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes wabi-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes wabi-jelly-bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* --- Markdown --- */

.wabi-markdown { font-family: 'Selecta', -apple-system, sans-serif; font-size: 16px; line-height: 1.6; }
.wabi-markdown--light { color: #1a1a1a; }
.wabi-markdown--dark { color: #e8e8e8; }
.wabi-markdown__heading { margin: 16px 0 8px; }
.wabi-markdown__heading--1 { font-size: 24px; font-weight: 700; }
.wabi-markdown__heading--2 { font-size: 20px; font-weight: 700; }
.wabi-markdown__heading--3 { font-size: 17px; font-weight: 600; }
.wabi-markdown__heading--4 { font-size: 16px; font-weight: 600; }
.wabi-markdown__paragraph { margin: 8px 0; font-size: 16px; }
.wabi-markdown__list { margin: 8px 0; padding-left: 24px; }
.wabi-markdown__list-item { margin: 4px 0; font-size: 16px; }
.wabi-markdown ol,
.wabi-markdown ul { margin: 8px 0; padding-left: 24px; }
.wabi-markdown li { margin: 18px 0; font-size: 16px; list-style-position: outside; padding-left: 12px; }
.wabi-markdown li > p { margin: 0; display: inline; }
.wabi-markdown li span { display: inline !important; white-space: normal !important; }
.wabi-markdown p span { display: inline !important; white-space: normal !important; }
.wabi-markdown p { margin: 8px 0; font-size: 16px; }
.wabi-markdown h1 { font-size: 24px; font-weight: 700; margin: 16px 0 8px; }
.wabi-markdown h2 { font-size: 20px; font-weight: 700; margin: 16px 0 8px; }
.wabi-markdown h3 { font-size: 17px; font-weight: 600; margin: 16px 0 8px; }
.wabi-markdown h4 { font-size: 16px; font-weight: 600; margin: 16px 0 8px; }
.wabi-markdown a { color: var(--wabi-color-primary, #007AFF); text-decoration: none; }
.wabi-markdown a:hover { text-decoration: underline; }
.wabi-markdown code { background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: 'SF Mono', Menlo, monospace; }
.wabi-markdown pre { background: rgba(0,0,0,0.04); padding: 12px 16px; border-radius: 8px; overflow-x: auto; font-size: 13px; font-family: 'SF Mono', Menlo, monospace; line-height: 1.5; margin: 12px 0; }
.wabi-markdown pre code { background: none; padding: 0; }
.wabi-markdown blockquote { border-left: 3px solid var(--wabi-color-primary, #007AFF); margin: 12px 0; padding: 4px 16px; color: #666; }
.wabi-markdown hr { border: none; border-top: 1px solid #e0e0e0; margin: 16px 0; }
.wabi-markdown strong { font-weight: 700; }
.wabi-markdown__divider { border: none; border-top: 1px solid #e0e0e0; margin: 16px 0; }
.wabi-markdown__link-ref {
  color: var(--wabi-color-primary, #007AFF);
  text-decoration: none;
  font-size: 12px;
  vertical-align: super;
  font-weight: 600;
}
.wabi-markdown__links { margin-top: 16px; padding-top: 12px; border-top: 1px solid #e0e0e0; }
.wabi-markdown__links-title { font-size: 13px; font-weight: 600; color: #888; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.wabi-markdown__links-item { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--wabi-color-primary, #007AFF); text-decoration: none; margin: 4px 0; }
.wabi-markdown__links-item:hover { text-decoration: underline; }
.wabi-markdown__links-index { font-weight: 600; font-size: 11px; }
.wabi-markdown__link { color: var(--wabi-color-primary, #007AFF); text-decoration: none; }
.wabi-markdown__link:hover { text-decoration: underline; }
.wabi-markdown__code-inline { background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: 'SF Mono', Menlo, monospace; }
.wabi-markdown__code-block { background: rgba(0,0,0,0.04); padding: 12px 16px; border-radius: 8px; overflow-x: auto; font-size: 13px; font-family: 'SF Mono', Menlo, monospace; line-height: 1.5; margin: 12px 0; }
.wabi-markdown__code-block code { background: none; padding: 0; }
.wabi-markdown__blockquote { border-left: 3px solid var(--wabi-color-primary, #007AFF); margin: 12px 0; padding: 4px 16px; color: #666; }
.wabi-markdown--dark .wabi-markdown__divider { border-color: #333; }
.wabi-markdown--dark .wabi-markdown__code-inline { background: rgba(255,255,255,0.1); }
.wabi-markdown--dark .wabi-markdown__code-block { background: rgba(255,255,255,0.06); }
.wabi-markdown--dark .wabi-markdown__blockquote { color: #aaa; }

/* --- Button --- */

.wabi-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; font-family: 'Selecta', -apple-system, sans-serif;
  font-weight: 600; cursor: pointer; transition: transform 0.15s ease, opacity 0.15s ease;
  white-space: nowrap; outline: none;
}
.wabi-button--primary { background: var(--wabi-color-primary, #007AFF); color: #fff; }
.wabi-button--secondary { background: var(--wabi-color-surface, #F2F2F7); color: var(--wabi-color-text, #000); }
.wabi-button--glass { background: rgba(255,255,255,0.15); backdrop-filter: blur(10px); color: #fff; }
.wabi-button--full { width: 100%; }
.wabi-button:hover:not(:disabled) { opacity: 0.92; }
.wabi-button--disabled { opacity: 0.4; cursor: default; }
.wabi-button--pressed { transform: scale(0.98); }
.wabi-button__loader { display: flex; gap: 4px; }
.wabi-button__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; animation: wabi-jelly-bounce 0.6s ease-in-out infinite alternate;
}
.wabi-button__dot:nth-child(2) { animation-delay: 0.15s; }
.wabi-button__dot:nth-child(3) { animation-delay: 0.3s; }
.wabi-button__icon { display: flex; align-items: center; }
.wabi-icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease; outline: none;
}

/* --- Toast (Sonner handles its own styles — customize via Toaster props) --- */

/* --- Dropdown --- */

.wabi-dropdown { position: relative; font-family: 'Selecta', -apple-system, sans-serif; }
.wabi-dropdown__label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(62,62,62,0.5); margin-bottom: 6px; }
.wabi-dropdown__trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--wabi-color-border, #E5E5EA);
  background: var(--wabi-color-surface, #F2F2F7); font-size: 15px;
  cursor: pointer; outline: none; transition: border-color 0.2s;
}
.wabi-dropdown__trigger--open { border-color: var(--wabi-color-primary, #007AFF); }
.wabi-dropdown__chevron { font-size: 10px; color: #888; }
.wabi-dropdown__menu {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  background: #fff; border: 1px solid var(--wabi-color-border, #E5E5EA);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100; max-height: 260px; overflow-y: auto; padding: 4px;
}
.wabi-dropdown__item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px; border: none; background: none;
  font-size: 15px; cursor: pointer; border-radius: 8px;
  text-align: left; transition: background 0.15s;
}
.wabi-dropdown__item:hover { background: var(--wabi-color-surface, #F2F2F7); }
.wabi-dropdown__item--selected { font-weight: 600; }
.wabi-dropdown__item--focused { background: var(--wabi-color-surface, #F2F2F7); }
.wabi-dropdown__item-subtitle { font-size: 12px; color: #888; }
.wabi-dropdown__item-check { margin-left: auto; color: var(--wabi-color-primary, #007AFF); }

/* --- Date Time Picker --- */

.wabi-date-time-picker { font-family: 'Selecta', -apple-system, sans-serif; }
.wabi-date-time-picker__label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(62,62,62,0.5); margin-bottom: 6px; }
.wabi-date-time-picker__input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--wabi-color-border, #E5E5EA);
  background: var(--wabi-color-surface, #F2F2F7); font-size: 15px;
  font-family: inherit; outline: none; color: inherit;
}
.wabi-date-time-picker__input:focus { border-color: var(--wabi-color-primary, #007AFF); }

/* --- Photo Picker --- */

.wabi-photo-picker {
  border-radius: 12px; overflow: hidden; position: relative;
  border: 2px dashed var(--wabi-color-border, #E5E5EA);
  display: flex; align-items: center; justify-content: center;
}
.wabi-photo-picker--has-photo { border-style: solid; }
.wabi-photo-picker__add-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: none; background: none; cursor: pointer; color: var(--wabi-color-primary, #007AFF);
  font-size: 14px; font-weight: 500; padding: 16px;
}
.wabi-photo-picker__add-icon { font-size: 28px; }
.wabi-photo-picker__preview { width: 100%; height: 100%; cursor: pointer; position: relative; }
.wabi-photo-picker__image { width: 100%; height: 100%; object-fit: cover; }
.wabi-photo-picker__change-btn {
  position: absolute; bottom: 8px; right: 8px; padding: 6px 12px;
  background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 8px;
  font-size: 12px; font-weight: 500; cursor: pointer;
}
.wabi-photo-picker__uploading { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #888; font-size: 14px; }
.wabi-photo-picker__spinner {
  width: 24px; height: 24px; border: 2px solid #e0e0e0;
  border-top-color: var(--wabi-color-primary, #007AFF); border-radius: 50%;
  animation: wabi-spin 0.8s linear infinite;
}

/* --- TTS Button --- */

.wabi-tts-button { display: inline-flex; align-items: center; gap: 6px; }
.wabi-tts-button__main {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 20px;
  border: 1px solid var(--wabi-color-border, #E5E5EA);
  background: var(--wabi-color-surface, #F2F2F7);
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: 'Selecta', -apple-system, sans-serif;
}
.wabi-tts-button__main--active { border-color: var(--wabi-color-primary, #007AFF); }
.wabi-tts-button__main:disabled { opacity: 0.4; cursor: default; }
.wabi-tts-button__stop {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--wabi-color-border, #E5E5EA);
  background: var(--wabi-color-surface, #F2F2F7);
  cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center;
}

/* --- Timer Progress --- */

.wabi-timer-progress__title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.wabi-timer-progress__controls { margin-top: 8px; }
.wabi-timer-progress__btn {
  border: none; background: none; font-size: 15px; font-weight: 600;
  cursor: pointer; padding: 8px 16px;
}

/* --- YouTube Modal --- */

.wabi-youtube-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center;
}
.wabi-youtube-modal__content {
  width: 90%; max-width: 900px; position: relative;
}
.wabi-youtube-modal__close {
  position: absolute; top: -40px; right: 0; background: rgba(255,255,255,0.15);
  border: none; color: #fff; font-size: 20px; width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
}
.wabi-youtube-modal__player { aspect-ratio: 16/9; width: 100%; border-radius: 12px; overflow: hidden; }

/* --- Card Gallery (Embla Carousel) --- */

.wabi-card-gallery { position: relative; }
.wabi-card-gallery__viewport { overflow: hidden; }
.wabi-card-gallery__container { display: flex; gap: 12px; }
.wabi-card-gallery__slide { min-width: 0; overflow: hidden; border-radius: 12px; }
.wabi-card-gallery__controls {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 12px;
}
.wabi-card-gallery__btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--wabi-color-border, #E5E5EA);
  background: var(--wabi-color-surface, #F2F2F7);
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.wabi-card-gallery__btn:hover { background: var(--wabi-color-border, #E5E5EA); }
.wabi-card-gallery__index { font-size: 13px; color: #888; font-weight: 500; }

/* --- Universal Icon (vector-searched icons) --- */

.wabi-universal-icon {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border-radius: 8px; overflow: hidden;
  flex-shrink: 0;
}
.wabi-universal-icon--loading { }
.wabi-universal-icon--error { }
.wabi-universal-icon__skeleton {
  width: 60%; height: 60%; border-radius: 50%;
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.01) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: wabi-skeleton-shimmer 2.5s ease-in-out infinite;
}
.wabi-universal-icon__img { display: block; user-select: none; }
.wabi-universal-icon__svg { display: block; user-select: none; }

/* ───────────────────────────────────────────────────────────────
   FROM: web-sdk/src/components/widget/widget.css
   ─────────────────────────────────────────────────────────────── */

/* ---------------------------------------------------------------------------
 * Widget Container
 * --------------------------------------------------------------------------- */

.wabi-widget {
  display: flex;
  flex-direction: column;
  width: 100%;
  cursor: pointer;
  border-radius: 24px;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.wabi-widget:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.wabi-widget:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

.wabi-widget__content {
  aspect-ratio: 4 / 3;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
  position: relative;
  box-shadow: none;
  border: none;
  outline: none;
  background: #f0f0f0;
}

.wabi-widget__dev-disabled {
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 20px;
}

.wabi-widget__label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #f7f7f7;
  border-radius: 0 0 24px 24px;
  transition: opacity 0.3s ease;
}

/* orb is now always visible */

.wabi-widget__label-orb {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.wabi-widget__label {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #080808;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  font-family: 'Selecta', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------------------------------------------------------------------------
 * Three-dots menu
 * --------------------------------------------------------------------------- */

.wabi-widget__menu {
  position: relative;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.wabi-widget:hover .wabi-widget__menu {
  opacity: 1;
}

.wabi-widget__menu-btn {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 2px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
  color: #999;
  transition: color 0.12s ease, background 0.12s ease;
}

.wabi-widget__menu-btn:hover {
  color: #444;
  background: rgba(0, 0, 0, 0.06);
}

.wabi-widget__menu-dropdown {
  position: fixed;
  transform: translateX(-100%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  min-width: 120px;
  padding: 4px;
  z-index: 9999;
  animation: wabi-menu-in 0.12s ease;
}

@keyframes wabi-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wabi-widget__menu-item {
  appearance: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  color: #333;
  transition: background 0.1s ease;
}

.wabi-widget__menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.wabi-widget__menu-item--danger {
  color: #e53935;
}

.wabi-widget__menu-item--danger:hover {
  background: rgba(229, 57, 53, 0.08);
}

/* ---------------------------------------------------------------------------
 * Tooltip (visible only in collapsed orb mode via home-layout.css)
 * --------------------------------------------------------------------------- */

.wabi-widget__tooltip {
  display: none;
}

/* ---------------------------------------------------------------------------
 * Preview Card (no-widget — blurred bg + centered thumbnail)
 * --------------------------------------------------------------------------- */

.wabi-widget__preview {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wabi-widget__preview-bg {
  position: absolute;
  inset: -20px;
  filter: blur(40px) saturate(1.8);
  opacity: 0.5;
  z-index: 0;
}

.wabi-widget__preview-thumb {
  position: relative;
  z-index: 1;
  width: 72%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  border: 1px solid rgba(206, 206, 206, 0.6);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.02),
    0 8px 24px 0 rgba(0, 0, 0, 0.10),
    0 2px 16px 0 rgba(0, 0, 0, 0.05);
  overflow: hidden;
  background: #fff;
}

.wabi-widget__preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------------------------------------------------------------------------
 * Fallback Widget (centered orb only)
 * --------------------------------------------------------------------------- */

.wabi-widget__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.wabi-widget__fallback-orb {
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #d0d0d0;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.06);
}

.wabi-widget__fallback-orb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------------------------------------------------------------------------
 * Quick Action Buttons (inside generated widgets)
 * --------------------------------------------------------------------------- */

.wabi-widget-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.wabi-widget-action:hover {
  opacity: 0.85;
}

.wabi-widget-action:active {
  transform: scale(0.95);
}

/* ---------------------------------------------------------------------------
 * Widget Grid
 * --------------------------------------------------------------------------- */

.wabi-widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------------
 * Widget Type Variants (layout-driven)
 * --------------------------------------------------------------------------- */

.wabi-widget--mini .wabi-widget__content {
  aspect-ratio: 1;
}

.wabi-widget--mini .wabi-widget__label {
  font-size: 11px;
}

.wabi-widget--mini .wabi-widget__fallback-orb {
  width: 88%;
}

.wabi-widget--live .wabi-widget__content {
  aspect-ratio: auto;
  min-height: 120px;
}

/* ---------------------------------------------------------------------------
 * Shimmer Widget (loading state)
 * --------------------------------------------------------------------------- */

.wabi-widget--shimmer > :first-child {
  pointer-events: none;
  background: linear-gradient(90deg, #ececec 25%, #e0e0e0 50%, #ececec 75%);
  background-size: 200% 100%;
  animation: wabi-widget-shimmer 1.5s ease-in-out infinite;
}

.wabi-widget--shimmer .wabi-widget__label {
  height: 14px;
  width: 60%;
  margin: 0 auto;
  border-radius: 7px;
  background: linear-gradient(90deg, #ececec 25%, #e0e0e0 50%, #ececec 75%);
  background-size: 200% 100%;
  animation: wabi-widget-shimmer 1.5s ease-in-out infinite;
  color: transparent;
}

@keyframes wabi-widget-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.wabi-widget--shimmer:nth-child(2) > * { animation-delay: 0.1s; }
.wabi-widget--shimmer:nth-child(3) > * { animation-delay: 0.2s; }
.wabi-widget--shimmer:nth-child(4) > * { animation-delay: 0.3s; }

/* ───────────────────────────────────────────────────────────────
   FROM: web-sdk/src/components/styles/app-orb.css
   ─────────────────────────────────────────────────────────────── */

/* wrapper – overflow visible so shadow extends beyond */
.app-orb {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  transition: transform 0.75s cubic-bezier(.25, 1, .5, 1);
}

/* inner orb – clips cover image to shape */
.app-orb__orb {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
}

.app-orb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-orb__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

/* shadow – sits behind the orb, not clipped */
.app-orb__shadow {
  position: absolute;
  top: 4px;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  filter: blur(8px) saturate(1.2);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.75s ease, top 0.75s ease;
}

.app-orb:hover {
  transform: translateY(-4px);
}

.app-orb:hover .app-orb__shadow {
  opacity: 0.55;
  top: 10px;
}

.app-orb:active {
  transform: translateY(0);
}
