/* ===================================================
   Мой Секретарь — Modern iOS PWA Design System
   =================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  
  /* Brand colors - Warm Lime & Golden Chartreuse */
  --primary: #84cc16;
  --primary-hover: #65a30d;
  --primary-glow: rgba(132, 204, 22, 0.40);
  --accent: #a3e635;
  --accent-glow: rgba(163, 230, 53, 0.30);
  --success: #84cc16;
  --danger: #ef4444;
  --warning: #f59e0b;
  --purple: #84cc16;

  /* Dark theme tokens — Elegant Midnight Navy Canvas with +15% lighter elevated cards & squares */
  --bg-app: #0d1b33;
  --bg-hero: #12223e;
  --bg-card: #1e3150; /* 15% lighter elevated squares & rectangles! */
  --bg-card-hover: #273d62;
  --bg-input: #15243d;
  --border-color: rgba(163, 230, 53, 0.22);
  --border-active: #a3e635;
  
  --text-main: #ffffff;
  --text-muted: #cbd5e1;
  --text-sub: #94a3b8;
  
  --nav-bg: rgba(27, 44, 72, 0.94);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-mic: 0 0 40px rgba(132, 204, 22, 0.4), 0 0 80px rgba(163, 230, 53, 0.2);
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  color-scheme: dark;
}

[data-theme="light"] {
  /* Brand colors - Fresh Pastel Mint & Sage */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-glow: rgba(16, 185, 129, 0.35);
  --accent: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.22);
  --success: #10b981;
  --purple: #0d9488;

  /* Surfaces & backgrounds - Soft pastel mint / sage light with subtle tonal transitions */
  --bg-app: #f4fbf7;
  --bg-hero: #e6f6ee;
  --bg-card: #ffffff;
  --bg-card-hover: #f0fdf4;
  --bg-card-subtle: #edf7f1;
  --bg-input: #ffffff;
  --border-color: rgba(16, 185, 129, 0.24);
  --border-active: #10b981;

  /* Deep high-contrast typography (zero washout) */
  --text-main: #062817;
  --text-muted: #1e3a2b;
  --text-sub: #375545;

  --nav-bg: rgba(244, 251, 247, 0.96);
  --shadow-sm: 0 3px 12px rgba(16, 185, 129, 0.08);
  --shadow-md: 0 10px 26px rgba(16, 185, 129, 0.14);
  --shadow-mic: 0 0 35px rgba(16, 185, 129, 0.35);

  color-scheme: light;
}

[data-theme="light"] body {
  background-color: #f4fbf7;
  color: #062817;
  background-image:
    radial-gradient(ellipse 85% 50% at 50% -10%, rgba(16, 185, 129, 0.16) 0%, transparent 70%),
    radial-gradient(ellipse 65% 55% at 85% 90%, rgba(52, 211, 153, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 55% 50% at 10% 80%, rgba(110, 231, 183, 0.12) 0%, transparent 60%);
}

html {
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(30, 64, 175, 0.22) 0%, transparent 68%),
    radial-gradient(ellipse 70% 50% at 85% 85%, rgba(14, 165, 233, 0.12) 0%, transparent 60%);
  color: var(--text-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  max-width: 100vw;
  line-height: 1.5;
}

/* Offline Banner */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--warning);
  color: #000;
  padding: 6px 12px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.offline-banner.hidden,
.hidden {
  display: none !important;
}

/* Main Container */
.app-container {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 26px) 16px calc(env(safe-area-inset-bottom, 0px) + 95px) 16px;
  position: relative;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px 16px 4px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #0f172a;
  flex-shrink: 0;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.status-indicator {
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header Refresh Button */
.header-action-btn {
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary);
  border: 1.5px solid var(--border-color);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

[data-theme="light"] .header-action-btn {
  background: #e6f6ee;
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.10);
}

.header-action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.header-action-btn:active {
  transform: scale(0.96);
}

.refresh-spin-icon {
  transition: transform 0.3s ease;
}

.refresh-spin-icon.is-spinning {
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Pull to Refresh Indicator */
.pull-refresh-bar {
  height: 0;
  opacity: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  transition: height 0.12s ease-out, opacity 0.12s ease-out;
  margin-bottom: 4px;
}

.pull-refresh-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 10;
  transition: all 0.2s ease;
}

.icon-btn svg {
  pointer-events: none;
}

.icon-btn:hover,
.icon-btn:active {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

/* Theme icon toggling */
[data-theme="light"] .moon-icon { display: block; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: block; }

/* Voice Hero Section */
.voice-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 12px 0;
  text-align: center;
  position: relative;
  width: 100%;
}

.voice-hero-card {
  width: 100%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  margin-bottom: 6px;
  text-align: left;
}

.voice-hero-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.voice-hero-card:active {
  transform: scale(0.985);
}

.voice-hero-card.recording {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
  animation: cardRecordPulse 1.5s infinite alternate;
}

@keyframes cardRecordPulse {
  0% { border-color: rgba(239, 68, 68, 0.5); }
  100% { border-color: rgba(239, 68, 68, 1); }
}

.voice-hero-info {
  flex: 1;
  min-width: 0;
}

.voice-hero-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.voice-hero-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.voice-hero-sub {
  font-size: 0.75rem;
  color: var(--text-sub);
  display: block;
  margin-top: 2px;
}

[data-theme="light"] .voice-hero-card {
  background: #e1eed4;
  border: 2px solid rgba(90, 145, 12, 0.40);
  box-shadow: 0 4px 18px rgba(70, 120, 10, 0.12);
}

[data-theme="light"] .voice-hero-card .status-text {
  color: #000000 !important;
  font-weight: 800;
}

[data-theme="light"] .voice-hero-card .voice-hero-sub {
  color: #1a2516 !important;
  font-weight: 600;
}

[data-theme="light"] .voice-hero-badge {
  color: #2d5508 !important;
  background: rgba(132, 204, 22, 0.25) !important;
  border-color: rgba(90, 145, 12, 0.45) !important;
  font-weight: 800;
}

[data-theme="dark"] .voice-hero-card {
  background: #1e3150;
  border: 2px solid rgba(163, 230, 53, 0.22);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.40);
}

/* Subtle background glow behind mic */
.voice-hero::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 140px;
  background: radial-gradient(ellipse at 50% 40%,
    rgba(132, 204, 22, 0.16) 0%,
    rgba(163, 230, 53, 0.08) 50%,
    transparent 75%);
  pointer-events: none;
  border-radius: 50%;
  filter: blur(8px);
}

.mic-container {
  position: relative;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mic-button {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #a3e635 0%, #65a30d 100%);
  color: #0c1507;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px rgba(132, 204, 22, 0.3),
    0 0 20px rgba(132, 204, 22, 0.45),
    0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  z-index: 2;
  position: relative;
}

/* Inner shine on the mic button */
.mic-button::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 10px;
  width: 38%;
  height: 32%;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  filter: blur(4px);
  pointer-events: none;
}

.mic-button:hover {
  transform: scale(1.05);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.4),
    0 0 30px rgba(16, 185, 129, 0.65),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

.mic-button:active {
  transform: scale(0.94);
}

