/* ============================================
   Plum Studio Remote - Mobile-First CSS
   Matches desktop Flutter app design language
   ============================================ */

/* CSS Reset & Variables */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  /* Brand Colors */
  --plum-primary: #1e6c61;
  --plum-primary-dark: #154a43;
  --plum-primary-light: #2a8f82;
  --plum-secondary: #2bb7c4;
  --plum-accent: #3bd6bf;
  --plum-primary-rgb: 30, 108, 97;
  --plum-secondary-rgb: 43, 183, 196;
  --plum-accent-rgb: 59, 214, 191;
  --plum-gradient: linear-gradient(135deg, var(--plum-primary), var(--plum-secondary));
  --plum-gradient-accent: linear-gradient(135deg, var(--plum-secondary), var(--plum-accent));
  --accent: var(--plum-primary);

  /* Ink & Text */
  --plum-ink: #151b21;
  --plum-ink-light: #2a2f33;
  --plum-muted: #5d646f;
  --plum-subtle: #8a919c;

  /* Glass Morphism */
  --plum-glass: rgba(255, 255, 255, 0.78);
  --plum-glass-strong: rgba(255, 255, 255, 0.92);
  --plum-glass-subtle: rgba(255, 255, 255, 0.55);
  --plum-glass-border: rgba(255, 255, 255, 0.45);
  --plum-glass-highlight: rgba(255, 255, 255, 0.35);

  /* Shadows */
  --plum-shadow: 0 18px 40px rgba(12, 24, 32, 0.16);
  --plum-shadow-soft: 0 10px 26px rgba(12, 24, 32, 0.12);
  --plum-shadow-small: 0 4px 12px rgba(12, 24, 32, 0.1);
  --plum-glow: rgba(var(--plum-accent-rgb), 0.32);

  /* Status Colors */
  --color-success: #1a7d4d;
  --color-warning: #b8791e;
  --color-error: #b3261e;
  --color-neutral: #5a5e6a;

  /* Widget Colors */
  --widget-fill: rgba(255, 255, 255, 0.85);
  --widget-border: rgba(255, 255, 255, 0.5);

  /* Home icon palette */
  --icon-label-color: #151b21;
  --icon-default-rgb: 79, 172, 254;
  --icon-search-rgb: 102, 126, 234;
  --icon-agent-rgb: 161, 140, 209;
  --icon-browser-rgb: 67, 233, 123;
  --icon-files-rgb: 255, 107, 107;
  --icon-settings-rgb: 79, 172, 254;
  --icon-apps-rgb: 240, 147, 251;
  --icon-insights-rgb: 56, 189, 248;
  --icon-scenes-rgb: 251, 191, 36;

  /* Sizing */
  --header-height: 72px;
  --dock-height: 72px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Transitions */
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Border Radius */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --radius-pill: 999px;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--plum-ink);
  background: linear-gradient(135deg, #f4f0ea, #e5f0ea);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Cloud Login Overlay
   ============================================ */
.cloud-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--plum-primary) 0%, var(--plum-primary-dark) 100%);
  padding: 20px;
}

.cloud-login-overlay.hidden {
  display: none;
}

.cloud-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--plum-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--plum-glass-border);
  box-shadow: var(--plum-shadow);
  padding: 40px 32px;
}

.cloud-login-header {
  text-align: center;
  margin-bottom: 32px;
}

.cloud-login-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--plum-primary);
  margin-bottom: 8px;
}

.cloud-login-header p {
  font-size: 15px;
  color: var(--plum-muted);
}

.cloud-login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cloud-login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cloud-login-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--plum-ink-light);
}

.cloud-login-form input {
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--plum-ink);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.cloud-login-form input:focus {
  outline: none;
  border-color: var(--plum-primary);
  box-shadow: 0 0 0 3px rgba(var(--plum-primary-rgb), 0.15);
}

.cloud-login-form input::placeholder {
  color: var(--plum-subtle);
}

.cloud-error {
  font-size: 14px;
  color: var(--color-error);
  text-align: center;
  min-height: 20px;
}

.cloud-login-btn {
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--plum-primary) 0%, var(--plum-primary-dark) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}

.cloud-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--plum-primary-rgb), 0.3);
}

.cloud-login-btn:active {
  transform: translateY(0);
}

.cloud-login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.cloud-login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--plum-muted);
}

.cloud-login-footer a {
  color: var(--plum-primary);
  text-decoration: none;
  font-weight: 600;
}

.cloud-login-footer a:hover {
  text-decoration: underline;
}

/* Ambient Background - Default (Aurora) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(82, 214, 191, 0.32), transparent 55%),
    radial-gradient(circle at 82% 18%, rgba(68, 129, 230, 0.28), transparent 52%),
    radial-gradient(circle at 70% 82%, rgba(255, 204, 146, 0.26), transparent 58%);
  pointer-events: none;
  z-index: 0;
  transition: background 0.8s ease;
}

.backdrop-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
  transition: background 0.6s ease, opacity 0.6s ease;
}

.orb-1 {
  width: 280px;
  height: 280px;
  top: -100px;
  right: -80px;
  background: radial-gradient(circle, rgba(var(--plum-secondary-rgb), 0.45), transparent 70%);
}

.orb-2 {
  width: 320px;
  height: 320px;
  bottom: -120px;
  left: -100px;
  background: radial-gradient(circle, rgba(var(--plum-primary-rgb), 0.4), transparent 70%);
}

.orb-3 {
  width: 180px;
  height: 180px;
  top: 30%;
  left: -60px;
  background: radial-gradient(circle, var(--plum-glow), transparent 70%);
}

/* ============================================
   THEME VARIATIONS - Match Desktop Moods
   ============================================ */

/* Zen Garden - Calm greens */
body.theme-zen-garden {
  background: linear-gradient(135deg, #e8f5e9, #b2dfdb, #e0f2f1);
  --plum-primary: #0f766e;
  --plum-primary-dark: #0b5250;
  --plum-primary-light: #2dd4bf;
  --plum-secondary: #34d399;
  --plum-accent: #a7f3d0;
  --plum-primary-rgb: 15, 118, 110;
  --plum-secondary-rgb: 52, 211, 153;
  --plum-accent-rgb: 167, 243, 208;
  --icon-label-color: #123127;
  --icon-search-rgb: 46, 125, 50;
  --icon-agent-rgb: 0, 150, 136;
  --icon-browser-rgb: 0, 200, 83;
  --icon-files-rgb: 255, 167, 38;
  --icon-settings-rgb: 38, 166, 154;
  --icon-apps-rgb: 100, 181, 246;
  --icon-insights-rgb: 121, 134, 203;
  --icon-scenes-rgb: 186, 104, 200;
}
body.theme-zen-garden::before {
  background:
    radial-gradient(circle at 15% 20%, rgba(129, 199, 132, 0.35), transparent 50%),
    radial-gradient(circle at 80% 25%, rgba(128, 203, 196, 0.3), transparent 55%),
    radial-gradient(circle at 60% 80%, rgba(165, 214, 167, 0.28), transparent 50%);
}
body.theme-zen-garden .orb-1 { background: radial-gradient(circle, rgba(129, 199, 132, 0.4), transparent 70%); }
body.theme-zen-garden .orb-2 { background: radial-gradient(circle, rgba(77, 182, 172, 0.35), transparent 70%); }

/* Ocean Depths - Deep blues */
body.theme-ocean-depths {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb, #e1f5fe);
  --plum-primary: #1e88e5;
  --plum-primary-dark: #1565c0;
  --plum-primary-light: #64b5f6;
  --plum-secondary: #00bcd4;
  --plum-accent: #80deea;
  --plum-primary-rgb: 30, 136, 229;
  --plum-secondary-rgb: 0, 188, 212;
  --plum-accent-rgb: 128, 222, 234;
  --icon-label-color: #102436;
  --icon-search-rgb: 30, 136, 229;
  --icon-agent-rgb: 63, 81, 181;
  --icon-browser-rgb: 0, 188, 212;
  --icon-files-rgb: 0, 150, 136;
  --icon-settings-rgb: 3, 169, 244;
  --icon-apps-rgb: 25, 118, 210;
  --icon-insights-rgb: 2, 136, 209;
  --icon-scenes-rgb: 57, 73, 171;
}
body.theme-ocean-depths::before {
  background:
    radial-gradient(circle at 20% 15%, rgba(66, 165, 245, 0.35), transparent 55%),
    radial-gradient(circle at 75% 30%, rgba(41, 182, 246, 0.3), transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(79, 195, 247, 0.28), transparent 55%);
}
body.theme-ocean-depths .orb-1 { background: radial-gradient(circle, rgba(66, 165, 245, 0.4), transparent 70%); }
body.theme-ocean-depths .orb-2 { background: radial-gradient(circle, rgba(3, 169, 244, 0.35), transparent 70%); }

/* Northern Lights - Vibrant auroras */
body.theme-northern-lights {
  background: linear-gradient(135deg, #e8f5e9, #e3f2fd, #f3e5f5);
  --plum-primary: #00bfa5;
  --plum-primary-dark: #00897b;
  --plum-primary-light: #64ffda;
  --plum-secondary: #7c4dff;
  --plum-accent: #00e5ff;
  --plum-primary-rgb: 0, 191, 165;
  --plum-secondary-rgb: 124, 77, 255;
  --plum-accent-rgb: 0, 229, 255;
  --icon-label-color: #12251f;
  --icon-search-rgb: 0, 200, 83;
  --icon-agent-rgb: 156, 39, 176;
  --icon-browser-rgb: 0, 188, 212;
  --icon-files-rgb: 255, 193, 7;
  --icon-settings-rgb: 76, 175, 80;
  --icon-apps-rgb: 124, 77, 255;
  --icon-insights-rgb: 0, 229, 255;
  --icon-scenes-rgb: 255, 64, 129;
}
body.theme-northern-lights::before {
  background:
    radial-gradient(circle at 10% 10%, rgba(0, 255, 163, 0.3), transparent 50%),
    radial-gradient(circle at 85% 20%, rgba(0, 212, 255, 0.28), transparent 55%),
    radial-gradient(circle at 40% 75%, rgba(176, 136, 255, 0.25), transparent 50%);
  animation: auroraPulse 8s ease-in-out infinite;
}
body.theme-northern-lights .orb-1 { background: radial-gradient(circle, rgba(0, 255, 163, 0.4), transparent 70%); animation: orbFloat 6s ease-in-out infinite; }
body.theme-northern-lights .orb-2 { background: radial-gradient(circle, rgba(176, 136, 255, 0.35), transparent 70%); animation: orbFloat 8s ease-in-out infinite reverse; }

/* Cosmic Nebula - Deep space */
body.theme-cosmic-nebula {
  background: linear-gradient(135deg, #f3e5f5, #e8eaf6, #fce4ec);
  --plum-primary: #7c4dff;
  --plum-primary-dark: #512da8;
  --plum-primary-light: #b388ff;
  --plum-secondary: #ff6b9d;
  --plum-accent: #fbc2eb;
  --plum-primary-rgb: 124, 77, 255;
  --plum-secondary-rgb: 255, 107, 157;
  --plum-accent-rgb: 251, 194, 235;
  --icon-label-color: #261a2e;
  --icon-search-rgb: 124, 77, 255;
  --icon-agent-rgb: 255, 87, 182;
  --icon-browser-rgb: 79, 195, 247;
  --icon-files-rgb: 255, 112, 67;
  --icon-settings-rgb: 171, 71, 188;
  --icon-apps-rgb: 92, 107, 192;
  --icon-insights-rgb: 38, 198, 218;
  --icon-scenes-rgb: 255, 138, 101;
}
body.theme-cosmic-nebula::before {
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 107, 157, 0.3), transparent 55%),
    radial-gradient(circle at 70% 35%, rgba(196, 77, 255, 0.28), transparent 50%),
    radial-gradient(circle at 45% 80%, rgba(107, 138, 255, 0.25), transparent 55%);
}
body.theme-cosmic-nebula .orb-1 { background: radial-gradient(circle, rgba(255, 107, 157, 0.4), transparent 70%); }
body.theme-cosmic-nebula .orb-2 { background: radial-gradient(circle, rgba(196, 77, 255, 0.35), transparent 70%); }

/* Sunset Glow - Warm amber */
body.theme-sunset-glow {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2, #ffccbc);
  --plum-primary: #fb8c00;
  --plum-primary-dark: #e65100;
  --plum-primary-light: #ffb74d;
  --plum-secondary: #ff6b6b;
  --plum-accent: #feca57;
  --plum-primary-rgb: 251, 140, 0;
  --plum-secondary-rgb: 255, 107, 107;
  --plum-accent-rgb: 254, 202, 87;
  --icon-label-color: #3a1f12;
  --icon-search-rgb: 255, 138, 101;
  --icon-agent-rgb: 255, 112, 67;
  --icon-browser-rgb: 255, 202, 40;
  --icon-files-rgb: 239, 83, 80;
  --icon-settings-rgb: 255, 167, 38;
  --icon-apps-rgb: 240, 98, 146;
  --icon-insights-rgb: 255, 183, 77;
  --icon-scenes-rgb: 251, 140, 0;
}
body.theme-sunset-glow::before {
  background:
    radial-gradient(circle at 15% 25%, rgba(255, 183, 77, 0.35), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 138, 101, 0.3), transparent 55%),
    radial-gradient(circle at 55% 75%, rgba(255, 213, 79, 0.28), transparent 50%);
}
body.theme-sunset-glow .orb-1 { background: radial-gradient(circle, rgba(255, 183, 77, 0.45), transparent 70%); }
body.theme-sunset-glow .orb-2 { background: radial-gradient(circle, rgba(255, 138, 101, 0.4), transparent 70%); }

/* Fireflies - Twinkling greens/yellows */
body.theme-fireflies {
  background: linear-gradient(135deg, #f1f8e9, #fffde7, #e8f5e9);
  --plum-primary: #689f38;
  --plum-primary-dark: #33691e;
  --plum-primary-light: #9ccc65;
  --plum-secondary: #fbc02d;
  --plum-accent: #fff176;
  --plum-primary-rgb: 104, 159, 56;
  --plum-secondary-rgb: 251, 192, 45;
  --plum-accent-rgb: 255, 241, 118;
  --icon-label-color: #2a2d16;
  --icon-search-rgb: 255, 202, 40;
  --icon-agent-rgb: 139, 195, 74;
  --icon-browser-rgb: 76, 175, 80;
  --icon-files-rgb: 255, 171, 64;
  --icon-settings-rgb: 255, 235, 59;
  --icon-apps-rgb: 102, 187, 106;
  --icon-insights-rgb: 255, 214, 0;
  --icon-scenes-rgb: 124, 179, 66;
}
body.theme-fireflies::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 235, 59, 0.28), transparent 45%),
    radial-gradient(circle at 75% 25%, rgba(205, 220, 57, 0.25), transparent 50%),
    radial-gradient(circle at 50% 70%, rgba(139, 195, 74, 0.22), transparent 45%);
}
body.theme-fireflies .orb-1 { background: radial-gradient(circle, rgba(255, 235, 59, 0.4), transparent 70%); animation: firefliesGlow 3s ease-in-out infinite; }
body.theme-fireflies .orb-2 { background: radial-gradient(circle, rgba(139, 195, 74, 0.35), transparent 70%); animation: firefliesGlow 4s ease-in-out infinite 1s; }
body.theme-fireflies .orb-3 { animation: firefliesGlow 2.5s ease-in-out infinite 0.5s; }

/* Soft Mist - Minimal grays */
body.theme-soft-mist {
  background: linear-gradient(135deg, #f5f5f5, #eeeeee, #fafafa);
  --plum-primary: #607d8b;
  --plum-primary-dark: #455a64;
  --plum-primary-light: #90a4ae;
  --plum-secondary: #b0bec5;
  --plum-accent: #cfd8dc;
  --plum-primary-rgb: 96, 125, 139;
  --plum-secondary-rgb: 176, 190, 197;
  --plum-accent-rgb: 207, 216, 220;
  --icon-label-color: #2a2f33;
  --icon-search-rgb: 120, 144, 156;
  --icon-agent-rgb: 144, 164, 174;
  --icon-browser-rgb: 96, 125, 139;
  --icon-files-rgb: 158, 158, 158;
  --icon-settings-rgb: 117, 117, 117;
  --icon-apps-rgb: 129, 140, 148;
  --icon-insights-rgb: 176, 190, 197;
  --icon-scenes-rgb: 147, 150, 160;
}
body.theme-soft-mist::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(158, 158, 158, 0.15), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(189, 189, 189, 0.12), transparent 50%),
    radial-gradient(circle at 50% 75%, rgba(224, 224, 224, 0.1), transparent 55%);
}
body.theme-soft-mist .orb-1 { background: radial-gradient(circle, rgba(158, 158, 158, 0.2), transparent 70%); }
body.theme-soft-mist .orb-2 { background: radial-gradient(circle, rgba(189, 189, 189, 0.18), transparent 70%); }

/* Crystal Clear - Pristine white */
body.theme-crystal-clear {
  background: linear-gradient(135deg, #ffffff, #f5f5f5, #fafafa);
  --icon-label-color: #1b1f24;
  --icon-search-rgb: 79, 149, 212;
  --icon-agent-rgb: 120, 112, 196;
  --icon-browser-rgb: 56, 178, 172;
  --icon-files-rgb: 240, 128, 128;
  --icon-settings-rgb: 79, 172, 254;
  --icon-apps-rgb: 180, 140, 250;
  --icon-insights-rgb: 84, 200, 230;
  --icon-scenes-rgb: 234, 179, 8;
}
body.theme-crystal-clear::before {
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.8), transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(224, 247, 250, 0.5), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(232, 245, 233, 0.4), transparent 50%);
}
body.theme-crystal-clear .orb-1 { opacity: 0.3; }
body.theme-crystal-clear .orb-2 { opacity: 0.25; }

/* Theme Animations */
@keyframes auroraPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(10px, -15px); }
  50% { transform: translate(-5px, 10px); }
  75% { transform: translate(15px, 5px); }
}

@keyframes firefliesGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Remote Shell Container */
.remote-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: relative;
  z-index: 1;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ============================================
   HEADER
   ============================================ */
