.app {
  display: flex;
  flex: 1;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  flex-wrap: nowrap;
  position: relative;
  flex-direction: column;
}

/* Desktop Assist: window is resized to a narrow rail (~phone width); reinforce phone-like shell */
.app--assist-compact {
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.app--assist-compact .app-content-inner {
  overflow: hidden;
}

/* In the rail, one vertical slide ≈ one window height (like iOS Explore), not full monitor */
.app--assist-compact .explore-view--feed .explore-slide {
  flex: 0 0 min(100vh, 100dvh);
  min-height: min(100vh, 100dvh);
  height: auto;
}

/* When backend error banner is visible, push content down */
.app.app--banner-visible .app-content {
  padding-top: 48px;
}

.app-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  pointer-events: auto; /* ensure content is always clickable during load */
}

.app-content-inner {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.app-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 9999;
  background: rgba(59, 130, 246, 0.12);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.app-drop-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 60px;
  border-radius: 20px;
  border: 2.5px dashed rgba(59, 130, 246, 0.6);
  background: rgba(255, 255, 255, 0.08);
  color: #3b82f6;
  font-size: 18px;
  font-weight: 600;
}

.app-backend-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #3d1a1a;
  color: #f0c0c0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 120, 120, 0.3);
  pointer-events: none; /* don't block clicks on the page */
}
.app-backend-banner .app-backend-banner-retry {
  pointer-events: auto; /* Retry button stays clickable */
}

.app-backend-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e55;
  flex-shrink: 0;
}

/* Update toast (desktop): bottom-left notification like Cursor — "Later" + "Install Now" */
.app-update-toast {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  font-size: 0.82rem;
  color: #e5e5e7;
  max-width: 340px;
  pointer-events: auto;
}
.app-update-toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30d158;
  flex-shrink: 0;
}
.app-update-toast-text {
  flex: 1;
  min-width: 0;
  color: #ebebeb;
}
.app-update-toast-later {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: #98989d;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}
.app-update-toast-later:hover {
  color: #e5e5e7;
}
.app-update-toast-install {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 5px;
  border: none;
  background: #0a84ff;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.app-update-toast-install:hover:not(:disabled) {
  background: #409cff;
}
.app-update-toast-install:disabled {
  opacity: 0.7;
  cursor: wait;
}

.app-backend-banner code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8em;
}

.app-backend-banner-retry {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 200, 200, 0.5);
  background: transparent;
  color: #f0c0c0;
  cursor: pointer;
  font-size: 0.85rem;
}

.app-backend-banner-retry:hover {
  background: rgba(255, 255, 255, 0.1);
}

.app-minimal {
  display: flex;
  flex: 1;
  min-height: 100vh;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg);
}

.app-minimal-title {
  margin: 0;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

.app-minimal-expand {
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.app-minimal-expand:hover {
  background: var(--accent-hover);
}

.app-minimal-hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}


/* Mandatory update: blocks entire app until user updates */
.update-required-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
}

.update-required-card {
  background: var(--surface, #1c1c1e);
  border: 1px solid rgba(10, 132, 255, 0.4);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.update-required-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text, #fff);
}

.update-required-text {
  margin: 0 0 24px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted, #98989d);
}

.update-required-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 10px;
  border: none;
  background: #0a84ff;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.update-required-btn:hover:not(:disabled) {
  background: #409cff;
}

.update-required-btn:disabled {
  opacity: 0.9;
  cursor: wait;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
}

/* First-run examples: above permission onboarding; stable scroll + backdrop so the main UI doesn’t flash through. */
.onboarding-overlay--first-run-examples {
  z-index: 11002;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.55);
}

.onboarding-card--first-run-examples {
  max-width: min(480px, calc(100vw - 40px));
  max-height: min(90vh, 720px);
  overflow-y: auto;
  padding: 24px 28px;
}

/* Voice enrollment wizard — above main chrome, below nothing critical */
.voice-onboarding-overlay {
  z-index: 11001;
}

.voice-onboarding-overlay .onboarding-card {
  max-width: 480px;
}

.voice-onboarding-flow {
  position: relative;
}

.voice-onboarding-flow__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.voice-onboarding-flow__hero-text {
  width: 100%;
  min-width: 0;
}

.voice-onboarding-flow__hero .onboarding-title {
  margin-bottom: 6px;
}

.voice-onboarding-flow__subtitle {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.voice-onboarding-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.voice-onboarding-flow-status {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--accent);
}

/* Abstract “AI” face — animates while TTS plays */
.aria-speaking-avatar {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.aria-speaking-avatar__svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
}

.aria-speaking-avatar__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(74, 222, 128, 0.35);
  opacity: 0.85;
  pointer-events: none;
}

.aria-speaking-avatar--speaking .aria-speaking-avatar__ring {
  animation: aria-avatar-ring-pulse 1.1s ease-in-out infinite;
}

.aria-speaking-avatar__mouth {
  transform-origin: 60px 78px;
  transition: transform 0.12s ease;
}

.aria-speaking-avatar--speaking .aria-speaking-avatar__mouth {
  animation: aria-avatar-mouth 0.45s ease-in-out infinite alternate;
}

.aria-speaking-avatar--in-chat {
  width: 72px;
  height: 72px;
}

.aria-speaking-avatar-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0 4px;
}
@keyframes aria-avatar-ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes aria-avatar-mouth {
  0% { transform: scaleY(0.55) scaleX(1.05); }
  100% { transform: scaleY(1) scaleX(1); }
}