/* Active Recording Animation */
.mic-button.recording {
  background: linear-gradient(135deg, var(--danger), #f43f5e);
  box-shadow:
    0 0 0 1px rgba(239, 68, 68, 0.4),
    0 0 40px rgba(239, 68, 68, 0.6),
    0 0 80px rgba(244, 63, 94, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.5);
  animation: pulse-mic 1.4s infinite ease-in-out;
}

/* Three concentric pulse rings */
.mic-pulse-ring {
  position: absolute;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.mic-pulse-ring:nth-child(1) {
  width: 62px; height: 62px;
  top: 3px; left: 3px;
}
.mic-pulse-ring:nth-child(2) {
  width: 68px; height: 68px;
  top: 0; left: 0;
  border-color: rgba(16, 185, 129, 0.35);
}
.mic-pulse-ring:nth-child(3) {
  width: 74px; height: 74px;
  top: -3px; left: -3px;
  border-color: rgba(16, 185, 129, 0.2);
}

/* Idle gentle breathing rings (always-on, subtle) */
.mic-pulse-ring:nth-child(1) { animation: idle-ring1 3.5s infinite ease-in-out; }
.mic-pulse-ring:nth-child(2) { animation: idle-ring2 3.5s infinite ease-in-out 0.6s; }
.mic-pulse-ring:nth-child(3) { animation: idle-ring3 3.5s infinite ease-in-out 1.2s; }

@keyframes idle-ring1 {
  0%, 100% { opacity: 0; transform: scale(0.95); }
  50%       { opacity: 0.6; transform: scale(1.05); }
}
@keyframes idle-ring2 {
  0%, 100% { opacity: 0; transform: scale(0.93); }
  50%       { opacity: 0.4; transform: scale(1.08); }
}
@keyframes idle-ring3 {
  0%, 100% { opacity: 0; transform: scale(0.9); }
  50%       { opacity: 0.25; transform: scale(1.12); }
}

/* Active recording — faster ripple overrides */
.mic-button.recording ~ .mic-pulse-ring:nth-child(1) { animation: ripple-fast 1.2s infinite; }
.mic-button.recording ~ .mic-pulse-ring:nth-child(2) { animation: ripple-fast 1.2s infinite 0.3s; }
.mic-button.recording ~ .mic-pulse-ring:nth-child(3) { animation: ripple-fast 1.2s infinite 0.6s; }

@keyframes ripple-fast {
  0%   { opacity: 0.8; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.6); }
}

@keyframes pulse-mic {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.07); }
}

.status-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  min-height: 24px;
}

.recording-timer {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--danger);
  margin-top: 4px;
}

.recording-timer.hidden {
  display: none;
}


/* Quick Text Input */
.quick-input-form {
  display: flex;
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px 6px 4px 18px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.quick-input-form:focus-within {
  border-color: var(--border-active);
}

.quick-input-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-main);
  padding: 8px 4px;
  font-family: inherit;
}

.quick-input-form input::placeholder {
  color: var(--text-sub);
}

.send-btn {
  background: var(--primary);
  color: #000000 !important;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.send-btn svg {
  stroke: #000000 !important;
}

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

.send-btn:active {
  transform: scale(0.92);
}

/* Result Toast */
.result-toast {
  margin-top: 14px;
  width: 100%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

.result-toast.hidden {
  display: none;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Navigation Tabs: Modern Horizontal Scrollable Segmented Bar */
.nav-tabs {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  margin: 12px 0 16px 0;
  gap: 8px;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.tab-btn:active {
  transform: scale(0.96);
}

.tab-btn .tab-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.tab-btn .tab-label {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
}

.tab-btn.active {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.tab-btn[data-tab="finance"].active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45) !important;
}
.tab-btn[data-tab="shopping"].active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45) !important;
}
.tab-btn[data-tab="tasks"].active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45) !important;
}
.tab-btn[data-tab="translator"].active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.45) !important;
}
.tab-btn[data-tab="fitness"].active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.45) !important;
}
.tab-btn[data-tab="vitals"].active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45) !important;
}
.tab-btn[data-tab="media"].active {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45) !important;
}
.tab-btn[data-tab="movies"].active {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.45) !important;
}
.tab-btn[data-tab="inventory"].active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45) !important;
}
.tab-btn[data-tab="auto"].active {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.45) !important;
}
.tab-btn[data-tab="utilities"].active {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%) !important;
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.45) !important;
}
.tab-btn[data-tab="agent"].active {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%) !important;
  box-shadow: 0 4px 16px rgba(20, 184, 166, 0.45) !important;
}
.tab-btn[data-tab="vault"].active {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%) !important;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.45) !important;
}
.tab-btn[data-tab="feed"].active {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%) !important;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45) !important;
}

.vault-cat-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.18s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.vault-cat-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.vault-cat-pill.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
}

.vault-pill-count {
  background: rgba(255, 255, 255, 0.18);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

@media (min-width: 768px) {
  .nav-tabs {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 8px;
  }
}

/* Light theme tab enhancements */
[data-theme="light"] .tab-btn {
  background: #edf6e4;
  border: 1.5px solid rgba(90, 145, 12, 0.35);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(70, 120, 10, 0.08);
}

[data-theme="light"] .tab-btn:hover {
  background: #e1eed4;
  border-color: #65a30d;
  color: #000000;
}

[data-theme="light"] .tab-btn.active {
  background: linear-gradient(135deg, #65a30d 0%, #84cc16 100%) !important;
  color: #ffffff !important;
  border-color: #65a30d !important;
  box-shadow: 0 4px 14px rgba(101, 163, 13, 0.40) !important;
}

/* ===================================================
   BENTO GRID DASHBOARD (2 Columns - Light & Dark Ready)
   =================================================== */
.dashboard-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 360px) {
  .dashboard-bento-grid {
    gap: 8px;
  }
}

.bento-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  padding: 13px 13px 11px 13px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 140px;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.bento-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.bento-card:active {
  transform: scale(0.97);
}

[data-theme="light"] .bento-card {
  background: #ffffff;
  border: 1.5px solid rgba(16, 185, 129, 0.26);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.08);
}

[data-theme="light"] .bento-card:hover {
  background: #f0fdf4;
  border-color: #10b981;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.16);
}