header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin: 8px 12px;
  border-radius: var(--radius-lg);
  background: var(--plum-glass);
  border: 1px solid var(--plum-glass-border);
  box-shadow: var(--plum-shadow-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 20;
  animation: slideDown var(--duration-slow) var(--ease-out-cubic);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand h1 {
  font-size: clamp(18px, 4.5vw, 24px);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.brand-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(var(--plum-primary-rgb), 0.14);
  border: 1px solid rgba(var(--plum-primary-rgb), 0.25);
  color: var(--plum-primary-dark);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(var(--plum-primary-rgb), 0.12);
  border: 1px solid rgba(var(--plum-primary-rgb), 0.2);
  font-size: 12px;
  font-weight: 600;
  color: var(--plum-primary-dark);
  transition: all var(--duration-normal) var(--ease-out-cubic);
}

.status-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--plum-primary);
  box-shadow: 0 0 10px rgba(var(--plum-primary-rgb), 0.5);
  animation: pulse 2s ease-in-out infinite;
}

.status-pill[data-state='error'] {
  background: rgba(179, 38, 30, 0.12);
  border-color: rgba(179, 38, 30, 0.2);
  color: #7b2a22;
}

.status-pill[data-state='error']::before {
  background: var(--color-error);
  box-shadow: 0 0 10px rgba(179, 38, 30, 0.5);
  animation: none;
}

.status-pill[data-state='disconnected'] {
  background: rgba(90, 94, 106, 0.14);
  border-color: rgba(90, 94, 106, 0.2);
  color: var(--color-neutral);
}

.status-pill[data-state='disconnected']::before {
  background: var(--color-neutral);
  box-shadow: 0 0 8px rgba(90, 94, 106, 0.4);
  animation: none;
}

/* ============================================
   ADMIN BANNERS
   ============================================ */
.admin-banner-stack {
  flex-shrink: 0;
  margin: 0 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 19;
}

.admin-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--plum-glass-border);
  border-left: 4px solid rgba(var(--plum-primary-rgb), 0.65);
  background: var(--plum-glass-strong);
  box-shadow: var(--plum-shadow-small);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.admin-banner.is-info {
  border-left-color: rgba(var(--plum-primary-rgb), 0.8);
}

.admin-banner.is-success {
  border-left-color: rgba(30, 125, 77, 0.9);
}

.admin-banner.is-warning {
  border-left-color: rgba(184, 121, 30, 0.95);
}

.admin-banner.is-error {
  border-left-color: rgba(179, 38, 30, 0.95);
}

.admin-banner-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--plum-ink-light);
}

.admin-banner-message {
  font-size: 13px;
  color: var(--plum-ink);
  word-break: break-word;
}

.admin-banner-meta {
  font-size: 11px;
  color: var(--plum-muted);
}

.admin-banner-dismiss {
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.55);
  color: var(--plum-ink-light);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.admin-banner-dismiss:hover {
  background: rgba(255, 255, 255, 0.78);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-out-cubic),
              visibility var(--duration-normal);
}

.view:not([hidden]) {
  opacity: 1;
  visibility: visible;
}

.view-stream {
  overflow: hidden;
}

.view-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px 16px;
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: 16px;
}

.view-scroll-browser {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================
   HOME VIEW - WIDGETS GRID
   ============================================ */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(120px, auto);
  gap: 12px;
  animation: fadeInUp var(--duration-slow) var(--ease-out-cubic);
}

.home-tile {
  position: relative;
}

.tile-size-small {
  grid-column: span 1;
  min-height: 120px;
}

.tile-size-medium {
  grid-column: span 2;
  min-height: 120px;
}

.tile-size-large {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 220px;
}

/* Widget Base */
.widget {
  background: var(--widget-fill);
  border-radius: var(--radius-lg);
  border: 1px solid var(--widget-border);
  box-shadow: var(--plum-shadow-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px;
  position: relative;
  overflow: hidden;
  animation: panelIn var(--duration-slow) var(--ease-out-cubic) backwards;
}

.widget::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--plum-glass-highlight), transparent);
  opacity: 0.5;
  pointer-events: none;
}

/* Weather Widget */
.widget-weather {
  grid-column: span 2;
  min-height: 120px;
  display: flex;
  justify-content: space-between;
  animation-delay: 0.05s;
}

.widget-weather .widget-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weather-main {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.weather-temp {
  font-size: clamp(36px, 10vw, 48px);
  font-weight: 600;
  line-height: 1;
}

.weather-unit {
  font-size: 16px;
  font-weight: 500;
  color: var(--plum-muted);
}

.weather-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weather-condition {
  font-size: 14px;
  font-weight: 500;
  color: var(--plum-ink-light);
}

.weather-hl, .weather-location {
  font-size: 12px;
  color: var(--plum-muted);
}

.weather-graphic {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 80px;
  height: 80px;
  opacity: 0.9;
}

/* Clock Widget */
.widget-clock {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation-delay: 0.1s;
}

#clockCanvas {
  width: 100%;
  height: auto;
  max-width: 120px;
}

.clock-digital {
  font-size: 11px;
  color: var(--plum-muted);
  margin-top: 6px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Stats Widget */
.widget-stats {
  animation-delay: 0.15s;
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--plum-muted);
  width: 32px;
}

.stat-bar {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--plum-primary), var(--plum-secondary));
  border-radius: 3px;
  transition: width var(--duration-normal) var(--ease-out-cubic);
  width: 0%;
}

.stat-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--plum-ink-light);
  width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Music Widget */
.widget-music {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation-delay: 0.2s;
}

.music-info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.music-art {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-secondary));
  flex-shrink: 0;
}

.music-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.music-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-artist {
  font-size: 12px;
  color: var(--plum-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.music-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(var(--plum-primary-rgb), 0.12);
  color: var(--plum-primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.music-btn:active {
  transform: scale(0.92);
  background: rgba(var(--plum-primary-rgb), 0.2);
}

.music-btn-play {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-primary-light));
  color: white;
  box-shadow: var(--plum-shadow-small);
}

/* Notes Widget */
.widget-notes {
  grid-column: span 2;
  animation-delay: 0.25s;
}

.notes-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--plum-muted);
}

.notes-icon {
  display: flex;
  align-items: center;
  color: var(--plum-primary);
}

.sticky-note-tile {
  padding: 0;
  overflow: hidden;
}

.note-surface {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--note-color, #fff9c4);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.note-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.note-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(25, 28, 30, 0.7);
}

.note-actions {
  display: flex;
  gap: 6px;
}

.note-btn {
  min-width: 32px;
  height: 28px;
  padding: 0 6px;
  font-size: 11px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.note-btn:active {
  transform: scale(0.95);
}

.note-input {
  flex: 1;
  border: none;
  resize: none;
  background: transparent;
  color: rgba(20, 24, 26, 0.9);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
}

.note-input::placeholder {
  color: rgba(20, 24, 26, 0.45);
}

.note-colors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.note-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out-cubic);
}

.note-color:active {
  transform: scale(0.9);
}

.note-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(20, 24, 26, 0.6);
}

.home-icon-tile {
  --icon-tile-accent: var(--icon-default-rgb);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  background: linear-gradient(145deg, rgba(var(--icon-tile-accent), 0.22), rgba(var(--icon-tile-accent), 0.08));
  border: 1px solid rgba(var(--icon-tile-accent), 0.28);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.home-icon-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
  border-radius: 16px 16px 0 0;
  pointer-events: none;
}

.home-icon-tile svg {
  width: 22px;
  height: 22px;
  color: rgb(var(--icon-tile-accent));
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.home-icon-tile:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(var(--icon-tile-accent), 0.25);
}

.home-icon-tile:active {
  transform: scale(0.96);
}

.home-icon-tile.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.home-icon-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--icon-label-color);
  opacity: 0.9;
}

/* Colorful icon tile variants */
.home-icon-tile[data-tile-id="search"],
.home-icon-tile[data-view="search"],
.home-icon-tile[data-action="search"] {
  --icon-tile-accent: var(--icon-search-rgb);
}
.home-icon-tile[data-tile-id="agent"],
.home-icon-tile[data-view="agent"] {
  --icon-tile-accent: var(--icon-agent-rgb);
}
.home-icon-tile[data-tile-id="browser"],
.home-icon-tile[data-view="browser"] {
  --icon-tile-accent: var(--icon-browser-rgb);
}
.home-icon-tile[data-tile-id="files"],
.home-icon-tile[data-view="files"] {
  --icon-tile-accent: var(--icon-files-rgb);
}
.home-icon-tile[data-tile-id="settings"],
.home-icon-tile[data-action="settings"] {
  --icon-tile-accent: var(--icon-settings-rgb);
}
.home-icon-tile[data-tile-id="apps"],
.home-icon-tile[data-view="windows"] {
  --icon-tile-accent: var(--icon-apps-rgb);
}
.home-icon-tile[data-tile-id="insights"] {
  --icon-tile-accent: var(--icon-insights-rgb);
}
.home-icon-tile[data-tile-id="scenes"] {
  --icon-tile-accent: var(--icon-scenes-rgb);
}

/* Icons Grid Container - 4 icons per row */
.home-icons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  grid-column: span 2;
  padding: 4px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.home-icons-grid .home-icon-tile {
  min-height: 70px;
}

.layout-editing .home-icon-tile {
  cursor: grab;
}

.layout-editing .home-icon-tile:active {
  cursor: grabbing;
}

@media (max-width: 480px) {
  .home-icons-grid {
    gap: 8px;
  }

  .home-icons-grid .home-icon-tile {
    min-height: 60px;
    padding: 8px 4px;
  }
}

@media (max-width: 375px) {
  .home-icons-grid {
    gap: 6px;
  }

  .home-icons-grid .home-icon-tile {
    min-height: 54px;
    padding: 6px 3px;
  }

  .home-icons-grid .home-icon-tile svg {
    width: 18px;
    height: 18px;
  }

  .home-icons-grid .home-icon-label {
    font-size: 8px;
  }
}

.layout-editing .home-tile {
  outline: 2px dashed rgba(var(--plum-primary-rgb), 0.4);
  outline-offset: -4px;
}

#notesInput {
  width: 100%;
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.6);
  resize: none;
  font-family: inherit;
}

#notesInput:focus {
  outline: none;
  border-color: rgba(var(--plum-primary-rgb), 0.4);
  box-shadow: 0 0 0 3px rgba(var(--plum-primary-rgb), 0.1);
}

/* Quick Actions */
.quick-actions {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  animation: panelIn var(--duration-slow) var(--ease-out-cubic) 0.3s backwards;
}

.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  background: var(--plum-glass);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.action-tile:active {
  transform: scale(0.95);
  background: var(--plum-glass-strong);
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--plum-shadow-small);
}

.search-icon { background: linear-gradient(135deg, #4481e6, #6c63ff); }
.agent-icon { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.browser-icon { background: linear-gradient(135deg, #10b981, #3b82f6); }
.files-icon { background: linear-gradient(135deg, #8b5cf6, #ec4899); }

.action-tile span {
  font-size: 11px;
  font-weight: 600;
  color: var(--plum-ink-light);
}

/* ============================================
   PANELS (Glass Cards)
   ============================================ */
.panel {
  background: var(--plum-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--plum-glass-border);
  box-shadow: var(--plum-shadow-soft);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  position: relative;
  overflow: hidden;
  animation: panelIn var(--duration-slow) var(--ease-out-cubic) backwards;
}

.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--plum-glass-highlight), transparent);
  opacity: 0.5;
  pointer-events: none;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.panel-apps {
  grid-column: span 2;
  animation-delay: 0.35s;
}

/* Apps Row Scroll */
.apps-row-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.apps-row-scroll::-webkit-scrollbar {
  display: none;
}

/* Browser Automation View */
.panel-automation {
  max-width: 800px;
  margin: 0 auto;
}

.panel-automation .panel-description {
  color: var(--plum-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.automation-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--plum-glass-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--plum-muted);
}

.automation-status-bar .status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-neutral);
}

.automation-status-bar .status-indicator.connected {
  background: var(--color-success);
}

.automation-status-bar .status-indicator.running {
  background: var(--plum-primary);
  animation: pulse-indicator 1.5s infinite;
}

@keyframes pulse-indicator {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.automation-preview {
  background: var(--plum-ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  min-height: 200px;
  max-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.automation-preview .preview-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--plum-subtle);
}

.automation-preview .preview-placeholder svg {
  margin-bottom: 12px;
  opacity: 0.5;
}

.automation-preview .preview-placeholder p {
  font-size: 14px;
}

.automation-preview img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.automation-chat {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.automation-chat:empty {
  display: none;
}

.automation-msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  max-width: 85%;
}

.automation-msg.user {
  background: var(--plum-primary);
  color: white;
  align-self: flex-end;
}

.automation-msg.assistant {
  background: var(--plum-glass);
  color: var(--plum-ink);
  align-self: flex-start;
}

.automation-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.automation-input-row input {
  flex: 1;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--plum-glass-border);
  background: var(--plum-glass);
  font-size: 15px;
  color: var(--plum-ink);
  transition: all var(--duration-fast);
}

.automation-input-row input:focus {
  outline: none;
  border-color: var(--plum-primary);
  box-shadow: 0 0 0 3px var(--plum-glow);
}

.automation-input-row .btn-primary {
  flex-shrink: 0;
  min-width: 80px;
}

.automation-examples h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--plum-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.automation-examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.automation-example {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--plum-glass);
  border: 1px solid var(--plum-glass-border);
  font-size: 13px;
  color: var(--plum-ink);
  text-align: left;
  transition: all var(--duration-fast);
  cursor: pointer;
}

.automation-example:hover {
  background: var(--plum-glass-strong);
  border-color: var(--plum-primary);
}

@media (prefers-color-scheme: dark) {
  .automation-status-bar {
    background: var(--surface);
    color: var(--text-muted);
  }

  .automation-preview {
    background: #0a0f14;
  }

  .automation-msg.assistant {
    background: var(--surface);
    color: var(--text);
  }

  .automation-input-row input {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
  }

  .automation-example {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
  }
}

/* UFO View */
.panel-ufo {
  max-width: 640px;
  margin: 0 auto;
}

.panel-ufo .panel-description {
  color: var(--plum-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.ufo-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.ufo-input-row input {
  flex: 1;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--plum-glass-border);
  background: var(--plum-glass);
  font-size: 15px;
  color: var(--plum-ink);
  transition: all var(--duration-fast);
}

.ufo-input-row input:focus {
  outline: none;
  border-color: var(--plum-primary);
  box-shadow: 0 0 0 3px var(--plum-glow);
}

.ufo-input-row .btn-primary {
  flex-shrink: 0;
  min-width: 80px;
}

.ufo-status {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--plum-glass-subtle);
  font-size: 14px;
  color: var(--plum-muted);
  margin-bottom: 24px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.ufo-status:empty {
  display: none;
}

.ufo-status.running {
  background: rgba(var(--plum-primary-rgb), 0.1);
  color: var(--plum-primary);
}

.ufo-status.error {
  background: rgba(179, 38, 30, 0.1);
  color: var(--color-error);
}

.ufo-status.success {
  background: rgba(26, 125, 77, 0.1);
  color: var(--color-success);
}

.ufo-examples h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--plum-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ufo-examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.ufo-example {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--plum-glass);
  border: 1px solid var(--plum-glass-border);
  font-size: 13px;
  color: var(--plum-ink);
  text-align: left;
  transition: all var(--duration-fast);
  cursor: pointer;
}

.ufo-example:hover {
  background: var(--plum-glass-strong);
  border-color: var(--plum-primary);
}

@media (prefers-color-scheme: dark) {
  .ufo-input-row input {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
  }

  .ufo-input-row input:focus {
    border-color: var(--accent);
  }

  .ufo-status {
    background: var(--surface);
    color: var(--text-muted);
  }

  .ufo-example {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
  }

  .ufo-example:hover {
    border-color: var(--accent);
  }
}

/* ============================================
   BUTTONS & INPUTS
   ============================================ */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-primary-light));
  color: white;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--plum-shadow-small);
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: none;
}

.ghost-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--plum-glass-subtle);
  color: var(--plum-primary-dark);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(var(--plum-primary-rgb), 0.2);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.ghost-btn:hover {
  background: var(--plum-glass);
  border-color: rgba(var(--plum-primary-rgb), 0.35);
}

.ghost-btn:active {
  transform: scale(0.97);
  background: var(--plum-glass);
}

.ghost-btn.active {
  background: rgba(var(--plum-primary-rgb), 0.18);
  border-color: rgba(var(--plum-primary-rgb), 0.35);
  color: var(--plum-primary-dark);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--plum-glass-subtle);
  border: 1px solid var(--plum-glass-border);
  color: var(--plum-ink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.icon-btn:hover {
  background: var(--plum-glass);
  border-color: rgba(var(--plum-primary-rgb), 0.3);
  color: var(--plum-ink);
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--plum-glass);
}

/* Inputs */
input[type="text"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  font-family: inherit;
  color: var(--plum-ink);
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(var(--plum-primary-rgb), 0.4);
  box-shadow: 0 0 0 3px rgba(var(--plum-primary-rgb), 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--plum-muted);
}

/* Search Row */
.search-row,
.agent-input-row {
  display: flex;
  gap: 10px;
}

.search-row input,
.agent-input-row input {
  flex: 1;
}

.search-row button,
.agent-input-row button {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-primary-light));
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--plum-shadow-small);
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.search-row button:active,
.agent-input-row button:active {
  transform: scale(0.95);
}

/* Pills & Badges */
.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(var(--plum-primary-rgb), 0.12);
  color: var(--plum-primary-dark);
  border: 1px solid rgba(var(--plum-primary-rgb), 0.2);
}

.meta {
  font-size: 13px;
  color: var(--plum-muted);
  margin-top: 10px;
}

/* ============================================
   AGENT PANEL - Chat Interface
   ============================================ */
.agent-view-scroll {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 12px;
}

.agent-toolbar {
  background: var(--plum-glass-strong);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.agent-toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.agent-toolbar-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--plum-ink);
}

.agent-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-toggle-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--plum-glass);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--plum-ink-light);
}

.toggle-switch {
  width: 36px;
  height: 20px;
  accent-color: var(--plum-primary);
  cursor: pointer;
}

.agent-new-btn {
  background: var(--plum-primary) !important;
  color: white !important;
}

.agent-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.agent-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--plum-glass);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out-cubic);
  min-width: 140px;
}

.agent-tab:hover {
  background: var(--plum-glass-strong);
}