/* ─── Aria Live Chat: iMessage-style floating bubbles, top-right ─── */
.aria-live-chat {
  position: fixed;
  top: 56px;
  right: 14px;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: min(440px, 46vw);
  pointer-events: none;
}
.aria-live-bubble {
  pointer-events: auto;
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.35;
  max-width: 78%;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: ariaLiveBubbleIn 0.22s ease-out;
}
.aria-live-bubble--user {
  background: linear-gradient(180deg, #2b8aef 0%, #1f6fd1 100%);
  color: #fff;
  border-bottom-right-radius: 6px;
  align-self: flex-end;
}
.aria-live-bubble--aria {
  background: rgba(40, 40, 46, 0.85);
  color: #f4f4f5;
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 6px;
  align-self: flex-start;
}
.aria-live-bubble--typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}
.aria-live-bubble--typing .typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.65);
  animation: typingDot 1.2s infinite ease-in-out;
}
.aria-live-bubble--typing .typing-dot:nth-child(2) { animation-delay: 0.15s; }
.aria-live-bubble--typing .typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes ariaLiveBubbleIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ─── Aria Universe: fixed full-viewport particle field behind the UI ─── */
.aria-universe {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.aria-universe > .aria-orb,
.aria-universe > div {
  width: 100%;
  height: 100%;
}
/* Ensure UI chrome sits above the universe */
.app {
  position: relative;
}
.app > *:not(.aria-universe):not(.aria-live-chat) {
  position: relative;
  z-index: 1;
}
/* Let particles bleed through the dashboard surfaces */
.app .main {
  background: transparent;
}
/* Home screen: orb fills the center of the viewport */
.aria-orb-home {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  gap: 12px;
}
.aria-orb-thinking {
  display: flex;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}

.aria-orb {
  transition: filter 0.5s ease;
}

.aria-orb canvas {
  display: block;
}


.onboarding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.onboarding-title {
  margin: 0 0 12px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.onboarding-text {
  margin: 0 0 24px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.onboarding-text--hint {
  margin-bottom: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  opacity: 0.9;
}

.onboarding-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.onboarding-btn {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.onboarding-btn--primary {
  background: var(--accent);
  color: var(--bg);
}

.onboarding-btn--primary:hover {
  background: var(--accent-hover);
}

.onboarding-btn--secondary {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.onboarding-btn--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Persistent indicator when screen sharing from another view (web + desktop) */
.global-screen-share-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  margin: 0 16px 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fca5a5;
}

.global-screen-share-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: global-screen-share-pulse 1.4s ease-in-out infinite;
}

@keyframes global-screen-share-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.global-screen-share-label {
  flex: 1;
  min-width: 0;
}

.global-screen-share-btn {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.global-screen-share-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fecaca;
}

.global-screen-share-btn--stop {
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(239, 68, 68, 0.6);
}

.global-screen-share-btn--stop:hover {
  background: rgba(239, 68, 68, 0.5);
}

.header-quick-nav {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.header-quick-nav-btn {
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.header-quick-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.app-sidebar-left {
  flex-shrink: 0;
  width: 200px;
  min-width: 200px;
  border-right: 1px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  transition: width 0.2s ease, min-width 0.2s ease;
}

.app-sidebar-left--closed {
  width: 48px !important;
  min-width: 48px !important;
}

.app-sidebar-left--closed .app-sidebar-left-inner {
  display: none;
}

.app-sidebar-update-row {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-sidebar-update-row--desktop-only {
  border-top-color: var(--border);
}

.app-sidebar-voice-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-sidebar-voice-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent, #7c6fff);
  text-transform: uppercase;
  margin: 0 0 2px 2px;
}

.app-sidebar-voice-hint {
  font-size: 11px;
  color: var(--text-muted, #888);
  line-height: 1.45;
  margin: 4px 2px 0;
}

/* Web: Mac + Windows — obvious pill buttons (links) */
.desktop-downloads {
  box-sizing: border-box;
}
/* Compact top-right corner variant — used on the empty/home header */
.desktop-downloads--banner {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  gap: 6px;
  z-index: 30;
  pointer-events: auto;
}
.download-corner-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(30,30,34,0.7);
  color: #e4e4e7;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.download-corner-icon {
  flex-shrink: 0;
  opacity: 0.9;
}
.download-corner-pill:hover {
  background: rgba(50,50,56,0.85);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}
.download-corner-pill--mac {
  color: #f5f5f7;
}
.download-corner-pill--win {
  color: #bfe0ff;
}
.download-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 14px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.download-strip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.download-strip-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #faf5ff;
  letter-spacing: 0.02em;
}
.download-strip-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.download-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.download-strip-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted, #8a8698);
  max-width: 52ch;
}
.download-strip-hint strong {
  color: #c8c4d4;
  font-weight: 600;
}
.download-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  white-space: nowrap;
}
.download-pill:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}
.download-pill:focus-visible {
  outline: 2px solid #c084fc;
  outline-offset: 2px;
}
.download-pill--mac {
  background: linear-gradient(180deg, #4a4a52 0%, #323236 100%);
  color: #f5f5f7;
  border-color: rgba(255, 255, 255, 0.14);
}
.download-pill--win {
  background: linear-gradient(180deg, #0e7cc5 0%, #0a5f9a 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}
.download-pill--loading {
  cursor: wait;
  opacity: 0.88;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.download-pill--loading:hover {
  filter: none;
  transform: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.desktop-downloads--banner .download-strip {
  padding: 14px 20px;
}
.desktop-downloads--sidebar {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.desktop-downloads--sidebar .download-strip {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  gap: 10px;
}
.desktop-downloads--sidebar .download-strip-text {
  text-align: left;
}
.desktop-downloads--sidebar .download-strip-actions {
  flex-direction: column;
}
.desktop-downloads--sidebar .download-pill {
  width: 100%;
}
.desktop-downloads--subscription {
  margin-bottom: 20px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.desktop-downloads--subscription .download-strip {
  padding: 16px 18px;
}

.app-dash-item--update {
  font-size: 0.85rem;
}

.app-sidebar-version-inline {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0 12px;
}

.app-dash-item--disabled-text {
  cursor: default;
  opacity: 0.7;
}

.app-dash-item--disabled-text:hover {
  background: transparent;
  color: var(--text-muted);
}

.app-sidebar-left-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 10px;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
}

.app-sidebar-left--closed .app-sidebar-left-header {
  border-bottom: none;
  padding: 12px 10px;
  justify-content: center;
}

.app-sidebar-left-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.app-sidebar-left .sidebar-toggle {
  flex-shrink: 0;
  margin: 0;
}

.app-sidebar-left-inner {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Desktop: enroll a spectral “voice profile” so only your voice triggers transcription */
.voice-profile-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}
.voice-profile-panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 8px;
}

.voice-profile-panel-restart {
  margin-bottom: 10px;
  width: 100%;
}
.voice-profile-panel-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0 0 10px;
  line-height: 1.35;
}
.voice-profile-panel-status {
  font-size: 0.78rem;
  color: var(--text);
  margin-bottom: 8px;
}
.voice-profile-panel-count {
  color: var(--accent);
  font-weight: 600;
}
.voice-profile-panel-hint strong {
  color: var(--text);
}
.voice-profile-panel-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-bottom: 10px;
  line-height: 1.3;
}
.voice-profile-panel-check input {
  accent-color: var(--accent);
}
.voice-profile-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.voice-profile-panel-btn {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
}
.voice-profile-panel-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.voice-profile-panel-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.voice-profile-panel-btn--primary {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(74, 222, 128, 0.4);
}
.voice-profile-panel-btn--ghost {
  background: transparent;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.voice-profile-panel-micro {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 8px 0 0;
  line-height: 1.35;
}

.app-dash-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.app-dash-item:hover {
  background: var(--input-bg);
  color: var(--accent);
}

.app-dash-item.active {
  background: var(--input-bg);
  color: var(--accent);
  font-weight: 600;
}

.app-dash-item--sharing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-dash-item-share-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fca5a5;
}

.app-dash-item-share-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: global-screen-share-pulse 1.4s ease-in-out infinite;
}

.app-dash-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-muted);
}

.app-dash-item:disabled:hover {
  background: transparent;
  color: var(--text-muted);
}

a.app-dash-item {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.app-dash-item:focus {
  outline: none;
}

.app-center {
  /* Prefer growing over the trending strip so Ask stays readable when the window is narrow (e.g. DevTools docked). */
  flex: 2 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  overflow: hidden;
  background: transparent;
}

.app-loading-fallback {
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.app-video-panel {
  /* 9:16 preview width; must be allowed to shrink — flex-shrink: 0 crushed the chat column beside DevTools or small windows. */
  flex: 0 1 auto;
  min-width: 0;
  width: min(calc(100vh * 9 / 16), 45vw);
  max-width: min(calc(100vh * 9 / 16), 45vw);
  height: 100%;
  border-left: 1px solid var(--border);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #000;
}


.sidebar-toggle {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: var(--input-bg);
  color: var(--text);
}

.app-sidebar-left h2,
.app-sidebar-left-inner h2,
.app-sidebar-left-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.header {
  flex-shrink: 0;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--border);
}

.header--minimal {
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 0 4px;
}
.header-title-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.header-title-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.header--minimal .header-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.header-tagline {
  margin: 6px 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
  max-width: 28rem;
}

/* ── Aria Conversation Bubble (Apple iMessage style) ── */
.aria-bubble-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
  width: 100%;
  justify-content: space-between;
}
.aria-chat-bubble {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px 16px;
  max-width: 48%;
  min-width: 60px;
  min-height: 20px;
  flex: 0 1 auto;
  transition: all 0.3s ease, opacity 0.4s ease, transform 0.4s ease;
  opacity: 0.5;
  transform: scale(0.97);
}
.aria-chat-bubble--visible {
  opacity: 1;
  transform: scale(1);
}
.aria-chat-bubble--user {
  background: #007aff;
  border-color: #007aff;
}
.aria-chat-bubble--user .aria-chat-bubble__text {
  color: #fff;
}
.aria-chat-bubble--aria {
  background: #8B5CF6;
  border-color: #8B5CF6;
}
.aria-chat-bubble--aria .aria-chat-bubble__text {
  color: #fff;
}
[data-theme="dark"] .aria-chat-bubble--aria,
.dark .aria-chat-bubble--aria {
  background: #7C3AED;
  border-color: #7C3AED;
}
.aria-chat-bubble__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.aria-chat-bubble__text--idle {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
}
/* Tail triangle for Aria bubble */
.aria-chat-bubble--aria::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid #8B5CF6;
}
[data-theme="dark"] .aria-chat-bubble--aria::before,
.dark .aria-chat-bubble--aria::before {
  border-right-color: #7C3AED;
}
/* Tail triangle for User bubble */
.aria-chat-bubble--user::before {
  content: '';
  position: absolute;
  right: -6px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid #007aff;
  left: auto;
}

/* ── Conversation Overlay ── */
.aria-convo-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: convoOverlayFadeIn 0.25s ease;
}
@keyframes convoOverlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.aria-convo-overlay__panel {
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  background: var(--bg, #fff);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: convoSlideUp 0.3s ease;
}
@keyframes convoSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.aria-convo-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.aria-convo-overlay__header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.aria-convo-overlay__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.aria-convo-overlay__history-btn {
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.aria-convo-overlay__history-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.aria-convo-overlay__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.aria-convo-overlay__close:hover {
  background: var(--accent);
  color: #fff;
}
.aria-convo-overlay__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.aria-convo-overlay__empty {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 0;
  font-size: 0.9rem;
}

/* Message bubbles in overlay (iMessage style) */
.aria-convo-msg {
  display: flex;
  max-width: 85%;
}
.aria-convo-msg--user {
  align-self: flex-end;
  margin-left: auto;
}
.aria-convo-msg--aria {
  align-self: flex-start;
}
.aria-convo-msg__bubble {
  padding: 10px 14px;
  border-radius: 18px;
  position: relative;
}
.aria-convo-msg--user .aria-convo-msg__bubble {
  background: #007aff;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.aria-convo-msg--aria .aria-convo-msg__bubble {
  background: #8B5CF6;
  color: #fff;
  border-bottom-left-radius: 4px;
}
[data-theme="dark"] .aria-convo-msg--aria .aria-convo-msg__bubble,
.dark .aria-convo-msg--aria .aria-convo-msg__bubble {
  background: #7C3AED;
  color: #fff;
}
.aria-convo-msg__bubble p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.aria-convo-msg__time {
  display: block;
  font-size: 0.65rem;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}
.aria-convo-msg--aria .aria-convo-msg__time {
  text-align: left;
}

/* History day list */
.aria-convo-overlay__day-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
}
.aria-convo-overlay__day-btn:hover {
  background: var(--surface);
}
.aria-convo-overlay__day-date {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}
.aria-convo-overlay__day-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Banner is now a compact top-right corner (see .desktop-downloads--banner above). */

.app-center .header {
  padding-left: 0;
  padding-right: 0;
}

/* Center must show only "Aria" + line; no tabs (navigation is in left sidebar only) */
.app-center .nav-tabs {
  display: none !important;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.nav-tab {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.nav-tab:hover {
  color: var(--text);
}

.nav-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.tagline {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 0 12px;
  background: var(--bg);
}

/* ── History section ─────────────────────────────────────────────────────── */
.app-history-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.history-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.history-go-ask {
  background: var(--accent, #6C63FF);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.history-go-ask:hover { opacity: 0.85; }

.app-subscription-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.subscription-main {
  padding: 20px 24px;
}
.subscription-tagline {
  margin: 0 0 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.subscription-placeholder {
  padding: 24px;
  background: var(--input-bg, #f5f5f5);
  border-radius: 12px;
  border: 1px solid var(--border, #e0e0e0);
  color: var(--text-muted);
}
.subscription-placeholder p {
  margin: 0;
}

.subscription-credits-block {
  margin-bottom: 20px;
}
.subscription-credits-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--text);
}
.subscription-credits-title:first-child {
  margin-top: 0;
}

/* ── Plan cards grid ── */
.subscription-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.subscription-plan-card {
  position: relative;
  padding: 24px 20px;
  background: var(--input-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.subscription-plan-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
}
.subscription-plan-card--featured {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}
.subscription-plan-card--active {
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.1);
}
.subscription-plan-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(139, 92, 246, 0.9);
  color: #fff;
}
.subscription-plan-badge--current {
  background: rgba(52, 211, 153, 0.9);
  color: #0d2818;
}
.subscription-plan-card-name {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.subscription-plan-card-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.subscription-plan-price-period {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
}
.subscription-plan-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 14px;
  line-height: 1.4;
}
.subscription-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  flex: 1;
}
.subscription-plan-features li {
  font-size: 0.85rem;
  color: var(--text);
  padding: 4px 0;
  position: relative;
  padding-left: 20px;
}
.subscription-plan-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: rgba(52, 211, 153, 0.85);
  font-weight: 700;
}
.subscription-plan-card-action {
  margin-top: auto;
}
.subscription-plan-stripe-note {
  margin: auto 0 0;
  padding-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Checkout buttons ── */
.subscription-checkout-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.subscription-checkout-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}
.subscription-checkout-btn:active:not(:disabled) {
  transform: scale(0.98);
}
.subscription-checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.subscription-checkout-btn--primary {
  background: rgba(139, 92, 246, 0.9);
  color: #fff;
}
.subscription-checkout-btn--secondary {
  background: rgba(59, 130, 246, 0.85);
  color: #fff;
}
.subscription-checkout-btn--outline {
  background: transparent;
  border: 1.5px solid var(--border, rgba(255,255,255,0.2));
  color: var(--text);
}
.subscription-checkout-btn--outline:hover:not(:disabled) {
  border-color: rgba(139, 92, 246, 0.5);
}

.subscription-checkout-error {
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.88rem;
}

/* ── Account fields ── */
.subscription-account-fields {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.subscription-field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  flex: 1;
  min-width: 200px;
}
.subscription-field-input {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.9rem;
}
.subscription-field-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.5);
}

/* ── Credits status ── */
.subscription-credits-status {
  margin-top: 12px;
}
.subscription-credits-card {
  padding: 16px;
  background: var(--input-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subscription-credits-card--owner {
  border-color: rgba(250, 204, 21, 0.3);
  background: rgba(250, 204, 21, 0.05);
}
.subscription-credits-card--warning {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}
.subscription-credits-card--empty {
  border-style: dashed;
}
.subscription-credits-card p {
  margin: 0;
}
.subscription-credits-card-icon {
  font-size: 1.2rem;
}
.subscription-credits-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.subscription-credits-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.9), rgba(139, 92, 246, 0.8));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.subscription-credits-remaining {
  margin: 0;
  font-size: 0.88rem;
}

/* ── Manage billing button ── */
.subscription-manage-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.subscription-manage-btn:hover:not(:disabled) {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.08);
}
.subscription-manage-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Chat Messages: iMessage-style conversation bubbles ── */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* Message row — controls alignment */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  animation: chat-msg-in 0.25s ease-out;
}
@keyframes chat-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* User messages: right-aligned */
.chat-msg--user {
  align-self: flex-end;
  align-items: flex-end;
}