[data-theme="light"] .bento-card.bento-card-business {
  background: linear-gradient(145deg, #ffffff 0%, #edf9f2 100%);
  border-color: rgba(16, 185, 129, 0.32);
}

[data-theme="light"] .bento-card.bento-card-tasks {
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
  border-color: rgba(16, 185, 129, 0.30);
}

[data-theme="light"] .bento-card.bento-card-shopping {
  background: linear-gradient(145deg, #ffffff 0%, #f4fbf7 100%);
  border-color: rgba(16, 185, 129, 0.28);
}

[data-theme="light"] .bento-card.bento-card-vault {
  background: linear-gradient(145deg, #ffffff 0%, #edf7f1 100%);
  border-color: rgba(16, 185, 129, 0.28);
}

[data-theme="light"] .bento-label,
[data-theme="light"] .bento-track-name,
[data-theme="light"] .bento-title-line,
[data-theme="light"] .bento-metric-value,
[data-theme="light"] .bento-action-label,
[data-theme="light"] .bento-arrow,
[data-theme="light"] .bento-safe-status {
  color: #062817 !important;
}

[data-theme="light"] .bento-track-sub,
[data-theme="light"] .bento-metric-caption,
[data-theme="light"] .bento-check-item {
  color: #1e3a2b !important;
  font-weight: 600;
}

[data-theme="light"] .bento-metric-sub {
  color: #047857 !important;
  font-weight: 800;
}

[data-theme="light"] .bento-btn-icon {
  color: #062817 !important;
}

[data-theme="light"] .bento-btn-play {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35) !important;
}

[data-theme="light"] .bento-pill {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #065f46 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .bento-pill.pill-amber {
  background: rgba(245, 158, 11, 0.20) !important;
  color: #92400e !important;
  border-color: rgba(245, 158, 11, 0.40) !important;
}

[data-theme="light"] .bento-pill.pill-teal {
  background: rgba(20, 184, 166, 0.20) !important;
  color: #115e59 !important;
  border-color: rgba(20, 184, 166, 0.40) !important;
}

[data-theme="light"] .bento-pill.pill-emerald {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #065f46 !important;
  border-color: rgba(16, 185, 129, 0.42) !important;
}

[data-theme="light"] .bento-pill.pill-safe {
  background: rgba(99, 102, 241, 0.20) !important;
  color: #3730a3 !important;
  border-color: rgba(99, 102, 241, 0.40) !important;
}

[data-theme="dark"] .bento-card {
  background: #1e3150;
  border: 1.5px solid rgba(163, 230, 53, 0.22);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.40);
}

[data-theme="dark"] .bento-card:hover {
  background: #273d62;
  border-color: #a3e635;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.50);
}

.bento-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bento-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bento-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.bento-label {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.bento-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.bento-pill.pill-amber {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.32);
}

.bento-pill.pill-teal {
  background: rgba(20, 184, 166, 0.14);
  color: #0d9488;
  border-color: rgba(20, 184, 166, 0.32);
}

.bento-pill.pill-emerald {
  background: rgba(16, 185, 129, 0.16);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.36);
}

.bento-pill.pill-safe {
  font-family: monospace;
  background: rgba(99, 102, 241, 0.14);
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.32);
}

.bento-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 3px 0 6px 0;
}

.bento-track-name,
.bento-title-line {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bento-track-sub {
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bento-metric-caption {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-sub);
}

.bento-metric-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.4px;
  margin: 1px 0;
}

.bento-metric-sub {
  font-size: 0.72rem;
  color: #059669;
  font-weight: 700;
}

.bento-checklist {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.bento-check-item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bento-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 6px;
}

[data-theme="dark"] .bento-progress-track {
  background: rgba(255, 255, 255, 0.12);
}

.bento-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 9999px;
}

.bento-safe-status {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
}

.bento-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 6px;
  margin-top: 2px;
}

.bento-action-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
}

.bento-arrow {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--primary);
}

.bento-btn-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a3e635, #84cc16) !important;
  color: #000000 !important;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(132, 204, 22, 0.45);
  transition: transform 0.15s ease;
}

.bento-btn-play:active {
  transform: scale(0.9);
}

.bento-btn-icon {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
  color: var(--text-sub);
}

.bento-btn-icon:hover {
  color: var(--primary);
}

/* Tab Panels */
.tab-panels {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: panelFade 0.25s ease;
}

.tab-panel.active {
  display: flex;
}

@keyframes panelFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 8px 2px;
}

.panel-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.action-btn-sm {
  background: var(--primary);
  color: #000000 !important;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.action-btn-sm:hover {
  background: var(--primary-hover);
}

.text-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

.text-btn.text-danger {
  color: var(--danger);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}

.stat-card {
  background: rgba(16, 25, 55, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.stat-label {
  font-size: 0.8rem;
  color: #cbd5e1;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-val.expense {
  color: #f87171;
  text-shadow: 0 0 20px rgba(248, 113, 113, 0.25);
}

.stat-val.income {
  color: #34d399;
  text-shadow: 0 0 20px rgba(52, 211, 153, 0.25);
}

.stat-subval {
  font-size: 0.84rem;
  color: #e2e8f0;
  font-weight: 600;
}

/* Items List */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  text-align: center;
  color: var(--text-sub);
  background: rgba(16, 25, 55, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.empty-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

/* Card Element */
.item-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s ease, background 0.18s ease;
  animation: cardEnter 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.item-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-md);
}

.item-card:active {
  transform: scale(0.985);
}

[data-theme="light"] .item-card {
  background: #e1eed4;
  border: 1.5px solid rgba(90, 145, 12, 0.40);
  box-shadow: 0 3px 12px rgba(70, 120, 10, 0.10);
}

[data-theme="light"] .item-card:hover {
  background: #d5e6c4;
  border-color: #65a30d;
}

[data-theme="dark"] .item-card {
  background: #1e3150;
  border: 1.5px solid rgba(163, 230, 53, 0.20);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.40);
}

[data-theme="dark"] .item-card:hover {
  background: #273d62;
  border-color: #a3e635;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  word-break: break-word;
}

[data-theme="dark"] .item-title {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .item-title {
  color: #000000 !important;
  text-shadow: none !important;
  font-weight: 800 !important;
}

.item-title.completed {
  text-decoration: line-through;
  color: #94a3b8 !important;
  text-shadow: none;
}

[data-theme="light"] .item-title.completed {
  color: #64748b !important;
}

.item-subtitle {
  font-size: 0.82rem;
  color: var(--text-sub);
  font-weight: 500;
  line-height: 1.4;
}

[data-theme="dark"] .item-subtitle {
  color: #cbd5e1 !important;
}

[data-theme="light"] .item-subtitle {
  color: #111827 !important;
  font-weight: 600 !important;
}

.badge-vault {
  background: rgba(14, 165, 233, 0.2) !important;
  color: #38bdf8 !important;
  border-color: rgba(14, 165, 233, 0.4) !important;
  font-weight: 700;
}

/* Category Badges with Vivid Accents */
.item-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.badge-finance {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}
.badge-finance.positive {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}
.badge-shopping {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}
.badge-tasks {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.25);
}
.badge-media {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.25);
}
.badge-auto {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.25);
}
.badge-inventory {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.25);
}
.badge-utilities {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.25);
}
.badge-fitness {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.25);
}

[data-theme="light"] .item-badge {
  color: #111827 !important;
  background: rgba(101, 163, 13, 0.22) !important;
  border-color: rgba(90, 145, 12, 0.40) !important;
  font-weight: 700 !important;
}