.agent-tab.active {
  background: rgba(var(--plum-primary-rgb), 0.15);
  border-color: var(--plum-primary);
  box-shadow: var(--plum-shadow-small);
}

.agent-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-neutral);
  flex-shrink: 0;
}

.agent-tab-dot.running { background: var(--color-success); }
.agent-tab-dot.error { background: var(--color-error); }

.agent-tab-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.agent-tab-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--plum-ink-light);
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-tab-status {
  font-size: 11px;
  color: var(--plum-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-tabs-empty {
  padding: 10px 14px;
  background: var(--plum-glass);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--plum-muted);
}

/* Chat Panel */
.agent-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--plum-glass-strong);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  min-height: 300px;
}

/* Approval Banner */
.agent-approvals-banner {
  margin: 12px 14px 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  border: 1px solid #ffcc80;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.12);
}

.agent-approval-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
  color: #e65100;
}

.agent-approval-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.agent-approval-item:not(:last-child) {
  border-bottom: 1px solid rgba(255, 152, 0, 0.2);
  margin-bottom: 8px;
}

.agent-approval-text {
  font-size: 13px;
  color: var(--plum-ink-light);
}

.agent-approval-actions {
  display: flex;
  gap: 8px;
}

.agent-approval-actions button {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

/* Chat Messages */
.agent-chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

.agent-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  height: 100%;
}

.agent-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--plum-primary-rgb), 0.1), rgba(var(--plum-accent-rgb), 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.agent-empty-icon svg {
  stroke: var(--plum-primary);
  opacity: 0.7;
}

.agent-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--plum-ink-light);
  margin-bottom: 6px;
}

.agent-empty-subtitle {
  font-size: 13px;
  color: var(--plum-muted);
  max-width: 240px;
}

/* Chat Bubbles */
.agent-chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  animation: slideUp var(--duration-fast) var(--ease-out-cubic);
}

.agent-chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-primary-light));
  color: white;
  border-bottom-right-radius: 4px;
}

.agent-chat-bubble.agent {
  align-self: flex-start;
  background: var(--plum-glass);
  border: 1px solid var(--plum-glass-border);
  color: var(--plum-ink);
  border-bottom-left-radius: 4px;
}

.agent-chat-bubble.status {
  align-self: stretch;
  max-width: 100%;
  background: #eaf3f1;
  border: 1px solid #bfd9d2;
  color: var(--plum-ink-light);
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.agent-chat-bubble.status.error {
  background: #ffe6e0;
  border-color: #e5a094;
}

.agent-chat-bubble .bubble-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
  margin-bottom: 2px;
}

.agent-chat-bubble .bubble-text {
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.agent-chat-bubble .bubble-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
}

/* Status Bar */
.agent-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(var(--plum-primary-rgb), 0.06);
  border-top: 1px solid var(--plum-glass-border);
  font-size: 12px;
  color: var(--plum-muted);
}

.agent-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--plum-primary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Browser Progress */
.agent-browser-progress {
  padding: 10px 14px;
  background: rgba(var(--plum-primary-rgb), 0.04);
  border-top: 1px solid var(--plum-glass-border);
  max-height: 100px;
  overflow-y: auto;
}

.agent-progress-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--plum-muted);
}

.agent-progress-item:not(:last-child) {
  border-bottom: 1px solid var(--plum-glass-border);
}

/* Agent Output */
.agent-output {
  margin: 0;
  padding: 12px 14px;
  background: #101413;
  color: #dfe8e4;
  font-size: 12px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 150px;
  overflow-y: auto;
  border-top: 1px solid var(--plum-glass-border);
}

/* Input Area */
.agent-input-area {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--plum-glass-border);
  background: rgba(255, 255, 255, 0.5);
}

.agent-input-area input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 14px;
  transition: border-color var(--duration-fast);
}

.agent-input-area input:focus {
  outline: none;
  border-color: var(--plum-primary);
}

.agent-send-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-primary-light));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--plum-shadow-small);
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.agent-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--plum-shadow-soft);
}

.agent-send-btn:active {
  transform: scale(0.97);
}

/* Legacy compatibility */
.agent-toggles {
  display: none;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.toggle-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--plum-primary);
  cursor: pointer;
}

.toggle-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--plum-ink-light);
}

.toggle-note {
  font-size: 11px;
  color: var(--plum-muted);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
}

.settings-item-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--plum-ink-light);
}

.settings-item-actions {
  display: flex;
  gap: 6px;
}

.settings-move-btn {
  min-width: 36px;
  height: 28px;
  padding: 0 6px;
  font-size: 11px;
  border-radius: 8px;
  border: 1px solid var(--plum-glass-border);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

/* Activity & Approvals Lists */
.approvals-list,
.activity-list,
.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.approval-card,
.activity-card,
.result-card {
  padding: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  animation: slideUp var(--duration-normal) var(--ease-out-cubic);
}

.approval-card strong,
.activity-card strong,
.result-card strong {
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.result-meta {
  font-size: 12px;
  color: var(--plum-muted);
  word-break: break-all;
}

.result-score {
  font-size: 12px;
  font-weight: 600;
  color: var(--plum-primary-dark);
  margin-top: 4px;
}

.approval-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ============================================
   BROWSER/SCREEN PANEL
   ============================================ */
.panel-screen {
  flex: 1;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.screen-frame {
  flex: 1;
  min-height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--plum-glass-border);
  background: #0d1a18;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-frame img {
  display: none;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  transform-origin: center center;
  transition: transform var(--duration-normal) var(--ease-out-cubic);
}

.screen-frame img[src]:not([src=""]) {
  display: block;
}

.screen-frame img[src]:not([src=""]) + .screen-overlay + .screen-placeholder {
  display: none;
}

.stream-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(200, 200, 200, 0.85));
  border: 2px solid rgba(var(--plum-primary-rgb), 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.1s ease-out;
}

.stream-cursor::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--plum-primary);
  transform: translate(-50%, -50%);
}

.stream-cursor::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(var(--plum-primary-rgb), 0.4);
  animation: cursor-pulse 1.5s ease-in-out infinite;
}

@keyframes cursor-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 0.3; }
}

.screen-overlay {
  position: absolute;
  inset: 0;
  touch-action: none;
  pointer-events: none;
  cursor: default;
  z-index: 10;
}

/* Enable pointer events when in control mode */
.control-mode .screen-overlay {
  pointer-events: auto;
  cursor: crosshair;
}

/* For touch devices, show a tap indicator */
.control-mode .screen-overlay:active {
  background: radial-gradient(circle at var(--tap-x, 50%) var(--tap-y, 50%), rgba(var(--plum-primary-rgb), 0.15) 0%, transparent 40%);
}

.screen-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.screen-placeholder span {
  font-size: 13px;
}

.screen-input-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.screen-input-row input {
  flex: 1;
}

.screen-input-row.keyboard-focused {
  background: rgba(var(--plum-primary-rgb), 0.1);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin: 4px -8px;
}

.screen-input-row input.input-sent {
  background: rgba(var(--plum-primary-rgb), 0.2);
}

.trackpad {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trackpad-surface {
  height: clamp(100px, 20vh, 160px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(160deg, rgba(14, 24, 30, 0.92), rgba(12, 20, 22, 0.82));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  touch-action: none;
  user-select: none;
}

.trackpad-buttons {
  display: flex;
  gap: 10px;
}

.trackpad-buttons .ghost-btn {
  flex: 1;
}

/* Trackpad visual feedback */
.trackpad-surface.trackpad-active {
  background: linear-gradient(160deg, rgba(var(--plum-primary-rgb), 0.25), rgba(12, 20, 22, 0.82));
  border-color: var(--plum-primary);
}

.trackpad-surface.trackpad-tap {
  animation: trackpad-tap-pulse 0.15s ease-out;
}

@keyframes trackpad-tap-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.98); background: rgba(var(--plum-primary-rgb), 0.35); }
  100% { transform: scale(1); }
}

.trackpad-surface.input-error {
  border-color: #e74c3c;
  animation: input-error-shake 0.2s ease-out;
}

@keyframes input-error-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.trackpad-buttons .ghost-btn.btn-pressed {
  transform: scale(0.95);
  background: var(--plum-primary);
  color: white;
  border-color: var(--plum-primary);
}

body.stream-only header,
body.stream-only .dock,
body.stream-only footer {
  display: none;
}

body.stream-only .view-stream .stream-shell {
  padding: 0 0 calc(12px + var(--safe-bottom));
  gap: 8px;
}

body.stream-only .view-stream .stream-header {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: 40;
  margin: calc(8px + var(--safe-top)) 8px 0 8px;
}

body.stream-only .view-stream .screen-frame {
  border-radius: 0;
  border: none;
}

body.stream-only .view-stream #screenHint {
  margin: 8px 12px;
}

.view-stream .stream-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px calc(12px + var(--safe-bottom));
  position: relative;
}

.view-stream .stream-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  background: var(--plum-glass);
  border: 1px solid var(--plum-glass-border);
  box-shadow: var(--plum-shadow-soft);
  position: relative;
  z-index: 20;
}

/* Touch mode indicator - pulsing border when touch control is available */
.touch-mode.control-mode .screen-frame {
  box-shadow: 0 0 0 2px var(--plum-primary), var(--plum-shadow);
}

/* Make touchpad button more prominent for touch users */
body:not(.control-mode) .view-stream .stream-actions .ghost-btn[title="Touchpad"] {
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-primary-light));
  color: white;
  border-color: transparent;
}

/* Control mode active indicator */
.control-mode .view-stream .stream-actions .ghost-btn.active {
  background: var(--plum-primary);
  color: white;
  border-color: var(--plum-primary);
}

.view-stream .stream-title {
  flex: 1;
  min-width: 0;
}

.view-stream .stream-title h3 {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-stream .stream-actions {
  display: flex;
  gap: 8px;
}

.view-stream .stream-actions .ghost-btn {
  padding: 6px 10px;
  font-size: 12px;
}

.view-stream .screen-frame {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-lg);
}

.view-stream #screenHint {
  margin-top: 0;
  font-size: 12px;
}

.view-stream .trackpad {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 30;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(16, 24, 28, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  box-shadow: var(--plum-shadow-soft);
}

.view-stream .screen-input-row {
  margin-top: 0;
}

/* Small mobile screens - optimize stream view */
@media (max-width: 480px) {
  .view-stream .stream-shell {
    padding: 6px 8px calc(8px + var(--safe-bottom));
    gap: 6px;
  }

  .view-stream .stream-header {
    padding: 6px 10px;
    border-radius: var(--radius-md);
    gap: 8px;
  }

  .view-stream .stream-header .icon-btn {
    width: 34px;
    height: 34px;
  }

  .view-stream .stream-title h3 {
    font-size: 13px;
  }

  .view-stream .stream-actions .ghost-btn span {
    display: none;
  }

  .view-stream .stream-actions .ghost-btn {
    padding: 6px 8px;
    min-width: 34px;
    height: 34px;
  }

  .view-stream .screen-frame {
    border-radius: var(--radius-md);
  }

  .view-stream .trackpad {
    left: 8px;
    right: 8px;
    bottom: calc(8px + var(--safe-bottom));
    padding: 10px;
    border-radius: var(--radius-md);
  }

  .view-stream .trackpad-surface {
    height: clamp(80px, 16vh, 120px);
    border-radius: var(--radius-sm);
    font-size: 11px;
    padding: 8px;
  }

  .view-stream .trackpad-buttons {
    gap: 8px;
  }

  .view-stream .trackpad-buttons .ghost-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .view-stream .screen-input-row {
    gap: 8px;
  }

  .view-stream .screen-input-row input {
    padding: 10px 12px;
    font-size: 14px;
  }

  .view-stream #screenHint {
    font-size: 11px;
    padding: 0 4px;
  }
}

/* Very small screens (iPhone SE, etc) */
@media (max-width: 375px) {
  .view-stream .stream-shell {
    padding: 4px 6px calc(6px + var(--safe-bottom));
    gap: 4px;
  }

  .view-stream .stream-header {
    padding: 4px 8px;
    gap: 6px;
  }

  .view-stream .stream-header .icon-btn {
    width: 30px;
    height: 30px;
  }

  .view-stream .stream-title h3 {
    font-size: 12px;
  }

  .view-stream .stream-actions .ghost-btn {
    padding: 4px 6px;
    min-width: 30px;
    height: 30px;
  }

  .view-stream .trackpad {
    left: 6px;
    right: 6px;
    bottom: calc(6px + var(--safe-bottom));
    padding: 8px;
  }

  .view-stream .trackpad-surface {
    height: clamp(70px, 14vh, 100px);
  }

  .view-stream .trackpad-buttons .ghost-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .view-stream #screenHint {
    display: none;
  }
}

/* Landscape mode on mobile - maximize stream area */
@media (max-height: 500px) and (orientation: landscape) {
  .view-stream .stream-shell {
    padding: 4px 8px;
    gap: 4px;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .view-stream .stream-header {
    padding: 4px 10px;
    width: 100%;
    order: 1;
  }

  .view-stream .screen-frame {
    flex: 1;
    order: 2;
    min-width: 0;
    height: calc(100% - 50px);
  }

  .view-stream .trackpad {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 200px;
    order: 3;
    margin: 0;
    padding: 8px;
    flex-shrink: 0;
  }

  .view-stream .trackpad-surface {
    height: 80px;
  }

  .view-stream #screenHint {
    display: none;
  }

  /* When trackpad is open in landscape, layout side by side */
  body.trackpad-open .view-stream .stream-shell {
    flex-direction: row;
  }

  body.trackpad-open .view-stream .screen-frame {
    width: calc(100% - 210px);
    height: calc(100% - 44px);
  }

  body.trackpad-open .view-stream .trackpad {
    height: calc(100% - 44px);
    display: flex;
    flex-direction: column;
  }

  body.trackpad-open .view-stream .trackpad-surface {
    flex: 1;
    height: auto;
  }
}

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.apps-search-row {
  margin-bottom: 12px;
}

.app-card {
  padding: 12px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.92), rgba(233, 242, 240, 0.85));
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.app-card:active {
  transform: scale(0.97);
  box-shadow: var(--plum-shadow-small);
}

.app-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-card small {
  font-size: 11px;
  color: var(--plum-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Windows Grid */
.windows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
}

.window-card {
  padding: 14px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.92), rgba(232, 241, 239, 0.85));
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.window-card:active {
  transform: scale(0.97);
  box-shadow: var(--plum-shadow-small);
}

.window-card.is-foreground {
  border-color: rgba(var(--plum-primary-rgb), 0.4);
  box-shadow: var(--plum-shadow-small);
}

.window-card.is-minimized {
  border-color: rgba(248, 113, 113, 0.2);
}

.window-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.window-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(var(--plum-primary-rgb), 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.window-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.window-fallback {
  font-size: 16px;
  font-weight: 600;
  color: var(--plum-primary-dark);
}

.window-text {
  min-width: 0;
}

.window-text strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-text small {
  font-size: 11px;
  color: var(--plum-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-status {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.06);
  color: var(--plum-muted);
}

.window-status.is-foreground {
  background: rgba(var(--plum-primary-rgb), 0.15);
  color: var(--plum-primary-dark);
}

.window-status.is-minimized {
  background: rgba(248, 113, 113, 0.15);
  color: #9b2c2c;
}

/* ============================================
   FILES VIEW
   ============================================ */
.files-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--plum-glass-subtle);
  border-radius: var(--radius-sm);
  animation: fadeIn var(--duration-normal) var(--ease-out-cubic);
}

.breadcrumb-item {
  padding: 6px 10px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--plum-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.breadcrumb-item:hover,
.breadcrumb-item:active {
  background: var(--plum-glass);
  color: var(--plum-primary-dark);
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: var(--plum-subtle);
}

.breadcrumb-item:last-child {
  color: var(--plum-ink);
  font-weight: 600;
}

.files-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}

.files-search-row {
  flex: 1;
}

.files-toolbar-actions {
  display: flex;
  gap: 6px;
}

/* Quick Access */
.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.quick-access-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.quick-access-item:active {
  transform: scale(0.95);
  background: var(--plum-glass);
}

.quick-access-item svg {
  color: var(--plum-primary);
}

.quick-access-item span {
  font-size: 11px;
  font-weight: 500;
  color: var(--plum-ink-light);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Drives */
.drives-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drive-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.drive-item:active {
  transform: scale(0.98);
  background: var(--plum-glass);
}

.drive-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.drive-info {
  flex: 1;
  min-width: 0;
}

.drive-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.drive-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.drive-bar-fill {
  height: 100%;
  background: var(--plum-primary);
  border-radius: 2px;
  transition: width var(--duration-normal) var(--ease-out-cubic);
}

.drive-meta {
  font-size: 11px;
  color: var(--plum-muted);
}

/* Files Grid */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.files-grid.list-view {
  grid-template-columns: 1fr;
}

.file-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-cubic);
  animation: fadeIn var(--duration-normal) var(--ease-out-cubic);
}

.file-item:active {
  transform: scale(0.95);
  background: var(--plum-glass);
}

.file-item.is-directory {
  border-color: rgba(var(--plum-primary-rgb), 0.2);
}

.file-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--plum-primary);
}

.file-icon.folder {
  color: #f59e0b;
}

.file-icon.image {
  color: #ec4899;
}

.file-icon.archive {
  color: #8b5cf6;
}

.file-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--plum-ink-light);
  text-align: center;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}

.file-meta {
  font-size: 10px;
  color: var(--plum-muted);
}

/* List View */
.files-grid.list-view .file-item {
  flex-direction: row;
  padding: 10px 12px;
  gap: 12px;
}

.files-grid.list-view .file-icon {
  width: 32px;
  height: 32px;
}

.files-grid.list-view .file-name {
  flex: 1;
  text-align: left;
  -webkit-line-clamp: 1;
}

.files-grid.list-view .file-meta {
  flex-shrink: 0;
}

.files-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--plum-muted);
}

/* File Explorer Tabs */
.files-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  min-height: 48px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.files-tabs-bar::-webkit-scrollbar {
  display: none;
}

.files-tabs {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.files-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--plum-ink-light);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  max-width: 160px;
  min-width: 80px;
}

.files-tab:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(var(--plum-primary-rgb), 0.2);
}

.files-tab.active {
  background: linear-gradient(135deg, rgba(var(--plum-primary-rgb), 0.15), rgba(var(--plum-secondary-rgb), 0.1));
  border-color: rgba(var(--plum-primary-rgb), 0.3);
  color: var(--plum-primary-dark);
}