/* AI messages: left-aligned */
.chat-msg--ai {
  align-self: flex-start;
  align-items: flex-start;
}

/* Bubble shape */
.chat-msg-bubble {
  padding: 10px 16px;
  font-size: 0.935rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}

/* User bubble: blue, rounded with sharp bottom-right */
.chat-msg--user .chat-msg-bubble {
  background: #007AFF;
  color: #fff;
  border-radius: 20px 20px 6px 20px;
}

/* AI bubble: subtle dark surface, rounded with sharp bottom-left */
.chat-msg--ai .chat-msg-bubble {
  background: #2c2c2e;
  color: var(--text);
  border-radius: 20px 20px 20px 6px;
}

/* Consecutive same-role: tighter spacing, softer radius */
.chat-msg--user + .chat-msg--user { margin-top: -2px; }
.chat-msg--user + .chat-msg--user .chat-msg-bubble { border-radius: 20px 6px 6px 20px; }
.chat-msg--ai + .chat-msg--ai { margin-top: -2px; }
.chat-msg--ai + .chat-msg--ai .chat-msg-bubble { border-radius: 6px 20px 20px 6px; }

/* Name label above first message in a group */
.chat-msg-sender {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 4px;
  margin-bottom: 2px;
  margin-top: 8px;
}
.chat-msg--user .chat-msg-sender { color: rgba(0,122,255,0.7); }
.chat-msg--ai .chat-msg-sender { color: var(--accent); }

/* Feedback row under AI bubbles */
.chat-msg-feedback {
  display: flex;
  gap: 2px;
  padding: 2px 4px 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.chat-msg:hover .chat-msg-feedback,
.chat-msg-feedback:focus-within {
  opacity: 1;
}
.chat-msg-feedback-btn {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 3px 5px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}
.chat-msg-feedback-btn:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}
.chat-msg-feedback-btn:disabled { cursor: default; }
.chat-msg-feedback-btn--up-active { color: rgba(52, 211, 153, 0.9) !important; }
.chat-msg-feedback-btn--down-active { color: rgba(239, 68, 68, 0.9) !important; }

/* Play audio button inside AI bubble */
.chat-msg-play {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 14px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-msg-play:hover { background: rgba(255,255,255,0.18); }

/* ── Typing indicator: animated dots ── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
}
.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Workbench: dynamic workspace below chat ── */
.workbench {
  flex-shrink: 0;
  max-height: 40vh;
  overflow-y: auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.workbench:empty { display: none; }

.workbench-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.workbench-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

/* Option cards in workbench */
.workbench-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.workbench-option-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.workbench-option-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--accent);
}
.workbench-option-card img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

/* Legacy compat — keep .messages class for non-ask sections */
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
}
.message--solution {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.03);
}
.message--solution .message-content {
  font-size: 1rem;
  line-height: 1.55;
}

/* ── Action Cards (home screen) ── */
.aria-action-cards-home {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.aria-action-cards-home::-webkit-scrollbar { display: none; }
.aria-action-card-home {
  flex: 0 0 auto;
  width: 160px;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.aria-action-card-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.aria-action-card-home-img-wrap {
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  padding: 10px;
}
.aria-action-card-home-img {
  max-width: 64px;
  max-height: 52px;
  object-fit: contain;
  border-radius: 6px;
}
.aria-action-card-home-body {
  padding: 8px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.aria-action-card-home-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aria-action-card-home-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aria-action-card-home-price {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent, #6c5ce7);
}
.aria-action-card-home-btn {
  margin: 6px 10px 10px;
  padding: 6px 0;
  border: none;
  border-radius: 8px;
  background: var(--accent, #6c5ce7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}
.aria-action-card-home-btn:hover {
  background: var(--accent-hover, #5a4bd1);
}
.aria-action-card-home--food .aria-action-card-home-btn { background: #e74c3c; }
.aria-action-card-home--food .aria-action-card-home-btn:hover { background: #c0392b; }
.aria-action-card-home--food .aria-action-card-home-price { color: #e74c3c; }
.aria-action-card-home--rides .aria-action-card-home-btn { background: #000; }
.aria-action-card-home--shopping .aria-action-card-home-btn { background: #f39c12; }
.aria-action-card-home--shopping .aria-action-card-home-btn:hover { background: #d68910; }

.ask-help-ideas {
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.ask-help-ideas-heading {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.ask-help-ideas-lead {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.ask-help-ideas-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ask-help-ideas-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.ask-help-ideas-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ask-help-ideas-item-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.ask-help-ideas-item-desc {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.ask-help-ideas-use-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.ask-help-ideas-use-btn:hover {
  background: rgba(139, 92, 246, 0.12);
}

.placeholder {
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text);
  padding: 16px 0;
}

.placeholder p {
  margin: 0 0 6px;
}

.placeholder .muted {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.message--user {
  margin-left: 24px;
  background: var(--input-bg);
  border-color: var(--accent);
}

.message--assistant .message-content {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-content.typing {
  color: var(--text-muted);
  font-style: italic;
}

.message-content.error {
  color: #f87171;
}

.aria-status-chip {
  margin: 10px 0 8px;
  padding: 8px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.aria-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #93c5fd;
  box-shadow: 0 0 0 0 rgba(147, 197, 253, 0.65);
  animation: aria-status-pulse 1.2s ease-out infinite;
}

.aria-status-chip.is-thinking .aria-status-dot,
.aria-status-chip.is-processing .aria-status-dot {
  background: #fbbf24;
  box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.65);
}

.aria-status-chip.is-speaking .aria-status-dot {
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.65);
}

@keyframes aria-status-pulse {
  0% { transform: scale(1); opacity: 0.95; }
  70% { transform: scale(1.55); opacity: 0.25; }
  100% { transform: scale(1); opacity: 0.95; }
}

.message-play-audio {
  margin-top: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  cursor: pointer;
}

.message-play-audio:hover {
  background: rgba(255, 255, 255, 0.12);
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.option-card {
  padding: 10px 14px;
  background: var(--input-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  max-width: 200px;
}

.option-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 6px;
}

.input-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0;
  background: #2c2c2e;
  border-radius: 999px;
  padding: 8px 8px 8px 12px;
  margin-top: auto;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 52px;
  min-width: 320px;
  box-sizing: border-box;
}

.input-add-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: none;
  background: #0a84ff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 10px;
}

.input-add-btn:hover {
  background: #409cff;
}

.input-file-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.main-ask-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.main-ask-wrap--drag-over::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 132, 255, 0.12);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  z-index: 10;
  pointer-events: none;
}

.main-ask-wrap--drag-over::after {
  content: 'Drop photos here (max 10)';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  color: var(--accent);
  z-index: 11;
  pointer-events: none;
}

.reference-images-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--input-bg);
  border-bottom: 1px solid var(--border);
}

.reference-image-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}

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

.reference-image-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.reference-image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reference-image-remove:hover {
  background: rgba(0, 0, 0, 0.85);
}

.reference-images-cap {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.reference-video-thumb {
  width: 72px;
  height: 48px;
}

.reference-video-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  font-size: 9px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-add-wrap {
  position: relative;
  flex-shrink: 0;
}

.add-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  min-width: 180px;
  padding: 6px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.add-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.add-menu-item:hover {
  background: var(--input-bg);
  color: var(--accent);
}

.input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  min-width: 0;
}

.input:focus {
  outline: none;
}

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

.input-send-btn,
.input-mic-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 2px;
}

.input-send-btn:hover:not(:disabled),
.input-mic-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.input-send-btn:not(:disabled) {
  color: var(--accent);
}

.input-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--text-muted);
}

/* Mic button: dark purple rounded rect, lighter purple circle, light blue equalizer bars (when on) */
.input-mic-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s, color 0.2s;
}

.input-mic-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.input-mic-btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(148, 148, 160, 0.35);
  background: transparent;
  transition: border-color 0.2s, background 0.2s;
}

.input-mic-btn--on .input-mic-btn-inner {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(61, 45, 92, 0.5);
}

.input-mic-btn--on:hover .input-mic-btn-inner {
  border-color: rgba(74, 222, 128, 0.65);
}

.input-mic-btn--on {
  color: rgba(226, 232, 240, 0.95);
  background: rgba(61, 45, 92, 0.85);
}

.input-mic-btn--on:hover {
  background: rgba(71, 55, 105, 0.95);
}

/* Idle state: flat white when no one is speaking */
.input-mic-btn--idle {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
}

.input-mic-btn--idle .input-mic-btn-inner {
  border-color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
}

/* Live speech: direct DOM class — instant blue flash without React re-render */
.input-mic-btn--live-speech {
  background: rgba(31, 111, 255, 0.92) !important;
  color: #eaf4ff !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 0 14px rgba(31, 111, 255, 0.45) !important;
  animation: mic-live-pulse 0.55s ease-in-out infinite !important;
}

.input-mic-btn--live-speech .input-mic-btn-inner {
  border-color: rgba(168, 206, 255, 0.95) !important;
  background: rgba(24, 90, 204, 0.55) !important;
}

.input-mic-btn--live-speech .input-mic-btn-eq-bar {
  background: rgba(188, 229, 255, 0.96) !important;
  animation: mic-eq 0.45s ease-in-out infinite !important;
  animation-delay: calc(var(--i) * 0.07s) !important;
}

@keyframes mic-live-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5), 0 0 10px rgba(31, 111, 255, 0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.2), 0 0 20px rgba(31, 111, 255, 0.5); }
}

/* User speaking: blue */
.input-mic-btn--user-speaking {
  background: rgba(31, 111, 255, 0.9);
  color: #eaf4ff;
}

.input-mic-btn--user-speaking .input-mic-btn-inner {
  border-color: rgba(168, 206, 255, 0.95);
  background: rgba(24, 90, 204, 0.55);
}

.input-mic-btn--user-speaking .input-mic-btn-eq-bar {
  background: rgba(188, 229, 255, 0.96);
}

/* Aria speaking: red (wins over user color if both classes present) */
.input-mic-btn--aria-speaking {
  background: rgba(220, 52, 72, 0.92);
  color: #ffe9ec;
}

.input-mic-btn--aria-speaking .input-mic-btn-inner {
  border-color: rgba(255, 192, 199, 0.95);
  background: rgba(165, 34, 51, 0.55);
}

.input-mic-btn--aria-speaking .input-mic-btn-eq-bar {
  background: rgba(255, 205, 212, 0.96);
}

.input-mic-btn-eq {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 14px;
}

.input-mic-btn-eq-bar {
  width: 3px;
  min-height: 3px;
  height: calc(4px + (var(--i) + 1) * 2px);
  max-height: 14px;
  border-radius: 2px;
  background: rgba(74, 222, 128, 0.7);
  /* Gentle idle wave — always on when mic is open */
  animation: mic-idle 1.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
  transition: background 0.2s ease;
}

/* Active speaking: fast blue wave */
.input-mic-btn--speaking .input-mic-btn-eq-bar,
.input-mic-btn--live-speech .input-mic-btn-eq-bar {
  animation: mic-eq 0.45s ease-in-out infinite !important;
  animation-delay: calc(var(--i) * 0.07s) !important;
  background: rgba(188, 229, 255, 0.96) !important;
}

/* Aria speaking: purple wave */
.input-mic-btn--aria-speaking .input-mic-btn-eq-bar {
  animation: mic-eq 0.7s ease-in-out infinite !important;
  animation-delay: calc(var(--i) * 0.1s) !important;
  background: rgba(216, 180, 254, 0.96) !important;
}

/* Gentle breathing wave — visible when listening but not actively speaking */
@keyframes mic-idle {
  0%, 100% { height: calc(3px + var(--i) * 1px); }
  50% { height: calc(6px + var(--i) * 2px); }
}

@keyframes mic-eq {
  0%, 100% { height: 5px; }
  25% { height: 10px; }
  50% { height: 14px; }
  75% { height: 8px; }
}

.input-voice-listening {
  font-size: 0.75rem;
  color: var(--accent);
  margin-right: 6px;
  opacity: 0.9;
}

.input-voice-listening--hint {
  color: var(--text-muted);
  font-style: italic;
  max-width: 220px;
}

.input-live-transcript {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 8px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backend-unreachable-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: rgba(200, 60, 60, 0.2);
  border: 1px solid rgba(200, 60, 60, 0.5);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text, #eee);
}
.backend-unreachable-banner code {
  font-size: 0.8em;
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.input-voice-error {
  margin: 6px 0 0;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(255, 200, 100, 0.12);
  border-radius: var(--radius);
}

.input-voice-error-link {
  margin-left: 4px;
  padding: 0 2px;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.input-voice-error-link:hover {
  opacity: 0.9;
}

.send-btn {
  padding: 12px 20px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.95rem;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Explore view – TikTok-style vertical feed (auto-play, cover as poster) */
.explore-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.explore-view--feed {
  padding: 0;
}

.explore-header {
  flex-shrink: 0;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border);
}

.explore-header--minimal {
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--border);
}

.explore-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.explore-header--minimal .explore-title {
  font-size: 1.1rem;
}

.explore-tagline {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.explore-header--minimal .explore-tagline {
  margin: 2px 0 0;
  font-size: 0.8rem;
}

.explore-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 0;
}

.explore-muted,
.explore-error {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.explore-error {
  color: #f87171;
}

/* TikTok-style vertical feed: one slide per viewport, scroll-snap, auto-play in view */
.explore-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

.explore-slide {
  position: relative;
  width: 100%;
  flex: 0 0 100%;
  min-height: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* Each slide = one viewport of the feed (use 100vh so one full screen per video) */
.explore-view--feed .explore-feed {
  height: 100%;
}

.explore-view--feed .explore-slide {
  min-height: 100vh;
  height: auto;
  flex: 0 0 100vh;
}

.explore-slide-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.explore-slide-poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.2s ease;
}

.explore-slide-poster--only {
  opacity: 1;
}

.explore-slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 16px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.explore-slide-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Legacy grid (used when no feed) */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.explore-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}

.explore-card:hover {
  border-color: var(--accent);
}

.explore-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.explore-card-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--border);
}