[data-theme="light"] .badge-finance {
  color: #991b1b !important;
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.38) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .badge-finance.positive {
  color: #065f46 !important;
  background: rgba(16, 185, 129, 0.20) !important;
  border-color: rgba(16, 185, 129, 0.40) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .badge-shopping {
  color: #92400e !important;
  background: rgba(245, 158, 11, 0.20) !important;
  border-color: rgba(245, 158, 11, 0.40) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .badge-tasks {
  color: #3730a3 !important;
  background: rgba(99, 102, 241, 0.18) !important;
  border-color: rgba(99, 102, 241, 0.38) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .badge-media {
  color: #5b21b6 !important;
  background: rgba(139, 92, 246, 0.18) !important;
  border-color: rgba(139, 92, 246, 0.38) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .badge-auto {
  color: #155e75 !important;
  background: rgba(6, 182, 212, 0.18) !important;
  border-color: rgba(6, 182, 212, 0.38) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .badge-inventory {
  color: #1e40af !important;
  background: rgba(59, 130, 246, 0.18) !important;
  border-color: rgba(59, 130, 246, 0.38) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .badge-utilities {
  color: #854d0e !important;
  background: rgba(234, 179, 8, 0.22) !important;
  border-color: rgba(234, 179, 8, 0.42) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .badge-fitness {
  color: #9a3412 !important;
  background: rgba(249, 115, 22, 0.20) !important;
  border-color: rgba(249, 115, 22, 0.40) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .badge-vault {
  color: #0369a1 !important;
  background: rgba(14, 165, 233, 0.20) !important;
  border-color: rgba(14, 165, 233, 0.40) !important;
  font-weight: 800 !important;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Custom Checkbox */
.custom-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: transparent;
}

.custom-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.delete-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.delete-btn:hover {
  color: var(--danger);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top, 12px));
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  z-index: 999;
  animation: fadeIn 0.2s ease;
  box-sizing: border-box;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.icon-btn-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  box-sizing: border-box;
  padding-bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 24px));
}

.modal-body label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--border-active);
}

.help-text {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.btn-primary {
  background: var(--primary);
  color: #000000 !important;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  cursor: pointer;
}

.btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

.test-result-text {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 6px;
}

/* ==========================================================================
   Step 5: Action Undo Floating Banner
   ========================================================================== */
.undo-floating-banner {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: calc(100% - 24px);
  max-width: 480px;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.undo-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(28, 28, 30, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  border-radius: 14px;
  padding: 10px 14px;
  color: #fff;
}

.undo-text {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.undo-btn {
  background: #ff9f0a;
  color: #000;
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.undo-btn:active {
  transform: scale(0.96);
}

.undo-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
}

/* ==========================================================================
   Step 5: Face-to-Face Live Translator
   ========================================================================== */
.translator-lang-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.lang-select {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
}

.icon-swap-btn {
  background: var(--bg-card-hover);
  color: var(--primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 1.1rem;
  cursor: pointer;
}

.split-translator-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 480px;
}

.translator-half {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-height: 220px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-half-flipped {
  transform: rotate(180deg);
  border-color: rgba(10, 132, 255, 0.4);
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.05), var(--bg-card));
}

.bottom-half-user {
  border-color: rgba(48, 209, 88, 0.4);
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.05), var(--bg-card));
}

.translator-half.listening-card {
  border-color: #ff3b30 !important;
  box-shadow: 0 0 16px rgba(255, 59, 48, 0.45);
}

.auto-dialog-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.auto-dialog-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.auto-dialog-btn.active {
  background: rgba(48, 209, 88, 0.2);
  border-color: #30d158;
  color: #30d158;
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.35);
}

.half-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.half-role-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.half-action-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
  cursor: pointer;
}

.translated-output {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  padding: 12px 0;
  flex: 1;
  word-break: break-word;
}

.face-mic-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0a84ff;
  color: #fff;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.face-mic-btn.primary {
  background: #30d158;
}

.face-mic-btn.recording {
  background: #ff453a !important;
  animation: pulse-ring 1.5s infinite;
}

.face-mic-btn:active {
  transform: scale(0.98);
}

.translator-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.divider-pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 1px;
}

/* ==========================================================================
   Step 5: Contacts Delegation Picker
   ========================================================================== */
.contacts-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.contact-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.contact-picker-item:hover {
  background: var(--bg-card-hover);
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.contact-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Step 6: Blood Pressure & Vitals Styling --- */
.bp-input-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}

.bp-big-input {
  width: 100%;
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-main);
  outline: none;
  font-family: monospace, -apple-system, sans-serif;
}

.tod-pill, .factor-pill, .bp-range-btn {
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tod-pill.active, .bp-range-btn.active {
  background: #ff453a;
  color: #fff;
  border-color: #ff453a;
  font-weight: 600;
}

.factor-pill.active {
  background: #0a84ff;
  color: #fff;
  border-color: #0a84ff;
  font-weight: 600;
}

.bp-log-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.bp-log-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bp-reading-val {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: monospace, sans-serif;
}

.bp-pulse-val {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- Blood Pressure Chart Viewport & Fullscreen Expand --- */
.bp-chart-viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  scrollbar-width: thin;
}

.bp-chart-viewport::-webkit-scrollbar {
  height: 6px;
}

.bp-chart-viewport::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.bp-chart-scroller {
  position: relative;
  height: 260px;
  min-width: 100%;
}

/* Fullscreen Chart Modal */
.chart-fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 10050;
  background: var(--bg-main);
  padding-top: max(12px, env(safe-area-inset-top, 12px));
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  padding-left: max(12px, env(safe-area-inset-left, 12px));
  padding-right: max(12px, env(safe-area-inset-right, 12px));
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.chart-fullscreen-modal .chart-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  gap: 8px;
}

.bp-modal-close-btn {
  background: #ff3b30 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.92rem !important;
  padding: 8px 16px !important;
  border-radius: 10px !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.bp-modal-close-btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.chart-fullscreen-modal .chart-modal-body {
  flex: 1;
  min-height: 0;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 8px;
  box-sizing: border-box;
}

.chart-fullscreen-modal .chart-modal-scroller {
  height: 100%;
  min-height: 280px;
  min-width: 100%;
  position: relative;
}

.chart-modal-footer {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.bp-modal-bottom-close-btn {
  width: 100%;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.bp-modal-bottom-close-btn:active {
  background: var(--border-color);
}

/* AI Agent interactive UI */
.agent-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}

.agent-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.agent-chip:hover {
  background: var(--bg-card-hover);
  border-color: #06b6d4;
  color: #06b6d4;
}

.agent-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #0a84ff;
  text-decoration: underline;
  word-break: break-all;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(10, 132, 255, 0.08);
}

.agent-link:hover {
  background: rgba(10, 132, 255, 0.16);
}

.icon-btn-mic {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.icon-btn-mic:active {
  transform: scale(0.9);
}

.icon-btn-mic.recording {
  animation: pulse-mic 1s infinite;
  background: rgba(255, 69, 58, 0.2);
}

/* Movie Watch & Torrent Link Buttons */
.movie-links-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.movie-links-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.movie-links-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.movie-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.movie-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.movie-link-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.movie-link-online {
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
}

.movie-link-torrent {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.movie-link-official {
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c4b5fd;
}

.movie-link-netflix {
  background: rgba(229, 9, 20, 0.18);
  border: 1px solid rgba(229, 9, 20, 0.45);
  color: #ff4d5a;
  font-weight: 700;
}

.movie-link-netflix:hover {
  background: #e50914;
  color: #ffffff;
  border-color: #e50914;
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.4);
}

/* ===================================================
   Music & In-Car Continuous Player Styles
   =================================================== */

.music-playlists-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.music-pl-pill {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.music-pl-pill:hover,
.music-pl-pill.active {
  background: var(--primary);
  color: #000000 !important;
  font-weight: 800;
  border-color: var(--primary);
  box-shadow: 0 2px 10px var(--primary-glow);
}

.music-track-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.music-track-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-1px);
}

.music-track-card.is-playing {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
}

.music-track-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.music-thumb-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

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

.music-thumb-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.music-track-card:hover .music-thumb-play-overlay,
.music-track-card.is-playing .music-thumb-play-overlay {
  opacity: 1;
}

.music-track-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.music-track-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-track-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.music-track-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.music-pill-tag {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
}

.music-track-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.music-icon-action {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  padding: 6px;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text-muted);
  transition: transform 0.15s ease, color 0.15s ease;
}

.music-icon-action:hover {
  transform: scale(1.15);
  color: var(--text-main);
}

.music-icon-action.fav-active {
  color: #ff3b30;
}