.files-tab-icon {
  width: 16px;
  height: 16px;
  color: #f59e0b;
  flex-shrink: 0;
}

.files-tab-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.files-tab-close {
  width: 18px;
  height: 18px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--plum-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: all 0.15s ease;
}

.files-tab:hover .files-tab-close,
.files-tab.active .files-tab-close {
  opacity: 1;
  pointer-events: auto;
}

.files-tab-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--color-error);
}

.files-tab-add {
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  color: var(--plum-ink-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.files-tab-add:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--plum-primary);
  border-style: solid;
  color: var(--plum-primary);
}

/* Image Thumbnails */
.file-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-item.has-thumbnail .file-icon {
  display: none;
}

.files-grid.list-view .file-thumbnail {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

/* Dark mode file tabs */
@media (prefers-color-scheme: dark) {
  .files-tabs-bar {
    background: rgba(30, 35, 50, 0.6);
  }

  .files-tab {
    background: rgba(40, 45, 60, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
  }

  .files-tab:hover {
    background: rgba(50, 55, 70, 0.9);
    border-color: rgba(var(--plum-accent-rgb), 0.3);
  }

  .files-tab.active {
    background: linear-gradient(135deg, rgba(var(--plum-accent-rgb), 0.2), rgba(var(--plum-secondary-rgb), 0.15));
    border-color: rgba(var(--plum-accent-rgb), 0.4);
    color: var(--plum-accent);
  }

  .files-tab-close:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .files-tab-add {
    background: rgba(40, 45, 60, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
  }

  .files-tab-add:hover {
    background: rgba(50, 55, 70, 0.8);
    border-color: var(--plum-accent);
    color: var(--plum-accent);
  }
}

/* ============================================
   BOTTOM DOCK NAVIGATION
   ============================================ */
.dock {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  margin: 8px 12px;
  border-radius: var(--radius-xl);
  background: var(--plum-glass-strong);
  border: 1px solid var(--plum-glass-border);
  box-shadow: var(--plum-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 20;
  animation: slideUp var(--duration-slow) var(--ease-out-cubic);
}

.dock-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--plum-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.dock-item:hover {
  color: var(--plum-ink);
  background: var(--plum-glass-highlight);
}

.dock-item:active {
  transform: scale(0.92);
}

.dock-item.active {
  background: rgba(var(--plum-primary-rgb), 0.15);
  color: var(--plum-primary);
}

.dock-item.active:hover {
  background: rgba(var(--plum-primary-rgb), 0.22);
}

.dock-item svg {
  transition: transform var(--duration-fast) var(--ease-out-cubic);
}

.dock-item.active svg {
  transform: scale(1.1);
}

.dock-label {
  font-size: 10px;
  font-weight: 600;
}

/* Holographic Launcher Button - Enhanced */
.launcher-holo {
  position: relative;
  overflow: visible;
  border-radius: var(--radius-md);
}

/* Animated border ring */
.launcher-holo::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--radius-md) + 3px);
  background: conic-gradient(
    from 0deg,
    #00ffd1,
    #00d4ff,
    #b088ff,
    #ff88d1,
    #ffd700,
    #00ffd1
  );
  opacity: 0;
  filter: blur(2px);
  transition: opacity 0.3s var(--ease-out-cubic);
  pointer-events: none;
  z-index: -1;
}

/* Inner glow effect */
.launcher-holo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: radial-gradient(
    circle at 30% 20%,
    rgba(255, 255, 255, 0.5),
    rgba(255, 255, 255, 0) 60%
  );
  opacity: 0;
  transition: opacity 0.2s var(--ease-out-cubic);
  pointer-events: none;
}

/* Hover and active states */
.launcher-holo:hover::before,
body.launcher-open .launcher-holo::before {
  opacity: 1;
  animation: holoRotate 2.5s linear infinite;
}

.launcher-holo:hover::after,
body.launcher-open .launcher-holo::after {
  opacity: 0.7;
}

/* Pulsing glow effect */
.launcher-holo:hover,
body.launcher-open .launcher-holo {
  box-shadow:
    0 0 20px rgba(0, 255, 209, 0.5),
    0 0 40px rgba(0, 212, 255, 0.3),
    0 0 60px rgba(176, 136, 255, 0.2);
  animation: holoPulse 2s ease-in-out infinite;
  transform: scale(1.05);
  transition: transform 0.2s var(--ease-out-back), box-shadow 0.3s var(--ease-out-cubic);
}

.launcher-holo:active {
  transform: scale(0.95);
}

/* Icon color shift on hover */
.launcher-holo:hover svg,
body.launcher-open .launcher-holo svg {
  filter: drop-shadow(0 0 4px rgba(0, 255, 209, 0.6));
}

.dock-item.launcher:hover,
body.launcher-open .dock-item.launcher {
  background: linear-gradient(135deg,
    rgba(0, 255, 209, 0.15),
    rgba(0, 212, 255, 0.1),
    rgba(176, 136, 255, 0.1)
  );
  color: #00d4b8;
}

body.launcher-open #launcherToggle {
  background: rgba(0, 255, 209, 0.12);
  border-color: rgba(0, 255, 209, 0.4);
  color: #00d4b8;
}

/* Holographic rotation animation */
@keyframes holoRotate {
  from {
    background: conic-gradient(
      from 0deg,
      #00ffd1,
      #00d4ff,
      #b088ff,
      #ff88d1,
      #ffd700,
      #00ffd1
    );
  }
  to {
    background: conic-gradient(
      from 360deg,
      #00ffd1,
      #00d4ff,
      #b088ff,
      #ff88d1,
      #ffd700,
      #00ffd1
    );
  }
}

/* Pulsing glow animation */
@keyframes holoPulse {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(0, 255, 209, 0.5),
      0 0 40px rgba(0, 212, 255, 0.3),
      0 0 60px rgba(176, 136, 255, 0.2);
  }
  50% {
    box-shadow:
      0 0 25px rgba(0, 255, 209, 0.6),
      0 0 50px rgba(176, 136, 255, 0.4),
      0 0 70px rgba(255, 136, 209, 0.25);
  }
}

/* Legacy sweep animation for fallback */
@keyframes holoSweep {
  0% {
    transform: translateX(-25%) rotate(12deg);
  }
  50% {
    transform: translateX(0) rotate(12deg);
  }
  100% {
    transform: translateX(25%) rotate(12deg);
  }
}

/* ============================================
   LAUNCHER OVERLAY
   ============================================ */
.launcher-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(12vh + var(--safe-top)) 16px 16px;
  z-index: 1200;
}

.launcher-overlay[hidden] {
  display: none;
}

.launcher-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 20, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.launcher-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: min(560px, 78vh);
  z-index: 1;
  animation: launcherIn var(--duration-normal) var(--ease-out-cubic);
}

.launcher-panel::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: var(--radius-xl);
  background: linear-gradient(130deg, rgba(var(--plum-secondary-rgb), 0.5), rgba(var(--plum-accent-rgb), 0.35), rgba(255, 204, 146, 0.4));
  filter: blur(16px);
  opacity: 0.55;
  animation: launcherGlow 6s ease-in-out infinite;
  z-index: -1;
}

.launcher-shell {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  background: var(--plum-glass-strong);
  border: 1px solid var(--plum-glass-border);
  box-shadow: var(--plum-shadow);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  overflow: hidden;
}

.launcher-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--plum-glass-border);
}

.launcher-input-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(var(--plum-primary-rgb), 0.12);
  color: var(--plum-primary);
}

#launcherInput {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 500;
  color: var(--plum-ink);
  outline: none;
}

#launcherInput::placeholder {
  color: var(--plum-muted);
}

.launcher-clear {
  width: 30px;
  height: 30px;
}

.launcher-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--plum-glass-border);
  border-top-color: var(--plum-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.launcher-plan {
  padding: 16px;
  background: rgba(var(--plum-primary-rgb), 0.05);
  border-bottom: 1px solid var(--plum-glass-border);
}

.launcher-plan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.launcher-plan-header svg {
  color: var(--plum-primary);
}

.launcher-plan-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(var(--plum-primary-rgb), 0.12);
  border: 1px solid rgba(var(--plum-primary-rgb), 0.2);
  color: var(--plum-primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.launcher-plan[data-status="executing"] .launcher-plan-status {
  background: rgba(var(--plum-secondary-rgb), 0.15);
  border-color: rgba(var(--plum-secondary-rgb), 0.25);
  color: var(--plum-primary-dark);
}

.launcher-plan[data-status="done"] .launcher-plan-status {
  background: rgba(26, 125, 77, 0.14);
  border-color: rgba(26, 125, 77, 0.25);
  color: var(--color-success);
}

.launcher-plan[data-status="failed"] .launcher-plan-status {
  background: rgba(179, 38, 30, 0.14);
  border-color: rgba(179, 38, 30, 0.3);
  color: var(--color-error);
}

.launcher-plan-progress {
  margin-top: 10px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(var(--plum-primary-rgb), 0.1);
  overflow: hidden;
}

.launcher-plan-progress span {
  display: block;
  height: 100%;
  background: var(--plum-primary);
  border-radius: inherit;
  transition: width var(--duration-normal) var(--ease-out-cubic);
}

.launcher-plan-steps {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.launcher-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--plum-ink-light);
}

.launcher-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(93, 100, 111, 0.4);
}

.launcher-step[data-status="running"] .launcher-step-dot {
  background: var(--plum-primary);
  box-shadow: 0 0 10px rgba(var(--plum-primary-rgb), 0.4);
}

.launcher-step[data-status="done"] .launcher-step-dot {
  background: var(--color-success);
}

.launcher-step[data-status="failed"] .launcher-step-dot {
  background: var(--color-error);
}

.launcher-plan-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.launcher-plan-actions .ghost-btn,
.launcher-plan-actions .btn-primary {
  padding: 6px 12px;
  font-size: 12px;
}

.launcher-plan-result {
  margin-top: 10px;
  font-size: 12px;
  color: var(--plum-muted);
}

.launcher-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.launcher-undo {
  padding: 12px 16px;
  border-top: 1px solid var(--plum-glass-border);
  background: rgba(var(--plum-primary-rgb), 0.04);
}

.launcher-undo-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--plum-muted);
}

.launcher-undo-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.launcher-undo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--plum-ink-light);
}

.launcher-undo-item span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launcher-undo-btn {
  padding: 6px 10px;
  font-size: 12px;
}

.launcher-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.launcher-result:hover {
  background: rgba(var(--plum-primary-rgb), 0.08);
}

.launcher-result.selected {
  background: rgba(var(--plum-primary-rgb), 0.14);
  border-color: rgba(var(--plum-primary-rgb), 0.2);
}

.launcher-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--plum-primary-rgb), 0.14);
  color: var(--plum-primary);
  flex-shrink: 0;
}

.launcher-result[data-type="file"] .launcher-icon {
  background: rgba(var(--plum-secondary-rgb), 0.14);
  color: var(--plum-secondary);
}

.launcher-result[data-type="action"] .launcher-icon,
.launcher-result[data-type="suggestion"] .launcher-icon {
  background: rgba(255, 204, 146, 0.18);
  color: #c57c2e;
}

.launcher-result[data-type="agent"] .launcher-icon {
  background: rgba(var(--plum-accent-rgb), 0.18);
  color: var(--plum-primary-dark);
}

.launcher-icon svg {
  width: 18px;
  height: 18px;
}

.launcher-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.launcher-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--plum-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launcher-subtitle {
  font-size: 12px;
  color: var(--plum-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launcher-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.launcher-badge.confirm {
  background: rgba(184, 121, 30, 0.12);
  border-color: rgba(184, 121, 30, 0.25);
  color: var(--color-warning);
}

.launcher-badge.blocked {
  background: rgba(179, 38, 30, 0.12);
  border-color: rgba(179, 38, 30, 0.25);
  color: var(--color-error);
}

.launcher-empty {
  padding: 12px 16px 16px;
  font-size: 12px;
  color: var(--plum-muted);
}

.launcher-error {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--color-error);
  background: rgba(179, 38, 30, 0.08);
  border-top: 1px solid rgba(179, 38, 30, 0.2);
}

/* Command Status Overlay */
.command-status {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 3200;
  pointer-events: none;
}

.command-status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  min-width: 200px;
  max-width: 420px;
  background: var(--plum-glass-strong);
  border-radius: var(--radius-pill);
  border: 1px solid var(--plum-glass-border);
  box-shadow: var(--plum-shadow-soft);
  backdrop-filter: blur(18px);
  color: var(--plum-ink);
  pointer-events: auto;
  cursor: pointer;
  font-size: 13px;
  transition: transform var(--duration-normal) var(--ease-out-cubic),
    opacity var(--duration-normal) var(--ease-out-cubic);
}

.command-status-card[data-status="running"] {
  border-color: rgba(var(--plum-accent-rgb), 0.6);
  box-shadow: 0 16px 36px rgba(var(--plum-accent-rgb), 0.25);
  animation: commandStatusPulse 2.6s ease-in-out infinite;
}

.command-status-card[data-status="done"] {
  border-color: rgba(26, 125, 77, 0.6);
  box-shadow: 0 16px 36px rgba(26, 125, 77, 0.2);
}

.command-status-card[data-status="error"] {
  border-color: rgba(179, 38, 30, 0.65);
  box-shadow: 0 16px 36px rgba(179, 38, 30, 0.2);
}

.command-status-card[data-status="attention"] {
  border-color: rgba(184, 121, 30, 0.65);
  box-shadow: 0 16px 36px rgba(184, 121, 30, 0.25);
  animation: commandStatusPulse 2.8s ease-in-out infinite;
}

@keyframes commandStatusPulse {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.command-status-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--plum-primary-rgb), 0.12);
  color: var(--plum-primary);
}

.command-status-card[data-status="done"] .command-status-icon {
  color: var(--color-success);
  background: rgba(26, 125, 77, 0.12);
}

.command-status-card[data-status="error"] .command-status-icon {
  color: var(--color-error);
  background: rgba(179, 38, 30, 0.12);
}

.command-status-card[data-status="attention"] .command-status-icon {
  color: var(--color-warning);
  background: rgba(184, 121, 30, 0.12);
}

.command-status-icon svg {
  width: 18px;
  height: 18px;
}

.command-status-content {
  flex: 1;
  min-width: 0;
}

.command-status-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.command-status-message {
  font-size: 0.85rem;
  color: var(--plum-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.command-status-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(var(--plum-primary-rgb), 0.35);
  border-top-color: transparent;
  animation: commandSpin 1s linear infinite;
}

.command-status-action {
  border-radius: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--plum-muted);
}

@keyframes commandSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes launcherIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes launcherGlow {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}

@media (prefers-reduced-motion: reduce) {
  .launcher-panel,
  .launcher-panel::before {
    animation: none;
  }
}

@media (max-width: 600px) {
  .launcher-panel {
    max-height: 72vh;
  }

  .launcher-input-row {
    padding: 14px;
  }

  #launcherInput {
    font-size: 16px;
  }
}

/* ============================================
   SHEETS & MODALS
   ============================================ */
.sheet-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out-cubic);
}

.sheet-backdrop:not([hidden]),
.modal-backdrop:not([hidden]) {
  opacity: 1;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--plum-glass-strong);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 0 20px 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  max-height: 85vh;
  overflow-y: auto;
  z-index: 51;
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-out-cubic);
}

.sheet:not([hidden]) {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  margin: 12px auto 16px;
}

.sheet-content h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.settings-group {
  margin-bottom: 20px;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.settings-row span {
  font-size: 13px;
  font-weight: 500;
  color: var(--plum-muted);
}

.settings-info {
  font-size: 13px;
  color: var(--plum-muted);
  line-height: 1.6;
}

.settings-info p {
  margin: 0 0 8px 0;
}

.settings-info p:last-child {
  margin-bottom: 0;
}

/* Modal */
.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: calc(100% - 32px);
  max-width: 400px;
  max-height: 80vh;
  background: var(--plum-glass-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--plum-shadow);
  z-index: 51;
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-out-cubic);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal:not([hidden]) {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--plum-glass-border);
}

.modal-header h3 {
  font-size: 16px;
  margin: 0;
}

.modal-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.modal-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--plum-glass-border);
}

.modal-actions button {
  flex: 1;
}

/* File Viewer Modal */
.file-viewer-modal {
  max-width: 90vw;
  max-height: 90vh;
  width: 800px;
}

@media (max-width: 768px) {
  .file-viewer-modal {
    width: calc(100% - 16px);
    max-height: 95vh;
  }
}

.preview-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.preview-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--plum-primary);
  color: white;
  flex-shrink: 0;
}

.preview-icon svg {
  width: 18px;
  height: 18px;
}

.preview-title-wrap {
  flex: 1;
  min-width: 0;
}

.preview-title-wrap h3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-size {
  font-size: 12px;
  color: var(--plum-muted);
}

/* Image Viewer */
.image-viewer {
  background: #1a1a1a;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pinch-zoom pan-x pan-y;
}

.image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.2s ease-out;
}

.image-container img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 0;
  transition: transform 0.2s ease-out;
}

/* PDF Viewer */
.pdf-viewer {
  background: #525659;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pdf-frame {
  width: 100%;
  height: 65vh;
  border: 0;
  background: #525659;
}

/* Text Viewer */
.text-viewer {
  background: #1e1e1e;
  color: #d4d4d4;
  min-height: 300px;
  max-height: 60vh;
  overflow-y: auto;
}

.text-truncated-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--plum-primary);
  color: white;
  font-size: 12px;
}

.text-viewer pre {
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 16px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Unsupported Viewer */
.unsupported-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--plum-muted);
  text-align: center;
}

.unsupported-viewer svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.unsupported-viewer p {
  margin: 4px 0;
  font-size: 14px;
}

/* Viewer Loading */
.viewer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--plum-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--plum-glass-border);
  border-top-color: var(--plum-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.viewer-loading span {
  margin-top: 12px;
  font-size: 13px;
}

/* Viewer Toolbar */
.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  background: var(--plum-glass-subtle);
  border-top: 1px solid var(--plum-glass-border);
  flex-wrap: wrap;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--plum-glass);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--plum-ink);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-cubic);
}

.toolbar-btn svg {
  width: 16px;
  height: 16px;
}

.toolbar-btn:hover {
  background: var(--plum-glass-strong);
  border-color: var(--plum-primary);
}