.explore-card-title {
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Camera modal */
.camera-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.camera-modal {
  width: 90vw;
  max-width: 560px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.camera-modal-video {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  object-fit: cover;
}

.camera-modal-actions {
  display: flex;
  gap: 12px;
  padding: 16px;
  justify-content: flex-end;
}

.camera-modal-btn {
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.camera-modal-btn--cancel {
  background: var(--input-bg);
  color: var(--text);
}

.camera-modal-btn--cancel:hover {
  background: var(--border);
}

.camera-modal-btn--capture {
  background: var(--accent);
  color: var(--bg);
}

.camera-modal-btn--capture:hover {
  background: var(--accent-hover);
}

/* Captured image preview */
.captured-preview {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 160px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 500;
}

.captured-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.captured-preview-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.captured-preview-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Desktop app: mandatory update notification (bottom-left) */
.desktop-update-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.desktop-update-modal {
  background: var(--surface, #1c1c1e);
  border: 1px solid var(--border, #38383a);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.desktop-update-modal-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text, #fff);
}

.desktop-update-modal-text {
  margin: 0 0 24px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted, #98989d);
}

.desktop-update-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.desktop-update-modal-btn {
  padding: 10px 20px;
  border-radius: var(--radius, 10px);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.desktop-update-modal-btn--primary {
  background: var(--accent, #0a84ff);
  color: var(--bg, #fff);
}

.desktop-update-modal-btn--primary:hover {
  background: var(--accent-hover, #409cff);
}

.desktop-update-modal-btn--primary:disabled {
  opacity: 0.8;
  cursor: wait;
}

.desktop-update-modal-btn--secondary {
  background: var(--input-bg, #2c2c2e);
  color: var(--text-muted, #98989d);
}

.desktop-update-modal-btn--secondary:hover {
  color: var(--text, #fff);
}

.desktop-update-banner {
  position: fixed;
  bottom: 20px;
  /* Clear left sidebar (200px when open, 48px closed): sit in content area so always visible */
  left: 220px;
  z-index: 10002;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--surface, #1c1c1e);
  border: 1px solid var(--accent, #0a84ff);
  border-radius: var(--radius, 10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  max-width: min(420px, calc(100vw - 240px));
}

.desktop-update-banner-text {
  font-size: 0.9rem;
  color: var(--text, #fff);
  flex: 1;
  min-width: 0;
}

.desktop-update-banner-download {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: #0a84ff;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.desktop-update-banner-download:hover {
  background: #409cff;
  color: #fff;
}

.desktop-update-footer {
  position: fixed;
  bottom: 20px;
  left: 220px;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-muted, #98989d);
}

.desktop-update-footer-version {
  font-variant-numeric: tabular-nums;
}

.desktop-update-footer-check {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border, #38383a);
  background: transparent;
  color: var(--text-muted, #98989d);
  font-size: 0.8rem;
  cursor: pointer;
}

.desktop-update-footer-check:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #fff);
}

.desktop-update-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  padding: 10px 20px;
  background: var(--surface, #1c1c1e);
  border: 1px solid var(--border, #38383a);
  border-radius: var(--radius, 10px);
  font-size: 0.9rem;
  color: var(--text-muted, #98989d);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.desktop-update-toast--error {
  border-color: rgba(220, 80, 80, 0.5);
  color: #f0a0a0;
}

.desktop-update-toast--info {
  max-width: 480px;
  border-color: rgba(10, 132, 255, 0.4);
  color: #a0c8ff;
}

.desktop-update-toast--info code {
  font-size: 0.85em;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

/* ── Message feedback (thumbs up/down) ── */
.message-feedback {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.message:hover .message-feedback,
.message--solution:hover .message-feedback {
  opacity: 1;
}
.message-feedback-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}
.message-feedback-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,0.05);
}
.message-feedback-btn:disabled {
  cursor: default;
}
.message-feedback-btn--active {
  color: rgba(52, 211, 153, 0.9) !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
}
.message-feedback-btn--active-down {
  color: rgba(239, 68, 68, 0.9) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
.screen-share-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  /* .app-center already applies horizontal padding — doubling made Assist narrower than Ask/Explore */
  padding: 0;
}

.screen-share-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
  padding: 0;
}

.back-btn:hover {
  color: var(--accent);
}

.screen-share-header h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.screen-share-tagline {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.screen-share-start {
  padding: 32px 0;
  text-align: center;
}

.screen-share-allow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 420px;
  margin: 0 auto;
}

.screen-share-allow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  width: 100%;
}

.screen-share-allow-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}

.screen-share-allow-desc {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.screen-share-allow-desc strong {
  color: var(--text);
}

.screen-share-allow-requesting {
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.screen-share-allow-denied {
  margin-bottom: 20px;
  padding: 12px 14px;
  background: rgba(251, 191, 36, 0.15);
  border-radius: var(--radius);
  text-align: left;
}

.screen-share-allow-denied p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text);
}

.screen-share-open-settings--primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.screen-share-open-settings--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg);
}

.start-share-btn--allow {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.05rem;
}

.screen-share-allow-hint {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.screen-share-hint--below-allow {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.screen-share-start-prompt {
  margin: 0 0 20px;
  font-size: 1rem;
  color: var(--text);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.start-share-btn {
  padding: 14px 24px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 1rem;
}

.start-share-btn:hover {
  background: var(--accent-hover);
}

.screen-share-hint {
  margin: 12px auto 0;
  max-width: 320px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.screen-share-hint--permission {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.screen-share-open-settings {
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.screen-share-open-settings:hover {
  background: var(--input-bg);
  border-color: var(--accent);
}

.screen-share-error {
  margin-top: 12px;
  color: #f87171;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.screen-share-error-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.screen-share-connect-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 180, 50, 0.12);
  border: 1px solid rgba(255, 180, 50, 0.25);
  border-radius: 10px;
  margin: 8px 0;
  font-size: 0.82rem;
  color: rgba(255, 210, 120, 0.85);
  flex-wrap: wrap;
}
.screen-share-connect-banner .screen-share-open-settings,
.screen-share-connect-banner .start-share-btn--inline {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.screen-share-connect-banner .start-share-btn--inline:hover,
.screen-share-connect-banner .screen-share-open-settings:hover {
  background: rgba(255, 255, 255, 0.18);
}

.screen-share-active {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 16px 0;
}

/* Top-right: live command / status while Assist is active */
.screen-share-command-hud {
  position: absolute;
  top: 58px;
  right: 12px;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(22, 22, 24, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.screen-share-command-hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--text-muted);
}

.screen-share-command-hud--hearing .screen-share-command-hud-dot {
  background: #38bdf8;
  animation: assist-hud-pulse 1.2s ease-in-out infinite;
}

.screen-share-command-hud--working .screen-share-command-hud-dot {
  background: #fbbf24;
  animation: assist-hud-pulse 1s ease-in-out infinite;
}

.screen-share-command-hud--speaking .screen-share-command-hud-dot {
  background: #c084fc;
  animation: assist-hud-pulse 1.3s ease-in-out infinite;
}

.screen-share-command-hud--ready .screen-share-command-hud-dot {
  background: #4ade80;
  opacity: 0.85;
}

@keyframes assist-hud-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.15); }
}

.screen-share-command-hud-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.screen-share-command-hud-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.screen-share-command-hud-detail {
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}

.screen-share-command-hud--hearing .screen-share-command-hud-title {
  color: #7dd3fc;
}

.screen-share-command-hud--working .screen-share-command-hud-title {
  color: #fcd34d;
}

.screen-share-command-hud--speaking .screen-share-command-hud-title {
  color: #d8b4fe;
}

.screen-share-command-hud--ready .screen-share-command-hud-title {
  color: #86efac;
}

.screen-share-live-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  margin-bottom: 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fca5a5;
}

.screen-share-stop-in-banner {
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #b91c1c;
  background: #dc2626;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.screen-share-stop-in-banner:hover {
  background: #ef4444;
  border-color: #dc2626;
  color: #fff;
}

.screen-share-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: screen-share-pulse 1.4s ease-in-out infinite;
}

@keyframes screen-share-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.screen-share-body {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 16px;
  align-items: stretch;
}

.screen-preview-wrap {
  position: relative;
  flex: 1;
  min-height: 50vh;
  max-height: calc(100dvh - 200px);
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  z-index: 1;
}

.screen-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  /* Smooth anti-aliasing for annotation shapes and text */
  image-rendering: auto;
}

.screen-mic-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 16px;
}

.screen-mic-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}

.screen-mic-btn:hover {
  transform: scale(1.05);
}

.screen-mic-btn.active {
  background: var(--accent);
  color: var(--bg);
}

.screen-mic-btn.active:hover {
  background: var(--accent-hover);
}

.screen-mic-btn:not(.active) {
  background: var(--surface);
  color: var(--text-muted);
  border: 2px solid var(--border);
}

.screen-mic-btn:not(.active):hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.screen-mic-btn svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.screen-mic-listening {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--accent);
}

.screen-mic-wrap .screen-share-error {
  margin-top: 6px;
  font-size: 0.8rem;
}

.screen-aria-response {
  display: flex;
  flex-direction: column;
  min-width: 260px;
  max-width: 320px;
  flex-shrink: 0;
}

.screen-aria-response-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.screen-aria-speaking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}

.screen-aria-speaking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: screen-share-pulse 1s ease-in-out infinite;
}

.screen-aria-response-box {
  flex: 1;
  min-height: 80px;
  padding: 12px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
}

.screen-aria-response-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.screen-aria-response-placeholder {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.screen-aria-model-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(10, 132, 255, 0.12);
  color: #5ac8fa;
  border: 1px solid rgba(10, 132, 255, 0.25);
  user-select: none;
}

/* Same layout as main Ask row: blue + (add), field, send, mic + who’s talking, red Stop */
.screen-share-input-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0;
  background: #2c2c2e;
  border-radius: 999px;
  padding: 8px 8px 8px 12px;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 52px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.screen-share-input-row .input-add-wrap {
  margin-right: 10px;
}

/* Match main chat: blue circular + (scoped so Assist always picks it up) */
.screen-share-input-row .input-add-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: none;
  background: #0a84ff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 0;
}

.screen-share-input-row .input-add-btn:hover {
  background: #409cff;
}

.assist-mic-with-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 4px;
  gap: 2px;
  min-width: 44px;
}

.assist-mic-who {
  line-height: 1;
}

.assist-mic-who-text {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.assist-mic-who-text--aria {
  color: #fecaca;
}

.assist-mic-who-text--you {
  color: #7dd3fc;
}

.assist-mic-who-text--idle {
  color: rgba(161, 161, 170, 0.95);
}

.screen-share-input-row .screen-share-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-size: 1rem;
}

.screen-share-input-row .screen-share-input:focus {
  outline: none;
}

.screen-share-input-row .input-send-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 2px;
}

.screen-share-input-row .input-send-btn:hover:not(:disabled) {
  color: var(--accent-hover);
  background: rgba(255, 255, 255, 0.08);
}

.screen-share-input-row .input-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--text-muted);
}

.screen-share-input-row .input-mic-btn {
  margin-left: 2px;
}

.screen-share-stop-btn {
  flex-shrink: 0;
  margin-left: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #b91c1c;
  background: #dc2626;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
  white-space: nowrap;
}

.screen-share-stop-btn:hover {
  background: #ef4444;
  border-color: #dc2626;
  color: #fff;
}

.add-menu-item--disabled {
  opacity: 0.6;
  cursor: default;
}

.add-menu-item--disabled:hover,
.add-menu-item:disabled:hover {
  background: transparent;
  color: var(--text);
}

.screen-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ── Aria Settings Panel ── */
.aria-settings-panel {
  margin-top: 12px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
  padding-top: 8px;
}
.aria-settings-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-muted, rgba(255,255,255,0.5));
  font-size: 0.82rem;
  cursor: pointer;
  padding: 6px 0;
  width: 100%;
  transition: color 0.15s;
}
.aria-settings-toggle:hover { color: var(--text, #fff); }
.aria-settings-chevron { transition: transform 0.2s ease; }
.aria-settings-chevron--open { transform: rotate(180deg); }
.aria-settings-body {
  padding: 8px 0 4px;
}
.aria-settings-section {
  padding: 8px 0;
}
.aria-settings-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text, #fff);
  margin: 0 0 4px;
}
.aria-settings-desc {
  font-size: 0.78rem;
  color: var(--text-muted, rgba(255,255,255,0.5));
  margin: 0 0 10px;
  line-height: 1.4;
}
.aria-settings-desc strong { color: var(--text, #fff); }

/* Toggle switch */
.aria-settings-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text, #fff);
  cursor: pointer;
  padding: 4px 0;
}
.aria-settings-sub-option {
  padding-left: 46px;
  color: var(--text-muted, rgba(255,255,255,0.5));
}
.aria-settings-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.aria-settings-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.aria-settings-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  transition: background 0.2s;
  cursor: pointer;
}
.aria-settings-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.aria-settings-switch--on .aria-settings-switch-track {
  background: var(--accent, #6c5ce7);
}
.aria-settings-switch--on .aria-settings-switch-track::after {
  transform: translateX(16px);
}

/* Device ID display */
.aria-settings-device-id {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 4px 0;
}
.aria-settings-device-id-label {
  font-size: 0.75rem;
  color: var(--text-muted, rgba(255,255,255,0.4));
}
.aria-settings-device-id-value {
  font-size: 0.75rem;
  color: var(--text-muted, rgba(255,255,255,0.4));
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}

/* Settings input (web device ID) */
.aria-settings-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--input-bg, rgba(255,255,255,0.04));
  color: var(--text, #fff);
  font-size: 0.82rem;
  margin-top: 4px;
}

/* Error spoken by Aria — more prominent */
.screen-share-error--spoken {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: #e74c3c;
}

.screen-input {
  flex: 1;
  min-width: 180px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
}

.screen-send-btn,
.stop-share-btn {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
}

.screen-send-btn {
  border: none;
  background: var(--accent);
  color: var(--bg);
}

.screen-send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.screen-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stop-share-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
}