/* Floating Mini-Player at bottom */
.music-floating-player {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 12px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 580px;
  background: rgba(20, 32, 68, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(124, 58, 237, 0.25);
  z-index: 999;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

[data-theme="light"] .music-floating-player {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 0 20px rgba(99, 102, 241, 0.15);
}

.mini-player-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  cursor: pointer;
}

.mini-player-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c3aed, #06b6d4);
  transition: width 0.15s linear;
}

.mini-player-inner {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 10px;
}

.mini-player-cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mini-player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-player-play-badge {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mini-player-cover:hover .mini-player-play-badge {
  opacity: 1;
}

.mini-player-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.mini-player-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-artist {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-ctrl-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.15rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.mini-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.mini-play-btn {
  background: var(--primary);
  color: #000000 !important;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.mini-play-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.12);
}

/* Fullscreen Car Mode Overlay */
.music-fullscreen-modal {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 25%, #182859 0%, #080d22 100%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 20px) 20px env(safe-area-inset-bottom, 20px);
  color: #ffffff;
  overflow-y: auto;
}

.fs-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.fs-icon-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.fs-player-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.03em;
}

.fs-player-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
}

.fs-album-art-wrap {
  width: min(72vw, 300px);
  height: min(72vw, 300px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 40px rgba(124, 58, 237, 0.35);
  margin-bottom: 24px;
  position: relative;
  background: #111;
  transition: transform 0.4s ease;
}

.fs-album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fs-vinyl-center {
  display: none;
}

.fs-track-details {
  text-align: center;
  width: 100%;
  margin-bottom: 20px;
}

.fs-track-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.3;
}

.fs-track-artist {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

.fs-scrubber-wrap {
  width: 100%;
  margin-bottom: 24px;
}

.fs-time-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  accent-color: #06b6d4;
  cursor: pointer;
}

.fs-time-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}

/* Big Car-Friendly Touch Buttons */
.fs-controls-main {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  margin-bottom: 24px;
}

.fs-ctrl-sub {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.fs-ctrl-sub.active {
  color: #06b6d4;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.8);
}

.fs-ctrl-action {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  font-size: 1.7rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.fs-ctrl-action:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.fs-ctrl-bigplay {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  border: none;
  color: #ffffff;
  font-size: 2.3rem;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5), 0 0 20px rgba(6, 182, 212, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fs-ctrl-bigplay:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.65), 0 0 25px rgba(6, 182, 212, 0.45);
}

.fs-controls-secondary {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.fs-pill-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fs-pill-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.fs-pill-btn.active {
  background: #ff3b30;
  border-color: #ff3b30;
}

.fs-album-art.spinning {
  animation: vinylSpin 20s linear infinite;
}

@keyframes vinylSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fs-extra-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 16px;
  padding: 0 4px;
  gap: 16px;
}

.fs-volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.fs-icon-btn-sm {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s, transform 0.15s;
}

.fs-icon-btn-sm:hover {
  color: #ffffff;
  transform: scale(1.1);
}

.fs-volume-slider {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  accent-color: #06b6d4;
  cursor: pointer;
}

.fs-speed-wrap {
  display: flex;
  align-items: center;
}

.fs-pill-btn-sm {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #06b6d4;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fs-pill-btn-sm:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  transform: translateY(-1px);
}

/* Equalizer animation for playing item in track list */
.music-live-equalizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 13px;
  margin-left: 6px;
  vertical-align: middle;
}

.music-live-equalizer span {
  width: 3px;
  background: #06b6d4;
  border-radius: 1.5px;
  animation: musicEqBounce 0.7s ease-in-out infinite alternate;
}

.music-live-equalizer span:nth-child(2) { animation-delay: 0.2s; }
.music-live-equalizer span:nth-child(3) { animation-delay: 0.4s; }

@keyframes musicEqBounce {
  0% { height: 3px; }
  100% { height: 13px; }
}

.music-pill-tag.tag-cached {
  background: rgba(48, 209, 88, 0.15);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.3);
}

/* Queue Drawer in Fullscreen Mode */
.fs-queue-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(14, 22, 50, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px 24px 0 0;
  padding: 16px 20px 30px;
  display: flex;
  flex-direction: column;
  z-index: 2010;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.6);
  max-height: 70vh;
}

.fs-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* --- Block Activator / Manager Styles --- */
.tab-btn.block-hidden {
  display: none !important;
}

.blocks-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

.block-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.block-toggle-card:hover {
  border-color: var(--primary);
  background: rgba(14, 165, 233, 0.06);
}

.block-toggle-card.active {
  border-color: rgba(14, 165, 233, 0.5);
  background: rgba(14, 165, 233, 0.12);
}

.block-toggle-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.block-toggle-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.block-toggle-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}

.block-toggle-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.block-checkbox-custom {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  transition: all 0.2s;
  flex-shrink: 0;
}

.block-toggle-card.active .block-checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.blocks-presets-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.preset-pill-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-pill-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* --- Business & Cashflow Module Styles --- */
.biz-balance-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.biz-balance-hero.positive {
  border-color: rgba(48, 209, 88, 0.4);
  background: linear-gradient(145deg, var(--bg-card), rgba(48, 209, 88, 0.08));
}

.biz-balance-hero.negative {
  border-color: rgba(255, 69, 58, 0.4);
  background: linear-gradient(145deg, var(--bg-card), rgba(255, 69, 58, 0.08));
}

.biz-balance-hero.neutral {
  border-color: var(--border-color);
}

.biz-balance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.biz-balance-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.biz-balance-amount {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 14px;
}

.biz-balance-hero.positive .biz-balance-amount {
  color: #30d158;
}

.biz-balance-hero.negative .biz-balance-amount {
  color: #ff453a;
}

.biz-balance-hero.neutral .biz-balance-amount {
  color: var(--text-main);
}

.biz-stats-row {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.biz-stat-item {
  flex: 1;
}

.biz-stat-title {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.biz-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
}

.biz-stat-val.income {
  color: #30d158;
}

.biz-stat-val.expense {
  color: #ff453a;
}

.biz-actions-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.biz-report-btn {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(14, 165, 233, 0.25);
  transition: transform 0.15s ease;
}

.biz-report-btn:active {
  transform: scale(0.98);
}

.biz-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}

.biz-quick-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.biz-tx-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.biz-tx-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.biz-tx-card.biz-tx-income {
  border-left: 4px solid #30d158;
}

.biz-tx-card.biz-tx-expense {
  border-left: 4px solid #ff453a;
}

.biz-tx-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.biz-tx-badge {
  font-size: 1.25rem;
}

.biz-tx-desc {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.biz-tx-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.biz-tx-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.biz-tx-amount {
  font-size: 1.05rem;
  font-weight: 800;
}

.biz-tx-amount.biz-tx-income {
  color: #30d158;
}

.biz-tx-amount.biz-tx-expense {
  color: #ff453a;
}

.biz-tx-del-btn {
  background: transparent;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  opacity: 0.6;
  padding: 4px;
  transition: opacity 0.2s;
}

.biz-tx-del-btn:hover {
  opacity: 1;
}

/* Dual Mic Container for Business (Expense vs Income) */
.biz-voice-dual-container {
  margin-bottom: 16px;
}

.biz-voice-dual-header {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.biz-voice-dual-row {
  display: flex;
  gap: 10px;
}

@media (max-width: 480px) {
  .biz-voice-dual-row {
    flex-direction: column;
  }
}

.biz-dual-mic-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.biz-dual-mic-btn.expense {
  border: 1px solid rgba(255, 69, 58, 0.4);
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.16), rgba(255, 69, 58, 0.05));
  color: var(--text-main);
}