.toolbar-btn:active {
  transform: scale(0.95);
}

.toolbar-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.toolbar-btn span {
  display: none;
}

@media (min-width: 500px) {
  .toolbar-btn span {
    display: inline;
  }
}

.zoom-level {
  font-size: 12px;
  font-weight: 500;
  color: var(--plum-muted);
  min-width: 48px;
  text-align: center;
}

/* ============================================
   STATUS VIEW
   ============================================ */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.status-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-sm);
}

.status-label {
  font-size: 12px;
  color: var(--plum-muted);
  display: block;
  margin-bottom: 4px;
}

.status-card strong {
  font-size: 15px;
  color: var(--plum-ink);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  flex-shrink: 0;
  text-align: center;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--plum-subtle);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   SMALL MOBILE - Compact layout for phones
   ============================================ */
@media (max-width: 480px) {
  header {
    margin: 6px 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand-tag {
    font-size: 9px;
    padding: 2px 6px;
  }

  .status-pill {
    padding: 3px 8px;
    font-size: 11px;
  }

  .header-actions {
    gap: 6px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .view-scroll {
    padding: 6px 8px 12px;
  }

  .home-grid {
    gap: 8px;
    grid-auto-rows: minmax(78px, auto);
  }

  .tile-size-small {
    min-height: 78px;
  }

  .tile-size-medium {
    min-height: 96px;
  }

  .tile-size-large {
    min-height: 120px;
    grid-row: span 1;
  }

  .home-icon-tile {
    padding: 10px 6px;
    gap: 5px;
    min-height: auto;
  }

  .home-icon-tile svg {
    width: 20px;
    height: 20px;
  }

  .home-icon-label {
    font-size: 9px;
  }

  .widget {
    padding: 12px;
    border-radius: var(--radius-md);
  }

  .widget-weather {
    min-height: 100px;
  }

  .weather-temp {
    font-size: clamp(32px, 9vw, 42px);
  }

  .weather-graphic {
    width: 60px;
    height: 60px;
    right: 8px;
    bottom: 8px;
  }

  #clockCanvas {
    max-width: 90px;
  }

  .clock-digital {
    font-size: 10px;
    margin-top: 4px;
  }

  .quick-actions {
    gap: 8px;
  }

  .action-tile {
    padding: 10px 6px;
  }

  .action-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .action-tile span {
    font-size: 10px;
  }

  .panel {
    padding: 12px;
    border-radius: var(--radius-md);
  }

  .panel h3 {
    font-size: 14px;
  }

  .dock {
    margin: 6px 8px;
    padding: 6px 8px;
    gap: 2px;
    border-radius: var(--radius-lg);
  }

  .dock-item {
    padding: 8px 6px;
    gap: 3px;
  }

  .dock-item svg {
    width: 20px;
    height: 20px;
  }

  .dock-label {
    font-size: 9px;
  }

  footer {
    padding: 6px 12px;
    font-size: 10px;
  }

  /* Hide footer on very small screens to save space */
  footer {
    display: none;
  }
}

/* Very small screens (iPhone SE, etc) */
@media (max-width: 375px) {
  header {
    margin: 4px 6px;
    padding: 8px 10px;
  }

  .brand h1 {
    font-size: 15px;
  }

  .brand-tag {
    display: none;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .view-scroll {
    padding: 4px 6px 10px;
  }

  .home-grid {
    gap: 6px;
    grid-auto-rows: minmax(70px, auto);
  }

  .tile-size-small {
    min-height: 70px;
  }

  .tile-size-medium {
    min-height: 88px;
  }

  .tile-size-large {
    min-height: 110px;
    grid-row: span 1;
  }

  .home-icon-tile {
    padding: 8px 4px;
    gap: 4px;
  }

  .home-icon-tile svg {
    width: 20px;
    height: 20px;
  }

  .home-icon-label {
    font-size: 9px;
  }

  .widget {
    padding: 10px;
  }

  .quick-actions {
    gap: 6px;
  }

  .action-tile {
    padding: 8px 4px;
  }

  .action-icon {
    width: 34px;
    height: 34px;
  }

  .dock {
    margin: 4px 6px;
    padding: 4px 6px;
  }

  .dock-item {
    padding: 6px 4px;
  }

  .dock-item svg {
    width: 18px;
    height: 18px;
  }

  .dock-label {
    font-size: 8px;
  }
}

/* ============================================
   TABLET BREAKPOINT (iPad) - 600px+
   ============================================ */
@media (min-width: 600px) {
  :root {
    --header-height: 80px;
    --dock-height: 80px;
  }

  header {
    margin: 12px 20px;
    padding: 14px 20px;
  }

  .brand h1 {
    font-size: 24px;
  }

  .view-scroll {
    padding: 12px 20px 20px;
  }

  .home-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .widget-weather {
    grid-column: span 2;
  }

  .widget-music {
    grid-column: span 2;
  }

  .widget-notes {
    grid-column: span 1;
  }

  .quick-actions {
    grid-column: span 3;
    grid-template-columns: repeat(4, 1fr);
  }

  .panel-apps {
    grid-column: span 3;
  }

  .dock {
    margin: 12px 20px;
    padding: 10px 14px;
    gap: 6px;
  }

  .dock-item {
    padding: 12px 16px;
  }

  .dock-label {
    font-size: 11px;
  }

  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .quick-access-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

/* ============================================
   DESKTOP BREAKPOINT - 900px+
   ============================================ */
@media (min-width: 900px) {
  header {
    margin: 16px 24px;
    padding: 16px 24px;
    border-radius: var(--radius-xl);
  }

  .brand h1 {
    font-size: 26px;
  }

  .view-scroll {
    padding: 16px 24px 24px;
  }

  .home-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
  }

  .widget-weather {
    grid-column: span 2;
    min-height: 140px;
  }

  .widget-clock {
    aspect-ratio: 1;
  }

  .widget-stats {
    grid-column: span 1;
  }

  .widget-music {
    grid-column: span 2;
  }

  .widget-notes {
    grid-column: span 2;
  }

  .quick-actions {
    grid-column: span 4;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .panel-apps {
    grid-column: span 4;
  }

  .view-scroll-browser {
    flex-direction: row;
    gap: 16px;
  }

  .panel-screen {
    flex: 2;
  }

  .panel-apps-list {
    flex: 1;
    min-width: 280px;
    max-width: 360px;
  }

  .dock {
    margin: 16px auto;
    padding: 8px 12px;
    max-width: 600px;
    gap: 2px;
    border-radius: var(--radius-pill);
  }

  .dock-item {
    flex: 0 1 auto;
    flex-direction: row;
    gap: 6px;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
  }

  .dock-item:not(.active) .dock-label {
    display: none;
  }

  .dock-label {
    font-size: 12px;
  }

  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

/* ============================================
   LARGE DESKTOP - 1200px+
   ============================================ */
@media (min-width: 1200px) {
  .remote-shell {
    max-width: 1400px;
    margin: 0 auto;
  }

  .home-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .widget-weather {
    grid-column: span 2;
  }

  .widget-music {
    grid-column: span 2;
  }

  .widget-notes {
    grid-column: span 1;
  }

  .quick-actions {
    grid-column: span 5;
    grid-template-columns: repeat(5, 1fr);
  }

  .panel-apps {
    grid-column: span 5;
  }
}

/* ============================================
   FULLSCREEN MODE
   ============================================ */
#screenPanel:fullscreen,
#screenPanel:-webkit-full-screen {
  background: rgba(13, 26, 24, 0.98);
  padding: 16px;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

#screenPanel:fullscreen .screen-frame,
#screenPanel:-webkit-full-screen .screen-frame {
  flex: 1;
  border-radius: var(--radius-lg);
}

#screenPanel:fullscreen .panel-header,
#screenPanel:-webkit-full-screen .panel-header {
  color: white;
}

#screenPanel:fullscreen .ghost-btn,
#screenPanel:-webkit-full-screen .ghost-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --plum-ink: #e8eef0;
    --plum-ink-light: #c5cdd2;
    --plum-muted: #8a919c;
    --plum-subtle: #5d646f;
    --plum-glass: rgba(30, 40, 48, 0.85);
    --plum-glass-strong: rgba(25, 32, 38, 0.95);
    --plum-glass-subtle: rgba(40, 50, 60, 0.7);
    --plum-glass-border: rgba(80, 90, 100, 0.4);
    --plum-glass-highlight: rgba(255, 255, 255, 0.08);
    --widget-fill: rgba(30, 40, 48, 0.88);
    --widget-border: rgba(80, 90, 100, 0.35);
  }

  body {
    background: linear-gradient(135deg, #0b1016, #101820);
  }

  body::before {
    background:
      radial-gradient(circle at 12% 12%, rgba(var(--plum-accent-rgb), 0.18), transparent 55%),
      radial-gradient(circle at 82% 18%, rgba(68, 129, 230, 0.15), transparent 52%),
      radial-gradient(circle at 70% 82%, rgba(255, 180, 100, 0.12), transparent 58%);
  }

  .backdrop-orb {
    opacity: 0.4;
  }

  input[type="text"],
  input[type="search"],
  textarea,
  select {
    background: rgba(40, 50, 60, 0.8);
    color: var(--plum-ink);
    border-color: var(--plum-glass-border);
  }

  .app-card {
    background: linear-gradient(140deg, rgba(40, 50, 60, 0.9), rgba(30, 40, 48, 0.85));
  }

  .file-item,
  .quick-access-item,
  .drive-item {
    background: rgba(40, 50, 60, 0.6);
  }

  .approval-card,
  .activity-card,
  .result-card,
  .status-card {
    background: rgba(40, 50, 60, 0.7);
  }

  .toggle-row {
    background: rgba(40, 50, 60, 0.6);
  }

  #notesInput {
    background: rgba(40, 50, 60, 0.6);
  }
}

/* ============================================
   PRINT STYLES (hide for print)
   ============================================ */
@media print {
  .remote-shell {
    display: none;
  }
}

/* ============================================
   NOTIFICATION CENTER
   ============================================ */
.notification-bell-container {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: var(--color-error);
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--plum-glass-strong);
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  /* Scale with viewport so notifications remain readable on small/short screens. */
  max-height: min(860px, 80vh);
  max-height: min(860px, 80dvh);
  background: var(--plum-glass-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--plum-shadow);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--plum-glass-border);
  font-weight: 600;
  color: var(--plum-ink);
}

.notification-header .btn-text {
  background: none;
  border: none;
  color: var(--plum-primary);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.notification-header .btn-text:hover {
  background: rgba(var(--plum-primary-rgb), 0.1);
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
}

.notification-empty {
  color: var(--plum-muted);
  text-align: center;
  padding: 32px 16px;
  font-size: 14px;
}

.clipboard-manager {
  position: relative;
}

.clipboard-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: var(--plum-primary);
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--plum-glass-strong);
}

.clipboard-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  /* Scale with viewport so clipboard entries remain readable on small/short screens. */
  max-height: min(860px, 80vh);
  max-height: min(860px, 80dvh);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.clipboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 700;
  font-size: 15px;
  color: #1a1a2e;
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(248,250,252,1));
}