.stop-share-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.screen-reply {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Assist Mic Orb (large centered circle, matches home screen) ── */
.assist-mic-orb-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 0 10px;
}

.assist-mic-orb {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, box-shadow 0.25s, color 0.25s;
  position: relative;
  color: var(--text-muted, rgba(200,200,220,0.85));
  -webkit-tap-highlight-color: transparent;
}
.assist-mic-orb:hover {
  background: rgba(255, 255, 255, 0.12);
}
.assist-mic-orb:active {
  transform: scale(0.96);
}

/* Idle — flat white (matches home screen idle) */
.assist-mic-orb--idle {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
}

/* User speaking — solid blue fill (matches home screen) */
.assist-mic-orb--user-speaking {
  background: rgba(31, 111, 255, 0.9);
  color: #eaf4ff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.35), 0 0 20px rgba(31, 111, 255, 0.45);
  animation: orb-speaking-pulse 0.55s ease-in-out infinite;
}

/* Aria speaking — solid red fill (matches home screen) */
.assist-mic-orb--aria-speaking {
  background: rgba(220, 52, 72, 0.92);
  color: #ffe9ec;
  box-shadow: 0 0 0 4px rgba(220, 52, 72, 0.35), 0 0 20px rgba(220, 52, 72, 0.45);
  animation: orb-aria-pulse 0.8s ease-in-out infinite;
}