.biz-dual-mic-btn.expense:hover {
  border-color: rgba(255, 69, 58, 0.8);
  box-shadow: 0 4px 14px rgba(255, 69, 58, 0.25);
  transform: translateY(-1px);
}

.biz-dual-mic-btn.expense.listening {
  border-color: #ff453a;
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.4), rgba(255, 69, 58, 0.2));
  animation: bizPulseListening 1.5s infinite ease-in-out;
}

.biz-dual-mic-btn.income {
  border: 1px solid rgba(48, 209, 88, 0.4);
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.16), rgba(48, 209, 88, 0.05));
  color: var(--text-main);
}

.biz-dual-mic-btn.income:hover {
  border-color: rgba(48, 209, 88, 0.8);
  box-shadow: 0 4px 14px rgba(48, 209, 88, 0.25);
  transform: translateY(-1px);
}

.biz-dual-mic-btn.income.listening {
  border-color: #30d158;
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.4), rgba(48, 209, 88, 0.2));
  animation: bizPulseListeningGreen 1.5s infinite ease-in-out;
}

@keyframes bizPulseListeningGreen {
  0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

.biz-dual-mic-badge {
  font-size: 1.35rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.biz-dual-mic-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.biz-dual-mic-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.biz-dual-mic-btn.expense .biz-dual-mic-title {
  color: #ff6961;
}

.biz-dual-mic-btn.income .biz-dual-mic-title {
  color: #30d158;
}

.biz-dual-mic-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Voice Dictation Card for busy hands */
.biz-voice-card {
  margin-bottom: 16px;
}

.biz-voice-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-lg, 14px);
  border: 1px solid rgba(255, 69, 58, 0.4);
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.15), rgba(255, 149, 0, 0.08));
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(255, 69, 58, 0.12);
}

.biz-voice-btn:hover {
  border-color: rgba(255, 69, 58, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 69, 58, 0.22);
}

.biz-voice-btn:active {
  transform: scale(0.985);
}

.biz-voice-btn.listening {
  border-color: #ff453a;
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.35), rgba(255, 69, 58, 0.2));
  animation: bizPulseListening 1.5s infinite ease-in-out;
}

@keyframes bizPulseListening {
  0% { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(255, 69, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0); }
}

.biz-voice-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ff453a;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(255, 69, 58, 0.4);
}

.biz-voice-btn.listening .biz-voice-icon-wrap {
  animation: bizIconBounce 0.8s infinite alternate ease-in-out;
}

@keyframes bizIconBounce {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

.biz-voice-icon {
  font-size: 1.5rem;
}

.biz-voice-text-wrap {
  display: flex;
  flex-direction: column;
}

.biz-voice-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
}

.biz-voice-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.biz-voice-status {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 69, 58, 0.12);
  border: 1px dashed rgba(255, 69, 58, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: #ff9f0a;
  font-weight: 600;
}

.biz-voice-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.biz-voice-wave span {
  width: 3px;
  height: 100%;
  background: #ff453a;
  border-radius: 2px;
  animation: bizWaveAnim 1s ease-in-out infinite;
}

.biz-voice-wave span:nth-child(2) { animation-delay: 0.15s; }
.biz-voice-wave span:nth-child(3) { animation-delay: 0.3s; }
.biz-voice-wave span:nth-child(4) { animation-delay: 0.45s; }

@keyframes bizWaveAnim {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

/* ===================================================
   AI Chat & Companion Module Styles
   =================================================== */
.ai-chat-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  height: calc(100dvh - 170px);
  min-height: 480px;
  background: var(--card-bg, #1a233a);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  position: relative;
  width: 100%;
}

@media (max-width: 600px) {
  #tab-agent {
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
  }

  .ai-chat-wrapper {
    height: calc(100dvh - 145px);
    min-height: 480px;
    border-radius: 12px;
    border-left: none;
    border-right: none;
  }
}

.ai-chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.ai-chat-welcome {
  text-align: center;
  padding: 30px 14px;
  margin: auto;
}

.ai-chat-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 500px;
  margin: 0 auto;
}

.ai-chat-chip {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.ai-chat-chip:hover {
  background: rgba(14, 165, 233, 0.22);
  border-color: #0ea5e9;
  transform: translateY(-1px);
}

.ai-chat-bubble-wrap {
  display: flex;
  gap: 8px;
  max-width: 95%;
  align-items: flex-end;
  animation: fadeInMsg 0.25s ease-out;
  box-sizing: border-box;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-chat-bubble-wrap.user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 90%;
}

.ai-chat-bubble-wrap.assistant {
  align-self: flex-start;
  width: 98%;
  max-width: 98%;
}

.ai-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-hover, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  margin-bottom: 2px;
}

.ai-chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.94rem;
  line-height: 1.55;
  word-break: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.ai-chat-bubble.user {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  flex: 0 1 auto;
}

.ai-chat-bubble.assistant {
  background: var(--bg-input, #222e4d);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.ai-chat-bubble.typing {
  padding: 10px 14px;
}

.ai-chat-bubble-content p {
  margin: 4px 0;
}

.ai-chat-bubble-content strong {
  color: #38bdf8;
  font-weight: 700;
}

.ai-chat-bubble.user .ai-chat-bubble-content strong {
  color: #ffffff;
}

.ai-chat-list {
  margin: 6px 0;
  padding-left: 20px;
}

.ai-chat-list li {
  margin-bottom: 4px;
}

.ai-chat-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.ai-chat-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.ai-chat-bubble.user .ai-chat-time {
  color: rgba(255, 255, 255, 0.75);
}

.ai-msg-actions {
  display: flex;
  gap: 6px;
}

.ai-msg-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.65;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.2s, transform 0.15s;
}

.ai-msg-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.ai-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px max(14px, env(safe-area-inset-bottom, 14px)) 12px;
  background: var(--card-bg, #1a233a);
  border-top: 1px solid var(--border-color);
  box-sizing: border-box;
}

.ai-chat-input-bar input {
  flex: 1;
  min-height: 44px;
  background: var(--bg-input, #12182b);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 16px; /* 16px prevents iOS Safari automatic viewport zooming */
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.ai-chat-input-bar input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.ai-chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.ai-chat-send-btn:hover,
.ai-chat-send-btn:active {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.55);
}

.ai-chat-mic-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.45);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.ai-chat-mic-btn svg {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.ai-chat-mic-btn:hover,
.ai-chat-mic-btn:active {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.65);
}

.ai-chat-mic-btn.listening {
  background: #dc2626 !important;
  border-color: #ffffff !important;
  animation: aiMicPulse 0.85s infinite alternate !important;
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.95) !important;
}

@keyframes aiMicPulse {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
  100% { transform: scale(1.15); box-shadow: 0 0 24px rgba(239, 68, 68, 0.95); }
}

.ai-typing-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 6px;
}

.ai-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  animation: aiTypingAnim 1.4s infinite ease-in-out both;
}