.clipboard-header .btn-text {
  background: none;
  border: none;
  color: var(--plum-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.clipboard-header .btn-text:hover {
  background: rgba(var(--plum-primary-rgb), 0.12);
}

.clipboard-header .btn-text:disabled {
  opacity: 0.5;
  cursor: default;
}

.clipboard-search-row {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(248, 250, 252, 0.8);
}

.clipboard-search-row input {
  width: 100%;
  font-size: 14px;
  padding: 10px 14px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  color: #1a1a2e;
}

.clipboard-search-row input::placeholder {
  color: #8a919c;
}

.clipboard-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(248, 250, 252, 0.5);
  min-height: 0;
}

.clipboard-empty {
  color: #5d646f;
  text-align: center;
  padding: 32px 16px;
  font-size: 14px;
}

.clipboard-item {
  width: 100%;
  display: block;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  background: white;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.clipboard-item:hover {
  border-color: var(--plum-primary);
  background: white;
  box-shadow: 0 4px 12px rgba(var(--plum-primary-rgb), 0.12);
  transform: translateY(-1px);
}

.clipboard-item:active {
  transform: translateY(0);
}

.clipboard-item-title {
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 4px;
  font-size: 14px;
}

.clipboard-item-subtitle {
  color: #3d4852;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

.clipboard-item-meta {
  color: #8a919c;
  font-size: 11px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.clipboard-item-meta::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--plum-primary);
  border-radius: 50%;
  opacity: 0.6;
}

/* Dark mode clipboard */
@media (prefers-color-scheme: dark) {
  .clipboard-dropdown {
    background: rgba(25, 30, 40, 0.97);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  }

  .clipboard-header {
    color: #f0f4f8;
    background: linear-gradient(180deg, rgba(35, 40, 50, 1), rgba(28, 32, 42, 1));
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .clipboard-header .btn-text {
    color: var(--plum-accent);
  }

  .clipboard-header .btn-text:hover {
    background: rgba(var(--plum-accent-rgb), 0.15);
  }

  .clipboard-search-row {
    background: rgba(35, 40, 50, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  .clipboard-search-row input {
    background: rgba(50, 55, 70, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f0f4f8;
  }

  .clipboard-search-row input::placeholder {
    color: #6b7280;
  }

  .clipboard-list {
    background: rgba(20, 25, 35, 0.5);
  }

  .clipboard-empty {
    color: #9ca3af;
  }

  .clipboard-item {
    background: rgba(40, 45, 60, 0.9);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }

  .clipboard-item:hover {
    border-color: var(--plum-accent);
    background: rgba(50, 55, 70, 0.95);
    box-shadow: 0 4px 12px rgba(var(--plum-accent-rgb), 0.15);
  }

  .clipboard-item-title {
    color: #f0f4f8;
  }

  .clipboard-item-subtitle {
    color: #d1d5db;
  }

  .clipboard-item-meta {
    color: #9ca3af;
  }

  .clipboard-item-meta::before {
    background: var(--plum-accent);
  }
}

.notification-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--widget-fill);
  border: 1px solid var(--widget-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-card:hover {
  background: var(--plum-glass-subtle);
  border-color: var(--plum-primary-light);
}

.notification-card.unread {
  border-left: 3px solid var(--plum-primary);
}

.notification-card.urgency-critical {
  border-left-color: var(--color-error);
  background: rgba(179, 38, 30, 0.08);
}

.notification-card.urgency-warning {
  border-left-color: var(--color-warning);
  background: rgba(184, 121, 30, 0.08);
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--plum-glass-subtle);
}

.notification-icon svg {
  width: 18px;
  height: 18px;
  color: var(--plum-primary);
}

.notification-card.urgency-critical .notification-icon {
  background: rgba(179, 38, 30, 0.15);
}

.notification-card.urgency-critical .notification-icon svg {
  color: var(--color-error);
}

.notification-card.urgency-warning .notification-icon {
  background: rgba(184, 121, 30, 0.15);
}

.notification-card.urgency-warning .notification-icon svg {
  color: var(--color-warning);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--plum-ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-desc {
  font-size: 12px;
  color: var(--plum-muted);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  font-size: 11px;
  color: var(--plum-subtle);
}

.notification-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.notification-actions .action-btn {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--plum-glass-border);
  background: var(--plum-glass-subtle);
  color: var(--plum-ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-actions .action-btn:hover {
  background: var(--plum-primary);
  border-color: var(--plum-primary);
  color: white;
}

.notification-actions .action-btn.primary {
  background: var(--plum-primary);
  border-color: var(--plum-primary);
  color: white;
}

.notification-actions .action-btn.primary:hover {
  background: var(--plum-primary-dark);
}

.notification-actions .action-btn.destructive {
  color: var(--color-error);
  border-color: var(--color-error);
}

.notification-actions .action-btn.destructive:hover {
  background: var(--color-error);
  color: white;
}

.notification-dismiss {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--plum-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.notification-dismiss:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--plum-ink);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 16px;
  left: 16px;
  z-index: 2000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

@media (min-width: 600px) {
  .toast-container {
    left: auto;
    width: 380px;
  }
}

.toast {
  pointer-events: auto;
  width: 100%;
  background: var(--plum-glass-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--plum-glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--plum-shadow);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.toast-critical {
  border-left: 4px solid var(--color-error);
  background: rgba(179, 38, 30, 0.12);
}

.toast.toast-warning {
  border-left: 4px solid var(--color-warning);
  background: rgba(184, 121, 30, 0.12);
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--plum-glass-subtle);
}

.toast-icon svg {
  width: 16px;
  height: 16px;
  color: var(--plum-primary);
}

.toast.toast-critical .toast-icon {
  background: rgba(179, 38, 30, 0.2);
}

.toast.toast-critical .toast-icon svg {
  color: var(--color-error);
}

.toast.toast-warning .toast-icon {
  background: rgba(184, 121, 30, 0.2);
}

.toast.toast-warning .toast-icon svg {
  color: var(--color-warning);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--plum-ink);
  margin-bottom: 2px;
}

.toast-desc {
  font-size: 12px;
  color: var(--plum-muted);
}

.toast-dismiss {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--plum-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-dismiss:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--plum-ink);
}

.toast-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.toast-actions .action-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--plum-glass-border);
  background: var(--plum-glass-subtle);
  color: var(--plum-ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toast-actions .action-btn:hover {
  background: var(--plum-primary);
  border-color: var(--plum-primary);
  color: white;
}

.toast-actions .action-btn.primary {
  background: var(--plum-primary);
  border-color: var(--plum-primary);
  color: white;
}

/* Dark mode notification adjustments */
@media (prefers-color-scheme: dark) {
  .notification-card {
    background: rgba(40, 50, 60, 0.8);
  }

  .notification-card:hover {
    background: rgba(50, 60, 70, 0.9);
  }

  .notification-card.urgency-critical {
    background: rgba(179, 38, 30, 0.15);
  }

  .notification-card.urgency-warning {
    background: rgba(184, 121, 30, 0.15);
  }

  .toast {
    background: rgba(30, 40, 48, 0.95);
  }

  .toast.toast-critical {
    background: rgba(179, 38, 30, 0.2);
  }

  .toast.toast-warning {
    background: rgba(184, 121, 30, 0.2);
  }
}

/* ============================================
   MOBILE DROPDOWN OPTIMIZATION
   ============================================ */

/* Mobile dropdown backdrop */
.dropdown-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* For small screens, keep dropdowns on-screen (below header, above dock). */
@media (max-width: 480px) {
  .notification-dropdown,
  .clipboard-dropdown {
    position: fixed !important;
    /* Use near-full viewport height so long notifications are readable. */
    top: calc(var(--safe-top) + 10px) !important;
    bottom: calc(var(--safe-bottom) + 10px) !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 200px;
    border-radius: var(--radius-xl);
    animation: panelIn 0.22s var(--ease-out-cubic);
    transform: none !important;
    z-index: 10001 !important;
  }

  .notification-header,
  .clipboard-header {
    padding: 16px 20px;
    font-size: 16px;
  }

  .notification-list,
  .clipboard-list {
    padding: 12px 16px;
  }

  .notification-card {
    padding: 14px;
    margin-bottom: 10px;
  }

  .notification-icon {
    width: 40px;
    height: 40px;
  }

  .notification-title {
    font-size: 14px;
  }

  .notification-desc {
    font-size: 13px;
    -webkit-line-clamp: 6;
  }

  .clipboard-item {
    padding: 14px 16px;
  }

  .clipboard-item-title {
    font-size: 14px;
  }

  .clipboard-item-subtitle {
    font-size: 13px;
  }

  .clipboard-search-row {
    padding: 12px 16px;
  }

  .clipboard-search-row input {
    font-size: 14px;
    padding: 12px 14px;
  }

  /* No drag handle in "dropdown panel" mode. */
  .notification-dropdown::before,
  .clipboard-dropdown::before {
    display: none;
  }
}

/* Very small screens (iPhone SE, etc) */
@media (max-width: 375px) {
  .notification-dropdown,
  .clipboard-dropdown {
    left: 8px !important;
    right: 8px !important;
    top: calc(var(--safe-top) + 8px) !important;
    bottom: calc(var(--safe-bottom) + 8px) !important;
  }

  .notification-header,
  .clipboard-header {
    padding: 14px 16px;
    font-size: 15px;
  }

  .notification-card {
    padding: 12px;
    gap: 10px;
  }

  .notification-icon {
    width: 36px;
    height: 36px;
  }

  .clipboard-item {
    padding: 12px 14px;
  }
}

@keyframes slideUpSheet {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   TIMER UI
   ============================================ */
.timer-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: timerFadeIn 0.3s ease;
}

.timer-overlay.active {
  display: flex;
}

@keyframes timerFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.timer-big {
  animation: timerScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes timerScaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.timer-big-content {
  background: linear-gradient(145deg, rgba(var(--plum-primary-rgb), 0.95), rgba(24, 86, 78, 0.95));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 2px solid rgba(var(--plum-accent-rgb), 0.4);
  border-radius: 28px;
  padding: 40px 60px;
  text-align: center;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(var(--plum-accent-rgb), 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  min-width: 280px;
}

.timer-big-icon {
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.9);
  animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.timer-big-icon svg {
  filter: drop-shadow(0 0 20px rgba(var(--plum-accent-rgb), 0.5));
}

.timer-big-label {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.timer-big-time {
  font-size: 72px;
  font-weight: 700;
  color: white;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  line-height: 1;
  margin-bottom: 24px;
}

.timer-big-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.timer-btn-dismiss {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Timer completed state */
.timer-overlay.completed .timer-big-content {
  background: linear-gradient(145deg, rgba(var(--plum-accent-rgb), 0.95), rgba(var(--plum-primary-rgb), 0.95));
  animation: timerComplete 0.5s ease;
}

@keyframes timerComplete {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.timer-overlay.completed .timer-big-label::after {
  content: " Complete!";
  color: rgba(255, 255, 255, 1);
}

/* Timer Pills (minimized timers at top) */
.timer-pills {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.timer-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--plum-glass-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--plum-glass-border);
  border-radius: 24px;
  padding: 8px 16px;
  box-shadow: var(--plum-shadow);
  animation: timerPillSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-pill:hover {
  transform: scale(1.02);
  border-color: var(--plum-primary);
}

@keyframes timerPillSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timer-pill-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.timer-pill-icon svg {
  width: 14px;
  height: 14px;
}

.timer-pill-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timer-pill-label {
  font-size: 11px;
  color: var(--plum-muted);
  font-weight: 500;
}

.timer-pill-time {
  font-size: 16px;
  font-weight: 700;
  color: var(--plum-ink);
  font-variant-numeric: tabular-nums;
}

.timer-pill-dismiss {
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  color: var(--plum-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 4px;
}

.timer-pill-dismiss:hover {
  background: var(--color-error);
  color: white;
}

.timer-pill.completed {
  background: linear-gradient(135deg, rgba(var(--plum-accent-rgb), 0.2), rgba(var(--plum-primary-rgb), 0.2));
  border-color: var(--plum-primary);
  animation: timerPillComplete 0.5s ease;
}

@keyframes timerPillComplete {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.timer-pill.completed .timer-pill-label {
  color: var(--plum-primary);
}

.timer-pill.completed .timer-pill-time {
  color: var(--plum-primary);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .timer-big-content {
    padding: 32px 40px;
    min-width: 240px;
    border-radius: 20px;
  }

  .timer-big-time {
    font-size: 56px;
  }

  .timer-big-label {
    font-size: 14px;
  }

  .timer-pills {
    top: 70px;
  }

  .timer-pill {
    padding: 6px 12px;
  }

  .timer-pill-time {
    font-size: 14px;
  }
}

/* Dark mode timer adjustments */
@media (prefers-color-scheme: dark) {
  .timer-pill {
    background: rgba(30, 40, 48, 0.95);
  }

  .timer-pill-dismiss {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* ============================================
   MOBILE UI ENHANCEMENTS - Vibrant & Lively
   ============================================ */

/* Enhanced Color Palette */
:root {
  --gradient-sunset: linear-gradient(135deg, #ff6b6b, #feca57);
  --gradient-ocean: linear-gradient(135deg, #4facfe, #00f2fe);
  --gradient-aurora: linear-gradient(135deg, #43e97b, #38f9d7);
  --gradient-cosmic: linear-gradient(135deg, #a18cd1, #fbc2eb);
  --gradient-fire: linear-gradient(135deg, #f093fb, #f5576c);
  --gradient-forest: linear-gradient(135deg, #11998e, #38ef7d);
  --gradient-royal: linear-gradient(135deg, #667eea, #764ba2);
  --gradient-candy: linear-gradient(135deg, #ff9a9e, #fecfef);
}

/* ============================================
   ENHANCED WEATHER WIDGET - Super Interesting
   ============================================ */
.widget-weather {
  background: var(--plum-gradient-accent);
  border: none;
  position: relative;
  overflow: hidden;
  min-height: 140px;
}

.widget-weather::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  animation: weatherPulse 4s ease-in-out infinite;
}

.widget-weather::after {
  background: linear-gradient(180deg, rgba(255,255,255,0.2), transparent);
}

.widget-weather .widget-content {
  z-index: 2;
}

.widget-weather .weather-temp {
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  font-size: clamp(42px, 12vw, 56px);
  font-weight: 700;
}

.widget-weather .weather-unit {
  color: rgba(255,255,255,0.9);
  font-size: 20px;
}

.widget-weather .weather-condition {
  color: rgba(255,255,255,0.95);
  font-weight: 600;
  font-size: 15px;
}

.widget-weather .weather-hl,
.widget-weather .weather-location {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
}

.weather-graphic {
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
  width: 90px;
  height: 90px;
  animation: weatherFloat 3s ease-in-out infinite;
}

/* Weather condition themes */
.widget-weather.weather-sunny {
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.widget-weather.weather-cloudy {
  background: linear-gradient(135deg, #89c4f4 0%, #bdc3c7 100%);
}

.widget-weather.weather-rainy {
  background: linear-gradient(135deg, #4b79a1 0%, #283e51 100%);
}

.widget-weather.weather-night {
  background: linear-gradient(135deg, #2c3e50 0%, #4a00e0 100%);
}

@keyframes weatherPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

@keyframes weatherFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================
   STOCKS APP VIEW & WIDGET
   ============================================ */
.widget-stocks {
  background: linear-gradient(145deg, #0a1628, #132042);
  border: 1px solid rgba(46, 213, 115, 0.2);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.widget-stocks:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(46, 213, 115, 0.15);
}
.widget-stocks .stocks-widget-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.widget-stocks .stocks-widget-header svg {
  color: rgba(255,255,255,0.5);
}
.widget-stocks .stocks-widget-header span {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.3px;
}
.widget-stocks .stocks-widget-row {
  display: flex;
  align-items: center;
  padding: 4px 0;
  gap: 8px;
}
.widget-stocks .stocks-widget-symbol {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  min-width: 48px;
}
.widget-stocks .stocks-widget-sparkline {
  flex: 1;
  height: 20px;
}
.widget-stocks .stocks-widget-price {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
  font-variant-numeric: tabular-nums;
  min-width: 55px;
  text-align: right;
}
.widget-stocks .stocks-widget-change {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  min-width: 50px;
  text-align: center;
}
.widget-stocks .stocks-widget-change.positive {
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
}
.widget-stocks .stocks-widget-change.negative {
  background: rgba(255, 71, 87, 0.15);
  color: #ff4757;
}

/* Stocks App View */
.view-stocks {
  background: transparent;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.stocks-app {
  min-height: 100%;
  padding: 0 0 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.stocks-app-header {
  background: linear-gradient(135deg, #0a1628 0%, #132042 50%, #1a2f5a 100%);
  border-radius: 0 0 32px 32px;
  padding: 20px 24px 28px;
  position: relative;
  overflow: hidden;
}
.stocks-app-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(46, 213, 115, 0.08) 0%, transparent 50%);
  animation: weatherAuroraMove 15s linear infinite;
}
.stocks-back-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 2;
  transition: background 0.2s;
}
.stocks-back-btn:hover {
  background: rgba(255,255,255,0.2);
}
.stocks-hero {
  position: relative;
  z-index: 2;
  margin-top: 8px;
}
.stocks-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}
.stocks-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}
.stocks-market-summary {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  position: relative;
  z-index: 2;
  overflow-x: auto;
}
.stocks-market-card {
  flex: 1;
  min-width: 100px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stocks-market-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stocks-market-value {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.stocks-market-change {
  font-size: 12px;
  font-weight: 600;
}
.stocks-market-change.positive { color: #2ed573; }
.stocks-market-change.negative { color: #ff4757; }

/* Watchlist Section */
.stocks-watchlist-section {
  padding: 0 20px;
}
.stocks-watchlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stocks-watchlist-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #fff);
}
.stocks-add-btn {
  background: var(--glass-bg, rgba(255,255,255,0.1));
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-primary, #fff);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.stocks-add-btn:hover {
  background: rgba(255,255,255,0.2);
}
.stocks-watchlist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stocks-watchlist-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--glass-bg, rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  gap: 12px;
}
.stocks-watchlist-item:hover {
  background: rgba(255,255,255,0.1);
  transform: translateX(4px);
}
.stocks-watchlist-item .stocks-item-info {
  flex: 1;
  min-width: 0;
}
.stocks-watchlist-item .stocks-item-symbol {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #fff);
}
.stocks-watchlist-item .stocks-item-name {
  font-size: 12px;
  color: var(--text-secondary, rgba(255,255,255,0.5));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stocks-watchlist-item .stocks-item-sparkline {
  width: 60px;
  height: 24px;
}
.stocks-watchlist-item .stocks-item-price-group {
  text-align: right;
  min-width: 80px;
}
.stocks-watchlist-item .stocks-item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  font-variant-numeric: tabular-nums;
}
.stocks-watchlist-item .stocks-item-change {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}
.stocks-watchlist-item .stocks-item-change.positive {
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
}
.stocks-watchlist-item .stocks-item-change.negative {
  background: rgba(255, 71, 87, 0.15);
  color: #ff4757;
}

/* Stock Detail Panel */
.stocks-detail {
  padding: 0 20px;
  animation: stocksDetailIn 0.3s ease-out;
}
@keyframes stocksDetailIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.stocks-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.stocks-detail-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stocks-detail-symbol {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary, #fff);
}
.stocks-detail-name {
  font-size: 13px;
  color: var(--text-secondary, rgba(255,255,255,0.5));
}
.stocks-detail-price-group {
  text-align: right;
}
.stocks-detail-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  font-variant-numeric: tabular-nums;
}
.stocks-detail-change {
  font-size: 14px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 4px;
}
.stocks-detail-change.positive {
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
}
.stocks-detail-change.negative {
  background: rgba(255, 71, 87, 0.15);
  color: #ff4757;
}

/* Chart */
.stocks-chart-container {
  background: var(--glass-bg, rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.stocks-chart-container canvas {
  width: 100%;
  height: 200px;
}
.stocks-period-selector {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}
.stocks-period-btn {
  background: var(--glass-bg, rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary, rgba(255,255,255,0.6));
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.stocks-period-btn:hover {
  background: rgba(255,255,255,0.12);
}
.stocks-period-btn.active {
  background: rgba(46, 213, 115, 0.2);
  border-color: rgba(46, 213, 115, 0.4);
  color: #2ed573;
}

/* Stats Grid */
.stocks-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.stocks-stat-card {
  background: var(--glass-bg, rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
}
.stocks-stat-card .stocks-stat-label {
  font-size: 11px;
  color: var(--text-secondary, rgba(255,255,255,0.5));
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.stocks-stat-card .stocks-stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* About Section */
.stocks-about {
  background: var(--glass-bg, rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.stocks-about h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin-bottom: 8px;
}
.stocks-about p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary, rgba(255,255,255,0.6));
}

/* Remove Button */
.stocks-remove-btn {
  width: 100%;
  padding: 12px;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.2);
  color: #ff4757;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.stocks-remove-btn:hover {
  background: rgba(255, 71, 87, 0.2);
}

/* Search Overlay */
.stocks-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: stocksSearchIn 0.25s ease-out;
}
@keyframes stocksSearchIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.stocks-search-panel {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}
.stocks-search-header {
  display: flex;
  gap: 10px;
  align-items: center;
}
.stocks-search-header input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  color: #fff;
  outline: none;
}
.stocks-search-header input::placeholder {
  color: rgba(255,255,255,0.4);
}
.stocks-search-header input:focus {
  border-color: rgba(46, 213, 115, 0.5);
}
.stocks-search-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
}
.stocks-search-close-btn:hover {
  color: #fff;
}
.stocks-search-results {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stocks-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.stocks-search-result:hover {
  background: rgba(255,255,255,0.12);
}
.stocks-search-result .search-result-info {
  display: flex;
  flex-direction: column;
}
.stocks-search-result .search-result-symbol {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.stocks-search-result .search-result-name {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.stocks-search-result .search-result-price {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   ENHANCED CLOCK WIDGET
   ============================================ */
.widget-clock {
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border: 1px solid rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.widget-clock::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(102, 126, 234, 0.15), transparent 70%);
  animation: clockGlow 3s ease-in-out infinite;
}

.widget-clock::after {
  background: none;
}

#clockCanvas {
  filter: drop-shadow(0 0 12px rgba(102, 126, 234, 0.4));
}

.clock-digital {
  color: rgba(255,255,255,0.9);
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

@keyframes clockGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* ============================================
   ENHANCED STATS WIDGET
   ============================================ */
.widget-stats {
  background: linear-gradient(145deg, rgba(var(--plum-primary-rgb), 0.15), rgba(var(--plum-secondary-rgb), 0.1));
  border: 1px solid rgba(var(--plum-primary-rgb), 0.3);
  backdrop-filter: blur(20px);
}

.stat-row {
  gap: 14px;
}

.stat-item {
  padding: 8px 0;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--plum-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 40px;
}

.stat-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.stat-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--plum-gradient);
  position: relative;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
  border-radius: 4px 4px 0 0;
}

.stat-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--plum-primary-dark);
  width: 42px;
}

/* CPU high usage warning */
.stat-fill.high-usage {
  background: var(--gradient-fire);
  animation: usageWarning 1s ease-in-out infinite;
}

@keyframes usageWarning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============================================
   ENHANCED MUSIC WIDGET
   ============================================ */
.widget-music {
  background: linear-gradient(145deg, #1e1e2f, #2d1f3d);
  border: 1px solid rgba(161, 140, 209, 0.3);
  position: relative;
  overflow: hidden;
}

.widget-music::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(161, 140, 209, 0.1),
    transparent,
    rgba(251, 194, 235, 0.1),
    transparent
  );
  animation: musicAmbient 8s linear infinite;
}

.widget-music::after {
  background: none;
}

@keyframes musicAmbient {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.music-info {
  position: relative;
  z-index: 1;
}

.music-art {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--gradient-cosmic);
  box-shadow: 0 4px 20px rgba(161, 140, 209, 0.4);
  animation: albumPulse 2s ease-in-out infinite;
}

.music-art.playing {
  animation: albumSpin 4s linear infinite;
}

@keyframes albumPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(161, 140, 209, 0.4); }
  50% { box-shadow: 0 6px 30px rgba(251, 194, 235, 0.5); }
}

@keyframes albumSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.music-title {
  color: white;
  font-size: 15px;
  font-weight: 600;
}

.music-artist {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}

.music-controls {
  position: relative;
  z-index: 1;
  gap: 20px;
}

.music-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  transition: all 0.2s ease;
}

.music-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

.music-btn:active {
  transform: scale(0.95);
}

.music-btn-play {
  width: 52px;
  height: 52px;
  background: var(--gradient-cosmic);
  border: none;
  box-shadow: 0 4px 20px rgba(161, 140, 209, 0.5);
}

.music-btn-play:hover {
  box-shadow: 0 6px 25px rgba(161, 140, 209, 0.6);
}

/* ============================================
   REDESIGNED DOCK - Clean & Modern
   ============================================ */
.dock {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  margin: 10px 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.12),
    0 2px 10px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.dock-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 56px;
  height: 56px;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 16px;
  color: var(--plum-muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.dock-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: transparent;
  transition: all 0.25s ease;
}

.dock-item:hover {
  transform: translateY(-4px) scale(1.08);
}

.dock-item:hover::before {
  background: rgba(0, 0, 0, 0.05);
}

.dock-item:active {
  transform: translateY(-2px) scale(1.02);
}

.dock-item.active {
  background: transparent;
  color: var(--plum-primary);
}

.dock-item.active::before {
  background: linear-gradient(145deg, rgba(var(--plum-primary-rgb), 0.15), rgba(var(--plum-secondary-rgb), 0.1));
  box-shadow: 0 4px 15px rgba(var(--plum-primary-rgb), 0.2);
}

.dock-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--plum-primary);
  box-shadow: 0 0 8px var(--plum-primary);
}

.dock-item svg {
  width: 24px;
  height: 24px;
  transition: all 0.25s ease;
  stroke-width: 1.8;
}

.dock-item:hover svg {
  transform: scale(1.1);
}

.dock-item.active svg {
  filter: drop-shadow(0 2px 4px rgba(var(--plum-primary-rgb), 0.3));
}

.dock-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
  opacity: 0.9;
  transition: all 0.2s ease;
}

.dock-item:hover .dock-label {
  opacity: 1;
}

/* Dock Launcher special styling */
.dock-item.launcher {
  background: linear-gradient(145deg, rgba(0, 255, 209, 0.1), rgba(176, 136, 255, 0.1));
}

.dock-item.launcher svg {
  color: #00d4b8;
}

.dock-item.launcher:hover {
  transform: translateY(-6px) scale(1.12);
}

.dock-item.launcher:hover::before {
  background: linear-gradient(145deg, rgba(0, 255, 209, 0.2), rgba(176, 136, 255, 0.15));
  box-shadow:
    0 0 20px rgba(0, 255, 209, 0.3),
    0 0 40px rgba(176, 136, 255, 0.2);
}

/* ============================================
   REDESIGNED SETTINGS SHEET
   ============================================ */
.sheet {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  border-radius: 28px 28px 0 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 -20px 60px rgba(0, 0, 0, 0.15),
    0 -5px 20px rgba(0, 0, 0, 0.08);
  padding: 0 20px 24px;
  max-height: 88vh;
}

.sheet-handle {
  width: 40px;
  height: 5px;
  background: linear-gradient(90deg, rgba(0,0,0,0.15), rgba(0,0,0,0.25), rgba(0,0,0,0.15));
  border-radius: 3px;
  margin: 14px auto 20px;
}

.sheet-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--plum-ink);
  margin-bottom: 20px;
  text-align: center;
}

.settings-group {
  margin-bottom: 24px;
}

.settings-group h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--plum-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-group h4::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--plum-gradient);
  border-radius: 2px;
}

.settings-info {
  padding: 16px;
  background: linear-gradient(135deg, rgba(var(--plum-primary-rgb), 0.08), rgba(var(--plum-secondary-rgb), 0.05));
  border-radius: 16px;
  border: 1px solid rgba(var(--plum-primary-rgb), 0.15);
  font-size: 13px;
  line-height: 1.7;
  color: var(--plum-ink-light);
}

.settings-info p {
  margin: 0;
  padding: 4px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.settings-info p::before {
  content: 'âœ“';
  color: var(--plum-primary);
  font-weight: bold;
  flex-shrink: 0;
}

/* Subscription Card in Settings */
.subscription-card {
  background: linear-gradient(135deg, rgba(var(--plum-primary-rgb), 0.08), rgba(var(--plum-secondary-rgb), 0.05));
  border: 1px solid rgba(var(--plum-primary-rgb), 0.2);
  border-radius: 16px;
  padding: 16px;
}

.subscription-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.subscription-plan-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--plum-ink);
}

.subscription-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--color-success);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subscription-badge.premium {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.subscription-badge.canceled {
  background: var(--color-warning);
}

.subscription-usage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.subscription-usage-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subscription-usage-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--plum-muted);
}

.subscription-usage-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.subscription-usage-fill {
  height: 100%;
  background: var(--plum-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.subscription-usage-fill.warning {
  background: var(--color-warning);
}

.subscription-usage-fill.danger {
  background: var(--color-error);
}

.subscription-usage-fill.unlimited {
  background: linear-gradient(90deg, var(--plum-primary), var(--plum-secondary));
  width: 100% !important;
}

.subscription-actions {
  display: flex;
  gap: 8px;
}

.subscription-upgrade-btn {
  flex: 1;
  display: block;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  text-decoration: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.subscription-upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.subscription-manage-btn {
  flex: 1;
  display: block;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid rgba(var(--plum-primary-rgb), 0.3);
  color: var(--plum-primary);
  text-decoration: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.subscription-manage-btn:hover {
  background: rgba(var(--plum-primary-rgb), 0.05);
  border-color: var(--plum-primary);
}

/* Limit Exceeded Modal */
.limit-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.limit-modal {
  background: var(--plum-glass-strong);
  border-radius: 24px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--plum-shadow);
}

.limit-modal-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.limit-modal-icon svg {
  width: 32px;
  height: 32px;
  color: white;
}

.limit-modal h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--plum-ink);
}

.limit-modal p {
  font-size: 14px;
  color: var(--plum-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.limit-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.limit-modal-upgrade {
  padding: 14px 24px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.limit-modal-upgrade:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.limit-modal-dismiss {
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: var(--plum-muted);
  font-size: 14px;
  cursor: pointer;
}

.limit-modal-dismiss:hover {
  color: var(--plum-ink);
}

/* Theme Selector in Settings */
.theme-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.theme-option {
  aspect-ratio: 1;
  border-radius: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.theme-option::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  opacity: 0;
  background: rgba(255,255,255,0.3);
  transition: opacity 0.2s ease;
}

.theme-option:hover::after {
  opacity: 1;
}

.theme-option.active {
  border-color: var(--plum-primary);
  box-shadow: 0 0 0 3px rgba(var(--plum-primary-rgb), 0.2);
  transform: scale(1.05);
}

.theme-option.active::before {
  content: 'âœ“';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--plum-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  z-index: 1;
}

.theme-option[data-theme="aurora"] { background: linear-gradient(135deg, #f4f0ea, #e5f0ea); }
.theme-option[data-theme="zen-garden"] { background: linear-gradient(135deg, #e8f5e9, #b2dfdb); }
.theme-option[data-theme="ocean-depths"] { background: linear-gradient(135deg, #e3f2fd, #bbdefb); }
.theme-option[data-theme="northern-lights"] { background: linear-gradient(135deg, #e8f5e9, #f3e5f5); }
.theme-option[data-theme="cosmic-nebula"] { background: linear-gradient(135deg, #f3e5f5, #fce4ec); }
.theme-option[data-theme="sunset-glow"] { background: linear-gradient(135deg, #fff3e0, #ffccbc); }
.theme-option[data-theme="fireflies"] { background: linear-gradient(135deg, #f1f8e9, #fffde7); }
.theme-option[data-theme="soft-mist"] { background: linear-gradient(135deg, #f5f5f5, #eeeeee); }

/* Enhanced Toggle Row */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.toggle-row:hover {
  border-color: rgba(var(--plum-primary-rgb), 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.toggle-row:active {
  transform: scale(0.99);
}

.toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--plum-ink);
}

.toggle-note {
  font-size: 12px;
  color: var(--plum-muted);
  margin-top: 2px;
}

/* Modern Toggle Switch */
.toggle-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 48px;
  height: 28px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.toggle-row input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 11px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle-row input[type="checkbox"]:checked {
  background: var(--plum-gradient);
}

.toggle-row input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

/* Enhanced Settings List Items */
.settings-list {
  gap: 10px;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.settings-item:hover {
  border-color: rgba(var(--plum-primary-rgb), 0.15);
  transform: translateX(2px);
}

.settings-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(var(--plum-primary-rgb), 0.1), rgba(var(--plum-secondary-rgb), 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--plum-primary);
  flex-shrink: 0;
}

.settings-item-icon svg {
  width: 18px;
  height: 18px;
}

.settings-item-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--plum-ink);
}

.settings-item-actions {
  gap: 8px;
}

.settings-move-btn {
  min-width: 38px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, white, #f8f9fa);
  color: var(--plum-ink-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-move-btn:hover {
  border-color: var(--plum-primary);
  color: var(--plum-primary);
  transform: translateY(-1px);
}

.settings-move-btn:active {
  transform: translateY(0);
}

/* Primary Button Enhancement */
.btn-primary {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: var(--plum-gradient);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(var(--plum-primary-rgb), 0.3);
  transition: all 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(var(--plum-primary-rgb), 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Ghost Button Enhancement */
.settings-group .ghost-btn {
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--plum-muted);
  background: transparent;
  border: 1px dashed rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-group .ghost-btn:hover {
  border-color: var(--plum-primary);
  border-style: solid;
  color: var(--plum-primary);
  background: rgba(var(--plum-primary-rgb), 0.05);
}

/* ============================================
   MOBILE DOCK OPTIMIZATIONS
   ============================================ */
@media (max-width: 480px) {
  .dock {
    margin: 8px 12px;
    padding: 8px 10px;
    gap: 3px;
    border-radius: 20px;
  }

  .dock-item {
    width: 47px;
    height: 47px;
    padding: 5px;
    border-radius: 14px;
  }

  .dock-item svg {
    width: 21px;
    height: 21px;
  }

  .dock-label {
    font-size: 8px;
  }

  .dock-item.active::after {
    width: 4px;
    height: 4px;
    bottom: 1px;
  }

  /* Weather widget mobile */
  .widget-weather {
    min-height: 120px;
  }

  .widget-weather .weather-temp {
    font-size: clamp(36px, 10vw, 48px);
  }

  .weather-graphic {
    width: 70px;
    height: 70px;
  }

  /* Settings mobile */
  .sheet {
    border-radius: 24px 24px 0 0;
    padding: 0 16px 20px;
  }

  .sheet-content h3 {
    font-size: 20px;
  }

  .theme-selector {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .settings-item {
    padding: 12px 14px;
  }
}

@media (max-width: 375px) {
  .dock {
    margin: 6px 8px;
    padding: 6px 8px;
    gap: 2px;
  }

  .dock-item {
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: 12px;
  }

  .dock-item svg {
    width: 20px;
    height: 20px;
  }

  .dock-label {
    font-size: 7px;
  }
}

/* ============================================
   TABLET/IPAD DOCK OPTIMIZATIONS
   ============================================ */
@media (min-width: 600px) {
  .dock {
    margin: 12px auto;
    padding: 10px 20px;
    max-width: 560px;
    gap: 6px;
    border-radius: 26px;
  }

  .dock-item {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .dock-item svg {
    width: 26px;
    height: 26px;
  }

  .dock-label {
    font-size: 10px;
  }

  /* Weather widget tablet */
  .widget-weather {
    min-height: 150px;
  }

  .weather-graphic {
    width: 100px;
    height: 100px;
  }

  /* Settings tablet */
  .sheet {
    max-width: 500px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border-radius: 28px 28px 0 0;
  }

  .sheet:not([hidden]) {
    transform: translateX(-50%) translateY(0);
  }

  .theme-selector {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

/* ============================================
   DARK MODE ENHANCEMENTS
   ============================================ */
@media (prefers-color-scheme: dark) {
  /* Dock dark mode */
  .dock {
    background: rgba(30, 35, 45, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
      0 10px 40px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .dock-item {
    color: rgba(255, 255, 255, 0.6);
  }

  .dock-item:hover {
    color: white;
  }

  .dock-item:hover::before {
    background: rgba(255, 255, 255, 0.1);
  }

  .dock-item.active {
    color: var(--plum-accent);
  }

  .dock-item.active::before {
    background: linear-gradient(145deg, rgba(var(--plum-accent-rgb), 0.2), rgba(var(--plum-secondary-rgb), 0.15));
  }

  .dock-item.active::after {
    background: var(--plum-accent);
    box-shadow: 0 0 10px var(--plum-accent);
  }

  /* Settings dark mode */
  .sheet {
    background: linear-gradient(180deg, rgba(30, 35, 45, 0.98), rgba(20, 25, 32, 0.98));
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .sheet-content h3 {
    color: white;
  }

  .settings-group h4 {
    color: var(--plum-accent);
  }

  .settings-info {
    background: linear-gradient(135deg, rgba(var(--plum-accent-rgb), 0.1), rgba(var(--plum-secondary-rgb), 0.05));
    border-color: rgba(var(--plum-accent-rgb), 0.2);
    color: rgba(255, 255, 255, 0.8);
  }

  .toggle-row,
  .settings-item {
    background: rgba(40, 50, 60, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .toggle-label,
  .settings-item-label {
    color: white;
  }

  .toggle-row input[type="checkbox"] {
    background: rgba(255, 255, 255, 0.15);
  }

  .settings-move-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
  }

  .settings-move-btn:hover {
    border-color: var(--plum-accent);
    color: var(--plum-accent);
  }

  .btn-primary {
    box-shadow: 0 4px 20px rgba(var(--plum-accent-rgb), 0.3);
  }

  .settings-group .ghost-btn {
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .settings-group .ghost-btn:hover {
    border-color: var(--plum-accent);
    color: var(--plum-accent);
    background: rgba(var(--plum-accent-rgb), 0.1);
  }

  /* Theme options dark mode */
  .theme-option.active {
    border-color: var(--plum-accent);
    box-shadow: 0 0 0 3px rgba(var(--plum-accent-rgb), 0.3);
  }

  .theme-option.active::before {
    background: var(--plum-accent);
  }

  /* Clock widget dark mode enhancement */
  .widget-clock {
    background: linear-gradient(145deg, #0a0a14, #12121e);
    border-color: rgba(102, 126, 234, 0.4);
  }

  /* Stats widget dark mode */
  .widget-stats {
    background: linear-gradient(145deg, rgba(var(--plum-primary-rgb), 0.2), rgba(var(--plum-secondary-rgb), 0.1));
    border-color: rgba(var(--plum-secondary-rgb), 0.3);
  }
}

/* ============================================
   WEATHER APP VIEW - Full Screen Experience
   ============================================ */
.view-weather {
  background: transparent;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.weather-app {
  min-height: 100%;
  padding: 0 0 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Weather App Header - Hero Section */
.weather-app-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  border-radius: 0 0 32px 32px;
  padding: 20px 24px 28px;
  position: relative;
  overflow: hidden;
  animation: weatherHeaderShimmer 8s ease-in-out infinite;
}

.weather-app-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 50%);
  animation: weatherAuroraMove 15s linear infinite;
}

.weather-app-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.1), transparent);
  pointer-events: none;
}

@keyframes weatherHeaderShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes weatherAuroraMove {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.weather-back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

.weather-back-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.1);
}

.weather-back-btn:active {
  transform: scale(0.95);
}

/* Weather Hero Section */
.weather-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px 0 24px;
  position: relative;
  z-index: 1;
}

.weather-hero-graphic {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  animation: weatherHeroFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.2));
}

.weather-hero-graphic svg {
  width: 100%;
  height: 100%;
}

@keyframes weatherHeroFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.02); }
}

.weather-hero-info {
  text-align: left;
  color: white;
}

.weather-hero-temp {
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: weatherTempPulse 3s ease-in-out infinite;
}

@keyframes weatherTempPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.9; }
}

.weather-hero-unit {
  font-size: 32px;
  font-weight: 400;
  opacity: 0.9;
  vertical-align: super;
  margin-left: 4px;
}

.weather-hero-condition {
  font-size: 20px;
  font-weight: 600;
  margin-top: 4px;
  opacity: 0.95;
}

.weather-hero-location {
  font-size: 14px;
  opacity: 0.8;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.weather-hero-location::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
}

.weather-hero-hl {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 500;
}

.weather-hero-high {
  color: rgba(255,255,255,0.95);
}

.weather-hero-low {
  color: rgba(255,255,255,0.75);
}

/* Weather Detail Cards in Header */
.weather-hero-details {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

.weather-detail-card {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}

.weather-detail-card:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

.weather-detail-card svg {
  color: rgba(255,255,255,0.9);
}

.weather-detail-label {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.weather-detail-value {
  font-size: 15px;
  font-weight: 600;
  color: white;
}

/* Weather Sections */
.weather-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  margin: 0 16px;
  padding: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  animation: weatherSectionIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.weather-section:nth-child(2) { animation-delay: 0.1s; }
.weather-section:nth-child(3) { animation-delay: 0.2s; }
.weather-section:nth-child(4) { animation-delay: 0.3s; }

@keyframes weatherSectionIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.weather-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.weather-section-title svg {
  color: var(--plum-accent);
}

/* Hourly Forecast */
.weather-hourly-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -20px;
  padding: 0 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
}

.weather-hourly-scroll.dragging {
  cursor: grabbing;
}

.weather-hourly-scroll::-webkit-scrollbar {
  display: none;
}

.weather-hourly-list {
  display: flex;
  gap: 12px;
  padding: 4px 0;
}

.weather-hourly-item {
  flex-shrink: 0;
  width: 72px;
  padding: 16px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  cursor: default;
}

.weather-hourly-item:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.weather-hourly-item.current {
  background: linear-gradient(180deg, var(--plum-accent) 0%, var(--plum-secondary) 100%);
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(var(--plum-accent-rgb), 0.3);
}

.weather-hourly-item.current .weather-hourly-time,
.weather-hourly-item.current .weather-hourly-temp {
  color: white;
}

.weather-hourly-time {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.weather-hourly-icon {
  width: 36px;
  height: 36px;
  animation: weatherIconBounce 2s ease-in-out infinite;
}

.weather-hourly-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes weatherIconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.weather-hourly-temp {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.weather-hourly-precip {
  font-size: 11px;
  color: #60a5fa;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Daily Forecast */
.weather-daily-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weather-daily-item {
  display: grid;
  grid-template-columns: 90px 48px 1fr 60px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.3s ease;
}

.weather-daily-item:hover {
  background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 100%);
  transform: translateX(4px);
}

.weather-daily-item.today {
  background: linear-gradient(90deg, rgba(var(--plum-accent-rgb), 0.15) 0%, transparent 100%);
  border-color: rgba(var(--plum-accent-rgb), 0.3);
}

.weather-daily-day {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.weather-daily-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.weather-daily-icon {
  width: 40px;
  height: 40px;
}

.weather-daily-icon svg {
  width: 100%;
  height: 100%;
}

.weather-daily-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.weather-daily-bar-fill {
  position: absolute;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #60a5fa, #f472b6);
  transition: all 0.5s ease;
}

.weather-daily-temps {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.weather-daily-high {
  font-weight: 600;
  color: var(--text-primary);
}

.weather-daily-low {
  color: var(--text-muted);
}

/* Sun & Moon Section */
.weather-sun-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.weather-sun-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border-radius: 20px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

.weather-sun-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.weather-sun-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-sun-icon.sunrise {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4);
  animation: sunriseGlow 2s ease-in-out infinite;
}

.weather-sun-icon.sunset {
  background: linear-gradient(135deg, #f97316 0%, #dc2626 100%);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
  animation: sunsetGlow 2s ease-in-out infinite;
}

@keyframes sunriseGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4); }
  50% { box-shadow: 0 12px 36px rgba(251, 191, 36, 0.6); }
}

@keyframes sunsetGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4); }
  50% { box-shadow: 0 12px 36px rgba(249, 115, 22, 0.6); }
}

.weather-sun-icon svg {
  color: white;
}

.weather-sun-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.weather-sun-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Weather Condition Themes for Header */
.weather-app-header.weather-clear {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 50%, #ea580c 100%);
}

.weather-app-header.weather-cloudy {
  background: linear-gradient(135deg, #64748b 0%, #475569 50%, #334155 100%);
}

.weather-app-header.weather-rain {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 50%, #1e3a8a 100%);
}

.weather-app-header.weather-snow {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%);
}

.weather-app-header.weather-storm {
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
}

.weather-app-header.weather-night {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}

/* Clickable Weather Widget */
.widget-weather {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.widget-weather:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.widget-weather:active {
  transform: scale(0.98);
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .weather-hero {
    flex-direction: column;
    text-align: center;
  }

  .weather-hero-info {
    text-align: center;
  }

  .weather-hero-temp {
    font-size: 56px;
  }

  .weather-hero-details {
    grid-template-columns: repeat(2, 1fr);
  }

  .weather-daily-item {
    grid-template-columns: 80px 40px 1fr 50px;
    padding: 12px;
  }

  .weather-sun-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .weather-app-header {
    padding: 16px 16px 24px;
  }

  .weather-hero-graphic {
    width: 90px;
    height: 90px;
  }

  .weather-hero-temp {
    font-size: 48px;
  }

  .weather-hourly-item {
    width: 64px;
    padding: 12px 10px;
  }
}

/* ============================================
   RESOURCES APP VIEW - Task Manager
   ============================================ */
.view-resources {
  background: transparent;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.resources-app {
  min-height: 100%;
  padding: 0 0 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.resources-header {
  background: linear-gradient(135deg, #0f172a 0%, #0ea5e9 45%, #22d3ee 75%);
  background-size: 180% 180%;
  border-radius: 0 0 32px 32px;
  padding: 20px 24px 26px;
  position: relative;
  overflow: hidden;
  animation: resourcesHeaderGlow 10s ease-in-out infinite;
}

.resources-header::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 140%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 55%);
  opacity: 0.85;
}

.resources-header::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
  pointer-events: none;
}

@keyframes resourcesHeaderGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.resources-back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 2;
}

.resources-back-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.05);
}

.resources-back-btn:active {
  transform: scale(0.95);
}

.resources-hero {
  position: relative;
  z-index: 1;
  color: white;
  text-align: left;
  padding-top: 6px;
}

.resources-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.resources-subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 4px;
}

.resources-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

.resources-summary-card {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 18px;
  padding: 14px 12px;
  color: white;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
}

.resources-summary-card:hover {
  background: rgba(255,255,255,0.24);
  transform: translateY(-2px);
}

.resources-summary-card:active {
  transform: translateY(1px);
}

.resources-summary-card.disabled {
  opacity: 0.6;
  cursor: default;
}

.resources-summary-label {
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.7;
}

.resources-summary-value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
}

.resources-summary-name {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resources-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
}

.resources-sort {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.resources-sort-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.resources-sort-btn.active {
  background: linear-gradient(135deg, var(--plum-accent), var(--plum-secondary));
  color: white;
  box-shadow: 0 8px 18px rgba(var(--plum-accent-rgb), 0.25);
}

.resources-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px;
}

.resources-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.resources-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}

.resources-item.selected {
  border-color: rgba(var(--plum-accent-rgb), 0.6);
  box-shadow: 0 16px 34px rgba(var(--plum-accent-rgb), 0.2);
}

.resources-item.pinned {
  border-color: rgba(14, 165, 233, 0.45);
}

.resources-item-main {
  min-width: 0;
  flex: 1;
}

.resources-item-name {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resources-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.resources-item-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.resources-chip {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

.resources-chip.cpu {
  background: rgba(14, 165, 233, 0.18);
  color: #bae6fd;
}

.resources-chip.ram {
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}

.resources-chip.gpu {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.resources-chip.disabled {
  opacity: 0.55;
}

.resources-detail {
  margin: 0 16px;
  position: sticky;
  top: 12px;
  z-index: 2;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(var(--plum-accent-rgb), 0.12), rgba(14,165,233,0.12));
  border: 1px solid rgba(var(--plum-accent-rgb), 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.resources-detail-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.resources-detail-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.resources-kill-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 10px 20px rgba(239,68,68,0.25);
  cursor: pointer;
  transition: all 0.2s ease;
}

.resources-kill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(239,68,68,0.3);
}

.resources-kill-btn:active {
  transform: translateY(1px);
}

@media (max-width: 600px) {
  .resources-summary {
    grid-template-columns: 1fr;
  }

  .resources-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .resources-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .resources-item-metrics {
    flex-direction: row;
    align-items: center;
  }

  .resources-detail {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   MESSAGING & VOICE CALL STYLES
   ============================================ */

/* Messages Container - Split Pane */
.messages-container {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.messages-sidebar {
  width: 320px;
  min-width: 280px;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.15);
}

.messages-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.messages-sidebar-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.messages-search-row {
  padding: 8px 12px;
}

.messages-search-row input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: inherit;
  font-size: 0.85rem;
  outline: none;
}

.messages-search-row input:focus {
  border-color: var(--accent);
}

/* Conversation List */
.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.conversation-item:hover {
  background: rgba(255,255,255,0.04);
}

.conversation-item.active {
  background: rgba(255,255,255,0.08);
  border-left-color: var(--accent);
}

.conversation-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-primary-light));
  overflow: hidden;
  position: relative;
}

.conversation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.conversation-avatar .status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.5);
  background: #666;
}

.conversation-avatar .status-dot.online { background: #4ade80; }
.conversation-avatar .status-dot.away { background: #fbbf24; }
.conversation-avatar .status-dot.offline { background: #666; }

.conversation-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conversation-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-preview {
  font-size: 0.8rem;
  opacity: 0.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.conversation-time {
  font-size: 0.7rem;
  opacity: 0.4;
}

.conversation-unread {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.conversation-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 8px;
  opacity: 0.4;
  text-align: center;
}

.conversation-empty-sub {
  font-size: 0.8rem;
}

/* Chat Area */
.messages-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.messages-chat-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
  opacity: 0.3;
}

/* Chat Header */
.messages-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.1);
}

.messages-back-btn {
  display: none;
}

.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-primary-light));
  overflow: hidden;
  flex-shrink: 0;
}

.chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-header-info {
  flex: 1;
  min-width: 0;
}

.chat-header-name {
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
}

.chat-header-status {
  font-size: 0.75rem;
  opacity: 0.5;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
}

/* Messages List */
.messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  position: relative;
  word-wrap: break-word;
}

.message-bubble.sent {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message-bubble.received {
  align-self: flex-start;
  background: rgba(255,255,255,0.08);
  border-bottom-left-radius: 4px;
}

.message-sender {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
  opacity: 0.7;
}

.message-text {
  white-space: pre-wrap;
}

.message-time {
  font-size: 0.65rem;
  opacity: 0.5;
  margin-top: 4px;
  text-align: right;
}

.message-date-separator {
  text-align: center;
  padding: 16px 0 8px;
  font-size: 0.75rem;
  opacity: 0.4;
  font-weight: 500;
}

/* Message attachments */
.message-attachment {
  margin-top: 6px;
}

.message-attachment img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  cursor: pointer;
}

.message-attachment-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.message-attachment-file:hover {
  background: rgba(0,0,0,0.25);
}

.message-attachment-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;
}

.message-attachment-size {
  font-size: 0.7rem;
  opacity: 0.5;
  flex-shrink: 0;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 8px;
  font-size: 0.8rem;
  opacity: 0.5;
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* Message Input Area */
.messages-input-area {
  padding: 8px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.1);
}

.messages-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.messages-input-row textarea {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: inherit;
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 120px;
  min-height: 40px;
  line-height: 1.4;
}

.messages-input-row textarea:focus {
  border-color: var(--accent);
}

.messages-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.messages-send-btn:hover {
  filter: brightness(1.15);
}

.messages-send-btn:active {
  transform: scale(0.92);
}

/* Attachment Preview */
.messages-attachment-preview {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  flex-wrap: wrap;
}

.attachment-preview-item {
  position: relative;
  padding: 6px 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.attachment-preview-remove {
  cursor: pointer;
  opacity: 0.5;
  width: 16px;
  height: 16px;
}

.attachment-preview-remove:hover { opacity: 1; }

/* Friend Request Badge */
.friend-request-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}

/* Dock Chat Badge */
.messages-unread-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 14px;
  text-align: center;
}

/* Friends Sheet */
.friends-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.friends-search-row input {
  flex: 1;
}

.friends-search-results,
.friends-request-list,
.friends-list-full {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  min-height: 40px;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
}

.friend-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-primary-light));
  overflow: hidden;
  flex-shrink: 0;
}

.friend-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-item-info {
  flex: 1;
  min-width: 0;
}

.friend-item-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.friend-item-email {
  font-size: 0.75rem;
  opacity: 0.5;
}

.friend-item-actions {
  display: flex;
  gap: 6px;
}

.friend-item-actions button {
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
}

.friend-accept-btn {
  background: var(--accent);
  color: #fff;
}

.friend-reject-btn {
  background: rgba(255,255,255,0.1);
  color: inherit;
}

.friend-add-btn {
  background: var(--accent);
  color: #fff;
}

.friend-remove-btn {
  background: rgba(239,68,68,0.2);
  color: #ef4444;
}

/* Style Preset Picker */
.style-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.style-preset-item {
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
  text-align: center;
}

.style-preset-item:hover {
  transform: scale(1.02);
}

.style-preset-item.active {
  border-color: var(--accent);
}

.style-preset-item .preset-preview {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-bottom: 6px;
  display: inline-block;
}

.style-preset-item .preset-name {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Voice Call Overlay */
.call-overlay {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
}

.call-card {
  background: rgba(20,20,30,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.call-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  color: #fff;
  background: linear-gradient(135deg, var(--plum-primary), var(--plum-primary-light));
  overflow: hidden;
}

.call-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.call-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.call-status {
  font-size: 0.8rem;
  opacity: 0.5;
}

.call-timer {
  font-size: 1.4rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.call-actions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.call-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
  color: #fff;
}

.call-btn:active { transform: scale(0.9); }

.call-btn-answer { background: #4ade80; }
.call-btn-end { background: #ef4444; }
.call-btn-mute { background: rgba(255,255,255,0.15); }
.call-btn-mute.active { background: #ef4444; }

/* Style Presets for Message Bubbles */
.message-bubble[data-style="bubblegum"].sent {
  background: linear-gradient(135deg, #ff6b9d, #ff85c8);
  border-radius: 20px 20px 4px 20px;
}
.message-bubble[data-style="bubblegum"].received {
  background: rgba(255,107,157,0.15);
  border-radius: 20px 20px 20px 4px;
}

.message-bubble[data-style="midnight"].sent {
  background: linear-gradient(135deg, #1a1a3e, #2d2d6b);
  border: 1px solid rgba(100,100,255,0.2);
  border-radius: 14px 14px 4px 14px;
}
.message-bubble[data-style="midnight"].received {
  background: rgba(30,30,80,0.4);
  border: 1px solid rgba(100,100,255,0.1);
  border-radius: 14px 14px 14px 4px;
}

.message-bubble[data-style="forest"].sent {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  border-radius: 16px 16px 4px 16px;
}
.message-bubble[data-style="forest"].received {
  background: rgba(27,67,50,0.3);
  border-radius: 16px 16px 16px 4px;
}

.message-bubble[data-style="sunset"].sent {
  background: linear-gradient(135deg, #f97316, #ef4444);
  border-radius: 18px 18px 4px 18px;
}
.message-bubble[data-style="sunset"].received {
  background: rgba(249,115,22,0.15);
  border-radius: 18px 18px 18px 4px;
}

.message-bubble[data-style="ocean"].sent {
  background: linear-gradient(135deg, #0077b6, #00b4d8);
  border-radius: 16px 16px 4px 16px;
}
.message-bubble[data-style="ocean"].received {
  background: rgba(0,119,182,0.15);
  border-radius: 16px 16px 16px 4px;
}

.message-bubble[data-style="retro"].sent {
  background: #2d2d2d;
  border: 1px solid #4ade80;
  color: #4ade80;
  font-family: 'Courier New', monospace;
  border-radius: 4px;
}
.message-bubble[data-style="retro"].received {
  background: #1a1a1a;
  border: 1px solid #4ade80;
  color: #4ade80;
  font-family: 'Courier New', monospace;
  border-radius: 4px;
}

.message-bubble[data-style="minimal"].sent {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px 12px 4px 12px;
}
.message-bubble[data-style="minimal"].received {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px 12px 12px 4px;
}

.message-bubble[data-style="neon"].sent {
  background: rgba(0,0,0,0.6);
  border: 1px solid #00ffff;
  box-shadow: 0 0 8px rgba(0,255,255,0.3);
  color: #00ffff;
  border-radius: 14px 14px 4px 14px;
}
.message-bubble[data-style="neon"].received {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(0,255,255,0.3);
  color: #00ffff;
  border-radius: 14px 14px 14px 4px;
}

.message-bubble[data-style="elegant"].sent {
  background: linear-gradient(135deg, #44403c, #57534e);
  border-radius: 20px 20px 4px 20px;
  font-style: italic;
}
.message-bubble[data-style="elegant"].received {
  background: rgba(68,64,60,0.3);
  border-radius: 20px 20px 20px 4px;
  font-style: italic;
}

/* Mobile Responsive for Messages */
@media (max-width: 768px) {
  .messages-sidebar {
    width: 100%;
    min-width: auto;
    border-right: none;
  }

  .messages-container.chat-active .messages-sidebar {
    display: none;
  }

  .messages-container.chat-active .messages-chat {
    display: flex;
  }

  .messages-chat {
    display: none;
  }

  .messages-container:not(.chat-active) .messages-chat-placeholder {
    display: none;
  }

  .messages-back-btn {
    display: flex;
  }

  .call-overlay {
    top: auto;
    bottom: 80px;
    right: 12px;
    left: 12px;
  }

  .call-card {
    width: 100%;
  }

  .message-bubble {
    max-width: 85%;
  }
}

/* ============================================
   FILE TRANSFER QUEUE
   ============================================ */
.panel-files-transfer {
  margin-top: 12px;
}

.files-transfer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.files-transfer-empty {
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px dashed var(--plum-glass-border);
  color: var(--plum-muted);
  font-size: 12px;
  text-align: center;
}

.files-transfer-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--plum-glass-border);
  background: rgba(255, 255, 255, 0.66);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.files-transfer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.files-transfer-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--plum-muted);
}

.files-transfer-status.status-running {
  color: #2563eb;
}

.files-transfer-status.status-paused {
  color: #d97706;
}

.files-transfer-status.status-waiting_conflict,
.files-transfer-status.status-failed {
  color: #b91c1c;
}

.files-transfer-status.status-completed {
  color: #166534;
}

.files-transfer-meta-row {
  font-size: 12px;
  color: var(--plum-muted);
  line-height: 1.35;
  word-break: break-word;
}

.files-transfer-progress {
  height: 8px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08);
}

.files-transfer-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--plum-primary), var(--plum-secondary));
  transition: width 0.2s ease;
}

.files-transfer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.files-transfer-alert,
.files-transfer-note,
.files-transfer-error {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 10px;
}

.files-transfer-alert {
  background: rgba(245, 158, 11, 0.14);
  color: #9a3412;
}

.files-transfer-note {
  background: rgba(37, 99, 235, 0.12);
  color: #1e3a8a;
}

.files-transfer-error {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
}

.ghost-btn.small {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  border-radius: 10px;
}

.ghost-btn.small.danger {
  border-color: rgba(185, 28, 28, 0.25);
  color: #991b1b;
}

/* ============================================
   MACRO RECORDER
   ============================================ */
.macro-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.macro-controls input {
  width: 100%;
  border: 1px solid var(--plum-glass-border);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

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

.macro-actions-row .ghost-btn {
  flex: 1;
}

.macro-status {
  font-size: 12px;
  color: var(--plum-muted);
  min-height: 18px;
}

.macro-status[data-state="recording"] {
  color: #b91c1c;
}

.macro-status[data-state="running"] {
  color: #1d4ed8;
}

.macro-status[data-state="ok"] {
  color: #166534;
}

.macro-status[data-state="warning"] {
  color: #b45309;
}

.macro-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.macro-empty {
  padding: 12px;
  border: 1px dashed var(--plum-glass-border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--plum-muted);
  text-align: center;
}

.macro-item {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--plum-glass-border);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.macro-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.macro-item-meta {
  font-size: 12px;
  color: var(--plum-muted);
}

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

.macro-item-actions .ghost-btn {
  flex: 1;
}

/* ============================================
   AUTOMATION MANAGER
   ============================================ */
.automation-settings-group {
  border-top: 1px solid rgba(var(--plum-primary-rgb), 0.12);
  padding-top: 12px;
}

.automation-subtitle {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--plum-muted);
}

.automation-builder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.automation-builder-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.automation-builder input,
.automation-builder select,
.automation-builder textarea {
  width: 100%;
  border: 1px solid var(--plum-glass-border);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.automation-builder textarea {
  resize: vertical;
  min-height: 58px;
}

.automation-builder .ghost-btn {
  white-space: nowrap;
}

.automation-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--plum-ink-light);
  padding: 8px 10px;
  border: 1px solid var(--plum-glass-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
}

.automation-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.automation-empty {
  padding: 12px;
  border: 1px dashed var(--plum-glass-border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--plum-muted);
  text-align: center;
}

.automation-item {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--plum-glass-border);
  background: rgba(255, 255, 255, 0.74);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.automation-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.automation-item-meta {
  font-size: 12px;
  color: var(--plum-muted);
  word-break: break-word;
}

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

.automation-item-actions .ghost-btn {
  flex: 1;
}

.automation-item .pill {
  font-size: 11px;
  padding: 2px 8px;
}