/* Working — amber */
.assist-mic-orb--working {
  background: rgba(245, 158, 11, 0.25);
  box-shadow: 0 0 16px 4px rgba(245, 158, 11, 0.2);
}

/* Mic off — dim */
.assist-mic-orb:not(.assist-mic-orb--on) {
  background: rgba(20, 18, 30, 0.7);
  opacity: 0.7;
}
.assist-mic-orb:not(.assist-mic-orb--on) svg {
  color: rgba(180, 180, 200, 0.5);
}

.assist-mic-orb-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(148, 148, 160, 0.35);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s, background 0.25s;
}
/* On (listening) inner: purple tint */
.assist-mic-orb--on .assist-mic-orb-inner {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(61, 45, 92, 0.5);
}
/* Idle inner: bright white border (after --on so it wins when both classes present) */
.assist-mic-orb--idle .assist-mic-orb-inner {
  border-color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
}
.assist-mic-orb--user-speaking .assist-mic-orb-inner {
  border-color: rgba(168, 206, 255, 0.95);
  background: rgba(24, 90, 204, 0.55);
}
.assist-mic-orb--aria-speaking .assist-mic-orb-inner {
  border-color: rgba(255, 192, 199, 0.95);
  background: rgba(165, 34, 51, 0.55);
}

/* Equalizer bars inside orb */
.assist-mic-orb-eq {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3.5px;
  height: 28px;
}
.assist-mic-orb-eq-bar {
  width: 4.5px;
  min-height: 4px;
  border-radius: 2px;
  background: rgba(167, 139, 250, 0.7);
  height: calc(5px + (var(--i) + 1) * 2.5px);
  max-height: 26px;
  animation: orb-eq-idle 1.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
  transition: background 0.2s ease;
}
.assist-mic-orb--user-speaking .assist-mic-orb-eq-bar {
  background: rgba(188, 229, 255, 0.96);
  animation: orb-eq-active 0.45s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.07s);
}
.assist-mic-orb--aria-speaking .assist-mic-orb-eq-bar {
  background: rgba(255, 205, 212, 0.96);
  animation: orb-eq-active 0.7s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.1s);
}

/* Label below orb */
.assist-mic-orb-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(180, 180, 200, 0.7);
  transition: color 0.2s;
}
.assist-mic-orb--user-speaking ~ .assist-mic-orb-label {
  color: #7dd3fc;
}
.assist-mic-orb--aria-speaking ~ .assist-mic-orb-label {
  color: #fecaca;
}

/* Animations */
@keyframes orb-speaking-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4), 0 0 14px rgba(31, 111, 255, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15), 0 0 24px rgba(31, 111, 255, 0.55); }
}
@keyframes orb-aria-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(220, 52, 72, 0.4), 0 0 14px rgba(220, 52, 72, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(220, 52, 72, 0.15), 0 0 24px rgba(220, 52, 72, 0.55); }
}
@keyframes orb-eq-idle {
  0%, 100% { height: calc(4px + var(--i) * 1px); }
  50% { height: calc(8px + var(--i) * 3px); }
}
@keyframes orb-eq-active {
  0%, 100% { height: 6px; }
  25% { height: 16px; }
  50% { height: 22px; }
  75% { height: 12px; }
}

/* ── Action Cards: rich visual results for food, shopping, rides ── */
.aria-action-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.aria-action-cards::-webkit-scrollbar { display: none; }

.aria-action-card {
  flex: 0 0 auto;
  width: 150px;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.aria-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.aria-action-card-img-wrap {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  padding: 12px;
}
.aria-action-card-img {
  max-width: 72px;
  max-height: 56px;
  object-fit: contain;
  border-radius: 6px;
}
.aria-action-card-img-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
}
.aria-action-card-img-fallback {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted, rgba(255,255,255,0.5));
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aria-action-card-body {
  padding: 8px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.aria-action-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aria-action-card-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted, rgba(255,255,255,0.5));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aria-action-card-price {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent, #6c5ce7);
  margin-top: 1px;
}