.ai-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes aiTypingAnim {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===================================================
   Mailbox & Spam Cleaner Module Styles
   =================================================== */
.mail-cat-pill {
  transition: all 0.2s ease;
  user-select: none;
}

.mail-cat-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

.mail-cat-pill.active {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  filter: brightness(1.2);
}

/* ===================================================
   Vault / Склерозник: AI Review Modal & Cards
   =================================================== */
.vault-review-modal-card {
  max-width: 580px !important;
  width: 95% !important;
  height: 90vh !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 18px 16px 16px 16px !important;
  box-sizing: border-box !important;
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75) !important;
}

#vault-review-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  padding: 4px 6px 16px 2px !important;
  margin-bottom: 12px !important;
}

/* Custom scrollbar for review list */
#vault-review-list::-webkit-scrollbar {
  width: 6px;
}
#vault-review-list::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}
#vault-review-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
#vault-review-list::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

.vault-review-card {
  flex-shrink: 0 !important; /* CRITICAL: Never squash items vertically! */
  background: rgba(30, 41, 59, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 14px !important;
  padding: 14px 14px 12px 14px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  position: relative !important;
  overflow: visible !important;
}

.vault-review-card:focus-within {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25), 0 6px 20px rgba(0, 0, 0, 0.45) !important;
}

.vault-review-row-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.vault-review-title-input {
  flex: 1;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  min-height: 40px !important;
  box-sizing: border-box !important;
}

.vault-review-title-input:focus {
  border-color: #38bdf8 !important;
  outline: none !important;
}

.vault-review-cat-select {
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  min-height: 40px !important;
  cursor: pointer !important;
}

.vault-review-del-btn {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  border-radius: 8px !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.1rem !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease;
}

.vault-review-del-btn:active {
  transform: scale(0.92);
  background: rgba(239, 68, 68, 0.35) !important;
}

.vault-review-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 480px) {
  .vault-review-fields-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.vault-review-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vault-review-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}

.vault-review-field-input {
  font-size: 0.98rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 8px !important;
  padding: 9px 12px !important;
  min-height: 42px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.vault-review-field-input.pwd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 1.02rem !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

.vault-review-field-input:focus {
  border-color: #38bdf8 !important;
  outline: none !important;
}

.vault-review-extra {
  font-size: 0.82rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

/* ===================================================
   Vault / Склерозник: Brand Avatar & Premium Card
   =================================================== */
.vault-brand-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  user-select: none;
}

.vault-card {
  background: rgba(22, 33, 62, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all 0.25s ease;
}

.vault-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.vault-drag-handle {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 28px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.2s;
  touch-action: none;
  z-index: 2;
  border-radius: 6px;
}

.vault-card:hover .vault-drag-handle {
  opacity: 1;
}

.vault-card-dragging {
  opacity: 0.45;
  transform: scale(0.97);
  border-color: rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 12px 40px rgba(56, 189, 248, 0.25) !important;
}

.vault-card-dragover {
  border-color: rgba(16, 185, 129, 0.7) !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4), 0 8px 30px rgba(0,0,0,0.45) !important;
  transform: translateY(-3px);
}

.vault-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.vault-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.vault-card-cat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 2px;
}

.vault-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.vault-open-btn {
  text-decoration: none;
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  font-weight: 700 !important;
  padding: 5px 10px !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
}

.vault-cred-container {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vault-cred-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.vault-cred-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 2px;
}

.vault-cred-value {
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 600;
  word-break: break-all;
  user-select: all;
}

.vault-cred-value.pwd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.05rem;
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.vault-copy-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.vault-copy-btn:active {
  transform: scale(0.94);
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #34d399;
}

.vault-notes-box {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.45;
}

/* PWA Live Update Banner — Suppressed (User uses pull-to-refresh or header button) */
#pwa-update-banner,
.pwa-update-banner,
.pwa-update-btn {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  position: absolute !important;
  clip: rect(0, 0, 0, 0) !important;
}

@keyframes slideUpBanner {
  from {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.pwa-update-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s ease, background 0.15s ease;
}

.pwa-update-btn:active {
  transform: scale(0.94);
}



/* ============================================
   Tasks / Works Module � Redesigned Cards
   ============================================ */
.tasks-filter-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid rgba(139,92,246,0.3);
  background: rgba(139,92,246,0.08);
  color: #a78bfa;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  touch-action: manipulation;
}
.tasks-filter-pill.active,
.tasks-filter-pill:hover {
  background: linear-gradient(135deg,#8b5cf6,#6d28d9);
  border-color: #8b5cf6;
  color: #fff;
}

.tasks-card {
  background: var(--bg-card);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 14px 14px 14px 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
}
.tasks-card:hover { border-color: rgba(139,92,246,0.4); box-shadow: 0 4px 20px rgba(0,0,0,0.25); }
.tasks-card-done { opacity: 0.55; }
.tasks-card-urgent {
  border-color: rgba(239,68,68,0.45) !important;
  background: rgba(239,68,68,0.06) !important;
  box-shadow: 0 0 0 1px rgba(239,68,68,0.2) inset;
}

.tasks-card-check-col { flex-shrink: 0; padding-top: 2px; }
.tasks-check-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(139,92,246,0.5);
  background: transparent;
  color: #8b5cf6;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  touch-action: manipulation;
  flex-shrink: 0;
}
.tasks-check-btn.checked {
  background: linear-gradient(135deg,#8b5cf6,#6d28d9);
  border-color: #8b5cf6;
  color: #fff;
}
.tasks-check-btn:hover { transform: scale(1.1); }

.tasks-card-body { flex: 1; min-width: 0; }
.tasks-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 4px;
  word-break: break-word;
}
.tasks-title-done {
  text-decoration: line-through;
  color: var(--text-muted);
}
.tasks-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border-left: 3px solid rgba(139,92,246,0.4);
  padding: 4px 8px;
  border-radius: 0 6px 6px 0;
  margin: 4px 0 6px 0;
  white-space: pre-line;
  line-height: 1.4;
}
.tasks-card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

/* Due date badges */
.tasks-due-badge {
  font-size: 0.73rem; font-weight: 700;
  padding: 2px 8px; border-radius: 8px;
  white-space: nowrap;
}
.tasks-due-none { background: rgba(148,163,184,0.15); color: #94a3b8; }
.tasks-due-ok { background: rgba(34,197,94,0.15); color: #4ade80; }
.tasks-due-week { background: rgba(59,130,246,0.15); color: #60a5fa; }
.tasks-due-tomorrow { background: rgba(234,179,8,0.15); color: #facc15; }
.tasks-due-soon { background: rgba(249,115,22,0.18); color: #fb923c; }
.tasks-due-hot { background: rgba(239,68,68,0.18); color: #f87171; animation: tasks-pulse 1.5s ease-in-out infinite; }
.tasks-due-overdue { background: rgba(239,68,68,0.25); color: #ef4444; font-weight: 900; }
@keyframes tasks-pulse { 0%,100% { opacity:1; } 50% { opacity:0.65; } }

/* Category badge */
.tasks-cat-badge {
  font-size: 0.72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 8px;
  background: rgba(255,255,255,0.08); color: #cbd5e1;
  white-space: nowrap;
}

/* Priority badges */
.tasks-prio-badge { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.tasks-prio-high { background: rgba(239,68,68,0.15); color: #f87171; }
.tasks-prio-med { background: rgba(234,179,8,0.15); color: #facc15; }
.tasks-prio-low { background: rgba(34,197,94,0.12); color: #4ade80; }

/* Action buttons */
.tasks-card-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; align-items: center; }
.tasks-remind-btn {
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.3);
  border-radius: 8px;
  color: #38bdf8;
  font-size: 1rem;
  padding: 4px 7px;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
}
.tasks-remind-btn:hover { background: rgba(56,189,248,0.25); }

/* ===================================================
   APP BOTTOM DOCK (Sticky Thumb Action Dock)
   =================================================== */
.app-bottom-dock {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1.5px solid var(--border-color);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 12px)) 6px;
  margin: 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

[data-theme="light"] .app-bottom-dock {
  background: rgba(225, 238, 212, 0.98);
  border-top: 1.5px solid rgba(90, 145, 12, 0.40);
  box-shadow: 0 -4px 18px rgba(70, 120, 10, 0.14);
}

[data-theme="dark"] .app-bottom-dock {
  background: rgba(27, 44, 72, 0.96);
  border-top: 1.5px solid rgba(163, 230, 53, 0.18);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
}

.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  min-width: 46px;
  font-family: inherit;
}

.dock-btn:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.dock-btn:active {
  transform: scale(0.92);
}

.dock-btn.active {
  color: var(--primary);
}

.dock-btn .dock-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-btn .dock-label {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.2px;
}

[data-theme="light"] .dock-btn {
  color: #1a2516;
}

[data-theme="light"] .dock-btn .dock-label {
  color: #000000 !important;
  font-weight: 800;
}

[data-theme="light"] .dock-btn.active {
  color: #3f6e07;
}

[data-theme="light"] .dock-btn.active .dock-label {
  color: #3f6e07 !important;
}

/* ===================================================
   LIGHT THEME HIGH-CONTRAST SYSTEM COMPONENT OVERRIDES
   =================================================== */
[data-theme="light"] .header-title,
[data-theme="light"] .panel-header h2,
[data-theme="light"] .modal-header h3 {
  color: #000000 !important;
  font-weight: 800;
}

[data-theme="light"] .quick-input-form {
  background: #e1eed4;
  border: 1.5px solid rgba(90, 145, 12, 0.40);
  box-shadow: 0 4px 14px rgba(70, 120, 10, 0.10);
}

[data-theme="light"] .quick-input-form input {
  color: #000000 !important;
  font-weight: 600;
}

[data-theme="light"] .quick-input-form input::placeholder {
  color: #4b5563 !important;
}

[data-theme="light"] .stat-card {
  background: #e1eed4 !important;
  border: 1.5px solid rgba(90, 145, 12, 0.40) !important;
  box-shadow: 0 4px 14px rgba(70, 120, 10, 0.10) !important;
}

[data-theme="light"] .stat-label {
  color: #1a2516 !important;
  font-weight: 700;
}

[data-theme="light"] .stat-subval {
  color: #000000 !important;
  font-weight: 800;
}

[data-theme="light"] .empty-state {
  background: #e1eed4 !important;
  border-color: rgba(90, 145, 12, 0.40) !important;
  color: #000000 !important;
}

[data-theme="light"] .modal-card {
  background: #f9fbf6 !important;
  border: 2px solid rgba(90, 145, 12, 0.45) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22) !important;
}

[data-theme="light"] .modal-header {
  border-bottom: 1.5px solid rgba(90, 145, 12, 0.30) !important;
}

[data-theme="light"] .modal-body label {
  color: #000000 !important;
  font-weight: 700;
}

[data-theme="light"] .modal-body input,
[data-theme="light"] .modal-body select,
[data-theme="light"] .modal-body textarea {
  background: #edf6e4 !important;
  border: 1.5px solid rgba(90, 145, 12, 0.45) !important;
  color: #000000 !important;
  font-weight: 600;
}

[data-theme="light"] .modal-body input::placeholder,
[data-theme="light"] .modal-body textarea::placeholder {
  color: #4b5563 !important;
}

[data-theme="light"] .system-version-card,
[data-theme="light"] .backup-settings-section,
[data-theme="light"] .account-card-box {
  background: #e1eed4 !important;
  border-color: rgba(90, 145, 12, 0.40) !important;
}

[data-theme="light"] .tasks-card {
  background: #e1eed4 !important;
  border: 1.5px solid rgba(90, 145, 12, 0.40) !important;
  box-shadow: 0 4px 14px rgba(70, 120, 10, 0.10) !important;
}

[data-theme="light"] .tasks-card-title {
  color: #000000 !important;
  font-weight: 800;
}

[data-theme="light"] .tasks-card-desc {
  background: rgba(90, 145, 12, 0.12) !important;
  color: #1a2516 !important;
  border-left-color: #65a30d !important;
  font-weight: 600;
}

[data-theme="light"] .tasks-filter-pill {
  background: #edf6e4 !important;
  border: 1.5px solid rgba(90, 145, 12, 0.35) !important;
  color: #000000 !important;
  font-weight: 700 !important;
}

[data-theme="light"] .tasks-filter-pill.active {
  background: linear-gradient(135deg, #65a30d, #84cc16) !important;
  color: #000000 !important;
  font-weight: 800 !important;
  border-color: #65a30d !important;
}

/* ===================================================
   DARK THEME: LIME BUTTONS BLACK TEXT CONTRAST
   =================================================== */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .action-btn-sm,
[data-theme="dark"] .send-btn,
[data-theme="dark"] .bento-btn-play,
[data-theme="dark"] .mini-play-btn,
[data-theme="dark"] .music-pl-pill.active,
[data-theme="dark"] .custom-checkbox.checked,
[data-theme="dark"] .tasks-filter-pill.active {
  color: #000000 !important;
  font-weight: 800 !important;
}

[data-theme="dark"] .send-btn svg,
[data-theme="dark"] .btn-primary svg,
[data-theme="dark"] .action-btn-sm svg {
  stroke: #000000 !important;
}

/* ===================================================
   MUSIC DETECTED BANNER: MOBILE-SAFE, 2-LINE TITLE
   =================================================== */
.music-detected-banner {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 10px 0 12px 0 !important;
  padding: 10px 12px !important;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22), rgba(16, 185, 129, 0.16)) !important;
  border: 1.5px solid rgba(6, 182, 212, 0.5) !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
  position: relative !important;
  z-index: 40 !important;
  overflow: hidden !important;
}

.music-detected-banner.hidden {
  display: none !important;
}

.music-banner-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 !important;
  overflow: hidden !important;
}

.music-banner-cover {
  width: 44px !important;
  height: 44px !important;
  border-radius: 10px !important;
  object-fit: cover !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

.music-banner-text {
  min-width: 0 !important;
  flex: 1 !important;
  overflow: hidden !important;
}

.music-banner-tag {
  font-size: 0.7rem !important;
  color: #06b6d4 !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 2px !important;
}

.music-banner-title {
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  color: var(--text-main) !important;
  line-height: 1.25 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: normal !important;
  word-break: break-word !important;
}

.music-banner-artist {
  font-size: 0.76rem !important;
  color: var(--text-muted) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-top: 2px !important;
}

.music-banner-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

.music-banner-play-btn {
  background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 20px !important;
  padding: 8px 13px !important;
  font-weight: 700 !important;
  font-size: 0.84rem !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  box-shadow: 0 3px 10px rgba(6, 182, 212, 0.4) !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.music-banner-close-btn {
  background: transparent !important;
  border: none !important;
  color: var(--text-muted) !important;
  font-size: 1.15rem !important;
  padding: 4px 6px !important;
  cursor: pointer !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
}