.aria-action-card-btn {
  margin: 6px 10px 10px;
  padding: 6px 0;
  border: none;
  border-radius: 8px;
  background: var(--accent, #6c5ce7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  text-align: center;
}
.aria-action-card-btn:hover {
  background: var(--accent-hover, #5a4bd1);
  transform: scale(1.02);
}
.aria-action-card-btn:active {
  transform: scale(0.98);
}

/* Category accent colors */
.aria-action-card--food .aria-action-card-btn { background: #e74c3c; }
.aria-action-card--food .aria-action-card-btn:hover { background: #c0392b; }
.aria-action-card--food .aria-action-card-price { color: #e74c3c; }

.aria-action-card--rides .aria-action-card-btn { background: #000; }
.aria-action-card--rides .aria-action-card-btn:hover { background: #222; }

.aria-action-card--shopping .aria-action-card-btn { background: #f39c12; }
.aria-action-card--shopping .aria-action-card-btn:hover { background: #d68910; }
.aria-action-card--shopping .aria-action-card-price { color: #f39c12; }

/* Responsive: smaller cards on narrow screens */
@media (max-width: 480px) {
  .aria-action-card { width: 130px; }
  .aria-action-card-img-wrap { height: 64px; padding: 8px; }
  .aria-action-card-img { max-width: 56px; max-height: 44px; }
}

/* ── Agent Action Status Pill ── */
/* Floating overlay that shows what AI is doing on the computer (clicking, typing, verifying) */
.agent-status-pill {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: agentPillSlideIn 0.3s ease-out;
  transition: opacity 0.4s ease, transform 0.4s ease;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-status-pill--fading {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

@keyframes agentPillSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.agent-status-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.agent-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Phase-specific accent colors */
.agent-status-pill--executing {
  border-left: 3px solid #3b82f6;
}
.agent-status-pill--verifying {
  border-left: 3px solid #f59e0b;
}
.agent-status-pill--verified,
.agent-status-pill--done {
  border-left: 3px solid #10b981;
}
.agent-status-pill--correcting {
  border-left: 3px solid #f59e0b;
}
.agent-status-pill--error {
  border-left: 3px solid #ef4444;
}

/* Mini progress bar for multi-step actions */
.agent-status-progress {
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  flex-shrink: 0;
}
.agent-status-progress-bar {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: #3b82f6;
  transition: width 0.3s ease;
}
.howto-thumbnails {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  background: #000;
}

.howto-thumbnails-muted,
.howto-thumbnails-error {
  margin: 0;
  padding: 24px 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  flex-shrink: 0;
}

.howto-thumbnails-error {
  color: #f87171;
}

/* Vertical scroll-snap feed — one video per screen */
.howto-thumbnails-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.howto-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.howto-slide-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.howto-slide-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 16px 20px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Dot indicators */
.howto-dots {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.howto-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.howto-dot--active {
  background: #fff;
  transform: scale(1.4);
}

.howto-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}
.image-gen-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  align-items: stretch;
}

.image-gen-header {
  flex-shrink: 0;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--border);
}

.image-gen-mode-top {
  display: flex;
  gap: 10px;
  margin: 12px 0 10px;
}

.image-gen-mode-top-btn {
  padding: 10px 24px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.image-gen-mode-top-btn:hover:not(:disabled) {
  border-color: var(--text-muted);
  color: var(--text);
}

.image-gen-mode-top-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.image-gen-mode-top-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.image-gen-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.image-gen-tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.image-gen-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.image-gen-form {
  flex: 0 0 50%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 20px 24px 0;
}

.image-gen-field {
  margin-bottom: 20px;
}

/* Video model dropdown — reference image or frame to frame */
.image-gen-field-video-mode {
  margin-bottom: 16px;
}
.image-gen-video-mode-select {
  width: 100%;
  max-width: 280px;
  margin-top: 6px;
}

/* Keep the 3 reference slots section from collapsing */
.image-gen-field-refs-three {
  min-width: 0;
}

.image-gen-field-refs-three .image-gen-refs-three {
  display: grid !important;
}

.image-gen-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.image-gen-prompt {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  box-sizing: border-box;
}

.image-gen-prompt:focus {
  outline: none;
  border-color: var(--accent);
}

.image-gen-prompt::placeholder {
  color: var(--text-muted);
}

.image-gen-dialog-input {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  resize: vertical;
  font: inherit;
  color: var(--text);
  font-size: 0.95rem;
}
.image-gen-dialog-input:focus {
  outline: none;
  border-color: var(--accent);
}
.image-gen-dialog-input::placeholder {
  color: var(--text-muted);
}

.image-gen-mode {
  display: flex;
  gap: 8px;
}

.image-gen-mode-btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.image-gen-mode-btn:hover:not(:disabled) {
  border-color: var(--text-muted);
  color: var(--text);
}

.image-gen-mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.image-gen-mode-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.image-gen-mode-hint {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.image-gen-ref-hint {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.image-gen-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.image-gen-ref-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 140px;
}

.image-gen-ref-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.image-gen-ref-add {
  width: 100%;
  height: 100px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-gen-ref-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.image-gen-ref-preview {
  position: relative;
  width: 140px;
  height: 100px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--input-bg);
  border: 1px solid var(--border);
}

.image-gen-ref-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-gen-ref-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.image-gen-ref-remove:hover {
  background: rgba(0, 0, 0, 0.85);
}

.image-gen-ref-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.image-gen-frames {
  margin-top: 4px;
}

/* Force 3 reference image slots in a single row so all are visible */
.image-gen-refs-three {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 16px;
  width: 100%;
  min-width: 320px;
  box-sizing: border-box;
}

.image-gen-refs-three .image-gen-ref-slot {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Legacy: keep when only used for character in video */
.image-gen-refs-character {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.image-gen-refs-character .image-gen-ref-slot {
  flex: 0 0 auto;
}

/* Clear drop zones for the 3 reference slots */
.image-gen-ref-slot-droppable {
  min-width: 140px;
}

.image-gen-ref-slot-droppable:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.image-gen-check-row {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.image-gen-check-btn {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.image-gen-check-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.image-gen-check-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.image-gen-check-result {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.image-gen-check-result--ok {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--text);
}

.image-gen-check-result--warn {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.35);
  color: var(--text);
}

.image-gen-check-message {
  margin: 0 0 6px;
  font-weight: 500;
  line-height: 1.4;
}

.image-gen-check-score {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.image-gen-check-tips {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  line-height: 1.45;
}

.image-gen-check-tips li {
  margin-bottom: 4px;
}

.image-gen-video-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.image-gen-video-text-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.image-gen-video-text-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.image-gen-video-text-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 56px;
  box-sizing: border-box;
}

.image-gen-video-text-input:focus {
  outline: none;
  border-color: var(--accent);
}

.image-gen-video-text-input::placeholder {
  color: var(--text-muted);
}

.image-gen-combined-prompt {
  background: rgba(255, 255, 255, 0.04);
  cursor: default;
  color: var(--text);
}

.image-gen-voiceover-note {
  margin: 20px 0;
  padding: 14px 16px;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
}

.image-gen-voices-row {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-gen-elevenlabs-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.4;
}
.image-gen-elevenlabs-hint code {
  font-size: 0.85em;
  background: var(--input-bg);
  padding: 2px 6px;
  border-radius: 4px;
}
.image-gen-elevenlabs-hint-ok {
  color: var(--accent);
}

.image-gen-view--picture .image-gen-voices-row {
  display: none;
}

.image-gen-sound-row {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-gen-sound-row .image-gen-voices-label {
  margin-bottom: 0;
}

.image-gen-sound-select {
  max-width: 280px;
}

.image-gen-sound-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
}

.image-gen-sound-btn-group {
  display: inline-flex;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--input-bg);
}

.image-gen-sound-btn {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.image-gen-sound-btn:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface);
}

.image-gen-sound-btn.active {
  color: var(--text);
  background: var(--accent);
  color: #fff;
}

.image-gen-sound-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.image-gen-sound-btn + .image-gen-sound-btn {
  border-left: 1px solid var(--border);
}

.image-gen-voices-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.image-gen-voices-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-gen-voices-controls .image-gen-voice-select {
  flex: 1;
  max-width: 280px;
  margin: 0;
}

.image-gen-voice-play {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-gen-voice-play:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--accent);
}

.image-gen-voice-play:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.image-gen-voice-play-loading {
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.image-gen-voiceover-note strong {
  color: var(--accent);
}

.image-gen-voiceover-desc {
  margin: 8px 0 12px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
}

.image-gen-voice-list {
  margin-top: 12px;
}

.image-gen-voice-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.image-gen-voice-select {
  width: 100%;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.95rem;
}

.image-gen-voiceover-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.image-gen-view--picture .image-gen-voiceover-note {
  display: none;
}

.image-gen-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.image-gen-action-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.image-gen-action-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.image-gen-action-select {
  padding: 10px 12px;
  min-width: 120px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

.image-gen-action-select:focus {
  outline: none;
  border-color: var(--accent);
}

.image-gen-action-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.image-gen-actions-row .image-gen-submit {
  margin-left: auto;
}

.image-gen-submit {
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

.image-gen-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

.image-gen-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.image-gen-error {
  margin: 12px 0 0;
  color: #f87171;
  font-size: 0.9rem;
}

.image-gen-run-through-audio {
  margin-top: 24px;
  padding: 16px;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius);
}

.image-gen-run-through-audio .image-gen-label {
  margin-bottom: 4px;
}

.image-gen-run-through-audio .image-gen-ref-hint {
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.image-gen-run-through-audio .image-gen-ref-hint code {
  font-size: 0.8em;
  background: var(--input-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.image-gen-run-through-audio-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.image-gen-run-through-audio-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.95rem;
}

.image-gen-run-through-audio-input:focus {
  outline: none;
  border-color: var(--accent);
}

.image-gen-run-through-audio-input::placeholder {
  color: var(--text-muted);
}

.image-gen-run-through-audio-btn {
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.image-gen-run-through-audio-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.image-gen-run-through-audio-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.image-gen-result {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.image-gen-result-images {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.image-gen-result-img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.image-gen-result-img-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.image-gen-result-download {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  transition: background 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.image-gen-result-img-wrap:hover .image-gen-result-download,
.image-gen-result-download:focus-visible {
  opacity: 1;
}

.image-gen-result-download:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
}

.image-gen-results-panel {
  flex: 0 0 50%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 0 0 20px;
  border-left: 1px solid var(--border);
  background: var(--surface);
}

.image-gen-results-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
  padding-right: 20px;
  flex-wrap: wrap;
}

.image-gen-results-size-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.image-gen-results-per-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.image-gen-results-per-row-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-gen-results-per-row-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.image-gen-results-per-row-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* Single scrollable list of video/image cards (16:9 or 9:16) */
.image-gen-results-panel-scroll {
  flex: 1 1 0;
  min-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 12px;
  padding-bottom: 24px;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
}
.image-gen-results-panel-scroll::-webkit-scrollbar {
  width: 8px;
}
.image-gen-results-panel-scroll::-webkit-scrollbar-track {
  background: var(--input-bg, rgba(255,255,255,0.06));
  border-radius: 4px;
}
.image-gen-results-panel-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.image-gen-results-panel-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Consistent spacing between video cards/sections in the scroll list */
.image-gen-results-panel-scroll > .image-gen-main-video,
.image-gen-results-panel-scroll > .image-gen-saved-videos,
.image-gen-results-panel-scroll > .image-gen-tailored-audio-section,
.image-gen-results-panel-scroll > .image-gen-stored-audio-section,
.image-gen-results-panel-scroll > .image-gen-pinned-videos {
  margin-bottom: 24px;
}
.image-gen-results-panel-scroll .image-gen-saved-videos-list,
.image-gen-results-panel-scroll .image-gen-tailored-audio-list,
.image-gen-results-panel-scroll .image-gen-stored-audio-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.image-gen-results-panel-scroll .image-gen-results-list {
  gap: 20px;
}
.image-gen-results-list-first {
  margin-bottom: 24px;
}

/* Tighter meta text in 3–4 column grid so rows don’t overflow */
.image-gen-results-grid--3 .image-gen-result-video-meta,
.image-gen-results-grid--4 .image-gen-result-video-meta {
  font-size: 0.8rem;
  margin-top: 6px;
}
.image-gen-results-grid--4 .image-gen-result-video-meta {
  font-size: 0.75rem;
}

/* Unified video card: fill all available space (no empty gap to the right) */
.image-gen-results-panel-scroll .image-gen-hover-video-wrap {
  width: 100%;
  max-width: none;
  min-height: 120px;
  aspect-ratio: 9/16;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
  overflow: hidden;
  cursor: pointer;
}
.image-gen-results-panel-scroll .image-gen-hover-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.image-gen-results-panel-scroll .image-gen-video-portrait .image-gen-hover-video-wrap,
.image-gen-results-panel-scroll .image-gen-result-video-block .image-gen-hover-video-wrap {
  aspect-ratio: 9/16;
  max-width: none;
  max-height: 70vh;
}
.image-gen-results-panel-scroll .image-gen-result-video-block .image-gen-hover-video-wrap video {
  object-fit: contain;
}
.image-gen-video-card-16-9 {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
  overflow: hidden;
}
.image-gen-video-card-16-9 video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-gen-video-card-9-16 {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 9/16;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
  overflow: hidden;
}
.image-gen-video-card-9-16 video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-gen-results-panel-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.image-gen-results-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-gen-results-update {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
}

.image-gen-results-update:hover:not(:disabled) {
  background: var(--accent-hover);
}

.image-gen-results-update:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.image-gen-results-clear {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.image-gen-results-clear:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.image-gen-results-show-more-wrap {
  margin-top: 12px;
  padding: 8px 0;
}
.image-gen-results-show-more {
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.image-gen-results-show-more:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.image-gen-pipeline-status {
  margin: 0 0 12px;
  font-size: 0.8rem;
  line-height: 1.3;
}
.image-gen-pipeline-ok {
  color: var(--accent);
}
.image-gen-pipeline-warn {
  color: var(--text-muted);
}

.image-gen-progress {
  margin-bottom: 20px;
  padding: 16px 0;
}

.image-gen-progress-text {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.image-gen-progress-bar-wrap {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}

.image-gen-progress-bar-determinate {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.image-gen-progress-bar-indeterminate {
  height: 100%;
  width: 40%;
  background: var(--accent);
  border-radius: 4px;
  animation: image-gen-progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes image-gen-progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.image-gen-results-loading {
  margin: 0;
  padding: 16px 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.image-gen-results-empty {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 24px 0;
}

.image-gen-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Grid layouts: 1–4 per row for easier accessibility */
.image-gen-results-list.image-gen-results-grid--1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* When 1 per row: video fills the whole "Your videos" section (no empty space to the right) */
.image-gen-results-panel-scroll .image-gen-results-grid--1 {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.image-gen-results-panel-scroll .image-gen-results-grid--1 .image-gen-results-item {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.image-gen-results-panel-scroll .image-gen-results-grid--1 .image-gen-result-video-block {
  width: 100%;
  max-width: 100%;
}
.image-gen-results-panel-scroll .image-gen-results-grid--1 .image-gen-result-video-block .image-gen-hover-video-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100%;
  min-height: 65vh;
  max-height: 88vh;
  aspect-ratio: 9/16;
  box-sizing: border-box;
}
.image-gen-results-panel-scroll .image-gen-results-grid--1 .image-gen-result-video-block .image-gen-hover-video-wrap video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}
.image-gen-results-panel-scroll .image-gen-results-grid--1 .image-gen-result-images {
  width: 100%;
  max-width: 100%;
}
.image-gen-results-panel-scroll .image-gen-results-grid--1 .image-gen-result-images .image-gen-result-img {
  max-height: 85vh;
  width: 100%;
  max-width: 100%;
  object-fit: contain;
}

.image-gen-results-list.image-gen-results-grid--2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.image-gen-results-list.image-gen-results-grid--3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.image-gen-results-list.image-gen-results-grid--4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* Smaller thumbnails when 2–4 per row */
.image-gen-results-grid--2 .image-gen-result-video-block .image-gen-hover-video-wrap,
.image-gen-results-grid--2 .image-gen-result-images {
  max-width: 100%;
}
.image-gen-results-grid--2 .image-gen-hover-video-wrap { max-width: 100%; aspect-ratio: 9/16; }
.image-gen-results-grid--3 .image-gen-result-video-block .image-gen-hover-video-wrap,
.image-gen-results-grid--3 .image-gen-result-images { max-width: 100%; }
.image-gen-results-grid--3 .image-gen-hover-video-wrap { max-width: 100%; aspect-ratio: 9/16; }
.image-gen-results-grid--4 .image-gen-result-video-block .image-gen-hover-video-wrap,
.image-gen-results-grid--4 .image-gen-result-images { max-width: 100%; }
.image-gen-results-grid--4 .image-gen-hover-video-wrap { max-width: 100%; aspect-ratio: 9/16; }

.image-gen-results-item {
  margin: 0;
  padding: 0;
  min-width: 0;
  width: 100%;
}

/* Result blocks fill their cell so video/image uses all space */
.image-gen-results-panel-scroll .image-gen-result-video-block {
  width: 100%;
}
.image-gen-results-panel-scroll .image-gen-result-images {
  width: 100%;
}
.image-gen-results-panel-scroll .image-gen-result-images .image-gen-result-img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 50vh;
}

.image-gen-result-video-block {
  margin: 0;
}

/* Wrapper for hover-to-play videos (panel + results list) */
.image-gen-hover-video-wrap {
  display: block;
  width: 100%;
}

.image-gen-video-error {
  aspect-ratio: 9/16;
  max-width: 280px;
  background: var(--input-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  min-height: 120px;
}

.image-gen-video-error-hint {
  font-size: 0.8rem;
  margin: 0;
}

.image-gen-video-error-hint code {
  background: var(--surface);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.image-gen-video-placeholder {
  aspect-ratio: 9/16;
  max-width: 280px;
  min-height: 120px;
  background: var(--input-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}

.image-gen-video-placeholder .image-gen-result-video {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
}

.image-gen-result-video-player {
  display: block;
  width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
}

.image-gen-result-video-meta {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--text);
}

.image-gen-result-video-meta a {
  color: var(--accent);
}

.image-gen-result-video-meta a:hover {
  text-decoration: underline;
}

.image-gen-results-item .image-gen-result-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.image-gen-results-item .image-gen-result-img {
  max-height: 320px;
}
.image-gen-results-panel-scroll .image-gen-results-item .image-gen-result-img {
  max-height: 50vh;
}

.image-gen-result-video {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.image-gen-result-video a {
  color: var(--accent);
}

.image-gen-result-video a:hover {
  text-decoration: underline;
}

.image-gen-result-specs {
  color: var(--text-muted);
  font-size: 0.9em;
}

.image-gen-result-audio-badge {
  color: var(--accent);
  font-size: 0.9em;
}

.image-gen-result-new-badge {
  color: var(--accent);
  font-weight: 600;
}

.image-gen-add-audio-btn {
  font-size: inherit;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.image-gen-add-audio-btn:hover:not(:disabled) {
  color: var(--text);
}
.image-gen-add-audio-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.image-gen-play-stored-sound-btn {
  font-size: 0.85rem;
  padding: 4px 10px;
  margin-left: 6px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.image-gen-play-stored-sound-btn:hover:not(:disabled) {
  background: var(--accent);
  color: var(--bg, #fff);
}
.image-gen-play-stored-sound-btn:disabled {
  cursor: wait;
  opacity: 0.8;
}

.image-gen-result-video-url {
  display: block;
  margin-top: 6px;
}
.image-gen-video-url-code {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--input-bg);
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-all;
  user-select: all;
}

.image-gen-watch-video-btn {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg, #fff);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.image-gen-watch-video-btn:hover {
  filter: brightness(1.1);
}

.image-gen-pinned-videos {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.image-gen-pinned-videos-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}
.image-gen-pinned-video-card {
  margin-bottom: 12px;
}
.image-gen-pinned-video-card:last-child {
  margin-bottom: 0;
}
.image-gen-pinned-video-player {
  width: 100%;
  max-width: 480px;
  border-radius: 8px;
  background: #000;
  display: block;
  margin-bottom: 6px;
}
.image-gen-pinned-video-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.9rem;
}
.image-gen-pinned-video-filename {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-gen-main-video {
  margin-bottom: 24px;
}
.image-gen-main-video-title,
.image-gen-saved-videos-title,
.image-gen-tailored-audio-title,
.image-gen-stored-audio-title {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.image-gen-main-video-player {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 9/16;
  max-height: 70vh;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
  display: block;
  margin-bottom: 8px;
}
.image-gen-main-video-watch {
  margin-top: 4px;
}
.image-gen-main-video-reset {
  margin-left: 8px;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.image-gen-main-video-reset:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.image-gen-stored-audio-section {
  margin-bottom: 24px;
}
.image-gen-stored-audio-note {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.image-gen-stored-audio-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Single video at a time: full 9:16 frame, whole video visible (no crop) */
.image-gen-your-videos-single {
  margin-bottom: 24px;
}
.image-gen-your-videos-single .image-gen-stored-audio-title {
  margin: 0 0 12px;
}
.image-gen-your-videos-single-frame {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 9/16;
  max-height: 85vh;
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: block;
}
.image-gen-your-videos-single-frame .image-gen-hover-video-wrap {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  aspect-ratio: unset !important;
  display: block;
}
.image-gen-your-videos-single-frame .image-gen-hover-video-wrap video,
.image-gen-your-videos-single-player {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block;
}
.image-gen-your-videos-single-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}
.image-gen-your-videos-prev,
.image-gen-your-videos-next {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}
.image-gen-your-videos-prev:hover:not(:disabled),
.image-gen-your-videos-next:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.image-gen-your-videos-prev:disabled,
.image-gen-your-videos-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.image-gen-your-videos-counter {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Grid of video-only cards – larger so you see the whole video */
.image-gen-stored-audio-list-videos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
/* List with video + meta (filename, badges, buttons) - video on top, always visible */
.image-gen-stored-audio-list-with-videos .image-gen-stored-audio-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.image-gen-stored-audio-list-with-videos .image-gen-stored-audio-item:last-child {
  border-bottom: none;
}
.image-gen-stored-audio-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.image-gen-stored-audio-list-videos .image-gen-stored-audio-item {
  padding: 0;
  border-bottom: none;
}
.image-gen-stored-audio-item:last-child {
  border-bottom: none;
}
/* Ensure the video is visible: wrapper has fixed aspect ratio and size */
.image-gen-stored-audio-item .image-gen-hover-video-wrap {
  width: 100%;
  max-width: 280px;
  min-height: 140px;
  aspect-ratio: 9/16;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
}
/* Your videos section: 9:16 frame, whole video visible (no crop) */
.image-gen-stored-audio-list-videos .image-gen-stored-audio-item .image-gen-hover-video-wrap {
  max-width: 100%;
  width: 100%;
  aspect-ratio: 9/16;
  min-height: 0;
}
.image-gen-stored-audio-list-videos .image-gen-stored-audio-item .image-gen-hover-video-wrap video {
  object-fit: contain;
}
.image-gen-stored-audio-item .image-gen-hover-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-gen-stored-audio-item .image-gen-hover-video-wrap .image-gen-video-error {
  min-height: 140px;
}
.image-gen-stored-audio-list-videos .image-gen-stored-audio-item .image-gen-hover-video-wrap .image-gen-video-error {
  aspect-ratio: 9/16;
  min-height: 0;
}
.image-gen-stored-audio-item-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.image-gen-stored-audio-video {
  font-weight: 500;
  color: var(--text);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-gen-stored-audio-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.image-gen-stored-audio-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.image-gen-stored-audio-files {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.image-gen-stored-audio-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--input-bg);
  color: var(--text-muted);
}
.image-gen-stored-audio-no-video {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 9/16;
  max-height: 180px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-gen-tailored-audio-section {
  margin-bottom: 24px;
}
.image-gen-tailored-audio-note {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.image-gen-tailored-audio-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.image-gen-tailored-audio-item {
  padding: 0;
}
.image-gen-tailored-audio-player {
  width: 100%;
  max-width: 280px;
  max-height: 70vh;
  aspect-ratio: 9/16;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
  display: block;
  margin-bottom: 8px;
}
.image-gen-tailored-audio-meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.image-gen-tailored-audio-filename {
  font-weight: 500;
  color: var(--text);
}

.image-gen-stored-audio-section {
  margin-bottom: 24px;
}
.image-gen-stored-audio-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.image-gen-stored-audio-note {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.image-gen-stored-audio-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.image-gen-stored-audio-item {
  padding: 0;
}
.image-gen-stored-audio-player {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 9/16;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
  display: block;
  margin-bottom: 8px;
}
.image-gen-stored-audio-meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.image-gen-stored-audio-filename {
  font-weight: 500;
  color: var(--text);
}
.image-gen-stored-audio-badges {
  color: var(--text-muted);
}

.image-gen-saved-videos {
  margin-bottom: 24px;
}
.image-gen-saved-videos-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.image-gen-saved-videos-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.image-gen-saved-videos-item:last-child {
  border-bottom: none;
}
/* Uses unified .image-gen-results-panel-scroll .image-gen-hover-video-wrap (16:9) */
.image-gen-saved-videos-item .image-gen-hover-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-gen-saved-videos-item-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.image-gen-saved-videos-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.image-gen-saved-videos-filename {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-gen-watch-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.image-gen-watch-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  cursor: pointer;
}
.image-gen-watch-modal {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--surface, #1a1a1a);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.image-gen-watch-controls {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.image-gen-watch-controls .image-gen-watch-mute-btn,
.image-gen-watch-controls .image-gen-watch-close {
  pointer-events: auto;
}
.image-gen-watch-mute-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.6);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}
.image-gen-watch-mute-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: var(--accent);
  color: var(--accent);
}
.image-gen-watch-mute-label {
  font-weight: 500;
}
.image-gen-watch-close {
  position: static;
  width: 36px;
  flex-shrink: 0;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-gen-watch-close:hover {
  background: rgba(0, 0, 0, 0.8);
}
.image-gen-watch-video {
  width: 100%;
  height: auto;
  max-height: 90vh;
  display: block;
}

.image-gen-ref-droppable:focus {
  outline: none;
}
:root {
  color-scheme: dark;
  /* Same as Electron `BrowserWindow.backgroundColor` (shimmer-desktop/main.js) so web and Mac app match */
  --bg: #000000;
  --surface: #161618;
  --border: #2a2a2e;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #4ade80;
  --accent-hover: #86efac;
  --input-bg: #18181b;
  --radius: 12px;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  width: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Browser only: paint page background like the native window (class set in App.jsx) */
html.app--web {
  background: var(--bg);
}
html.app--web body {
  background: var(--bg);
}


button {
  font-family: var(--font);
  cursor: pointer;
}

input, textarea {
  font-family: var(--font);
}
