/* Modern Glassmorphic Dashboard Styles with Custom Grid Resizing & Mobile Responsiveness */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: rgba(18, 24, 38, 0.7);
  --bg-card: rgba(22, 30, 49, 0.65);
  --bg-card-hover: rgba(30, 41, 67, 0.8);
  --bg-input: rgba(15, 23, 42, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --card-blur: blur(16px);
  --card-radius: 14px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 25px -5px var(--accent-glow);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --profile-active-color: #6366f1;
  --bg-header-scrolled: rgba(11, 15, 25, 0.92);
}

/* Theme variations */
body[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: rgba(241, 245, 249, 0.85);
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-input: rgba(241, 245, 249, 0.9);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.16);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  --accent-glow: rgba(99, 102, 241, 0.2);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --bg-header-scrolled: rgba(248, 250, 252, 0.92);
}

body[data-theme="cyberpunk"] {
  --bg-primary: #05050d;
  --bg-secondary: rgba(16, 12, 38, 0.8);
  --bg-card: rgba(22, 13, 44, 0.75);
  --border-color: rgba(236, 72, 153, 0.25);
  --border-hover: rgba(6, 182, 212, 0.5);
  --accent-primary: #ec4899;
  --accent-primary-hover: #db2777;
  --accent-glow: rgba(236, 72, 153, 0.45);
  --text-main: #f8fafc;
  --bg-header-scrolled: rgba(5, 5, 13, 0.92);
}

body[data-theme="aurora"] {
  --bg-primary: #03131a;
  --bg-secondary: rgba(6, 32, 41, 0.8);
  --bg-card: rgba(8, 44, 56, 0.7);
  --border-color: rgba(45, 212, 191, 0.2);
  --border-hover: rgba(45, 212, 191, 0.4);
  --accent-primary: #14b8a6;
  --accent-primary-hover: #0d9488;
  --accent-glow: rgba(20, 184, 166, 0.4);
  --text-main: #f0fdfa;
  --bg-header-scrolled: rgba(3, 19, 26, 0.92);
}

body[data-theme="sunset"] {
  --bg-primary: #180d19;
  --bg-secondary: rgba(38, 16, 36, 0.8);
  --bg-card: rgba(51, 23, 46, 0.7);
  --border-color: rgba(249, 115, 22, 0.25);
  --border-hover: rgba(244, 63, 94, 0.45);
  --accent-primary: #f97316;
  --accent-primary-hover: #ea580c;
  --accent-glow: rgba(249, 115, 22, 0.4);
  --text-main: #fff7ed;
  --bg-header-scrolled: rgba(24, 13, 25, 0.92);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Custom Themed Scrollbar (Matches Active Theme) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-glow);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.45;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

/* Background canvas & ambient blur */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.5s ease;
}

.bg-ambient-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  pointer-events: none;
  z-index: -1;
}

.glow-1 {
  top: -80px;
  left: 10%;
  background: var(--accent-primary);
}

.glow-2 {
  bottom: 50px;
  right: 10%;
  background: #38bdf8;
}

/* App Header */
.app-header {
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1.25rem;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body.header-scrolled .app-header {
  background: var(--bg-header-scrolled, var(--bg-secondary));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.header-container {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  min-height: 40px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  z-index: 15;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-primary), #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Profiles Navigation Bar - ANCHORED IN DEAD CENTER ALWAYS */
.profiles-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  padding: 0.22rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

body.header-scrolled .profiles-bar {
  left: 50%;
  transform: translate(-50%, -50%);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.profiles-bar::-webkit-scrollbar {
  display: none;
}

/* ===================================================
   SCROLLED TOP BAR: FLANKING CENTER PROFILES
   =================================================== */

/* Left Side: Quick Clocks Bar (Fluid Morph from Hero Clock) */
.header-scrolled-clocks {
  position: absolute;
  right: calc(50% + 115px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.3s ease;
  max-width: calc(50% - 220px);
  overflow-x: auto;
  scrollbar-width: none;
}

body.header-scrolled .header-scrolled-clocks {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

.header-scrolled-clocks::-webkit-scrollbar {
  display: none;
}

/* Right Side: Compact Search Bar + Adaptive Shortcuts (Fluid Morph from Hero Search) */
.header-scrolled-tools {
  position: absolute;
  left: calc(50% + 115px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  opacity: 0;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.3s ease;
  max-width: calc(50% - 200px);
}

body.header-scrolled .header-scrolled-tools {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

/* Clock Pills in Top Bar with Staggered Spring Scale */
.header-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  box-shadow: var(--shadow-sm);
  transition: transform 0.36s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  transform: scale(0.92);
}

body.header-scrolled .header-clock-pill {
  transform: scale(1);
}

.header-clock-pill.main-clock-pill {
  transition-delay: 0.04s;
}

.header-clock-pill.world-clock-pill {
  transition-delay: 0.08s;
}

.header-search-bar {
  transition: transform 0.36s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  transform: scale(0.92);
}

body.header-scrolled .header-search-bar {
  transform: scale(1);
}

.header-adaptive-shortcuts {
  transition: transform 0.36s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(0.9);
  transition-delay: 0.06s;
}

body.header-scrolled .header-adaptive-shortcuts {
  transform: scale(1);
}

.header-clock-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: scale(1.02);
  color: var(--accent-primary);
}

.main-clock-pill {
  border-color: var(--accent-primary);
  background: var(--bg-card);
}

.header-clock-pill .header-clock-icon {
  font-size: 0.8rem;
}

.header-clock-pill .header-clock-sec {
  color: var(--accent-primary);
  font-weight: 500;
  font-size: 0.68rem;
}

.header-clock-pill .header-clock-ampm {
  color: var(--accent-primary);
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 0.15rem;
}

.world-clock-pill .header-clock-city {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 0.15rem;
}

/* Compact Search Bar in Top Bar */
.header-search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.15rem 0.25rem 0.15rem 0.55rem;
  gap: 0.35rem;
  transition: all 0.2s ease;
  min-width: 190px;
  max-width: 280px;
  position: relative;
}

.header-search-bar:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
  background: var(--bg-card);
}

.header-search-engine-selector {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.header-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.75rem;
  width: 100%;
  min-width: 90px;
}

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

.header-search-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}

.header-search-btn:hover {
  background: #4f46e5;
  transform: scale(1.08);
}

/* ===================================================
   SEARCH ENGINE DROPDOWN LIST (No wide open pills)
   =================================================== */
.search-bar {
  position: relative;
}

.search-engine-selector {
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
  transition: all 0.2s ease;
}

.search-engine-selector:hover {
  color: var(--accent-primary);
}

.dropdown-chevron {
  font-size: 0.65rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.search-engine-selector:hover .dropdown-chevron {
  opacity: 1;
  transform: translateY(1px);
}

.search-engine-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 99999;
  min-width: 185px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  padding: 0.35rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.search-engine-dropdown.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.search-engine-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.38rem 0.65rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-engine-option:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
}

.search-engine-option.selected {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
  font-weight: 600;
}

.engine-opt-icon {
  font-size: 0.9rem;
}

.engine-opt-name {
  flex: 1;
}

.engine-opt-check {
  margin-left: auto;
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ===================================================
   ADAPTIVE TOP BAR SHORTCUTS (Straight or Grouped)
   =================================================== */
.header-shortcuts-container {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.header-shortcuts-straight {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.header-shortcut-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.header-shortcut-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--accent-glow);
}

.header-shortcut-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 4px;
}

.header-shortcuts-group {
  position: relative;
}

.header-shortcuts-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-shortcuts-group-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.header-shortcuts-group-btn .group-count {
  color: var(--accent-primary);
  font-weight: 700;
}

.header-shortcuts-flyout {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  padding: 0.4rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 99999;
}

.header-shortcuts-group:hover .header-shortcuts-flyout,
.header-shortcuts-group:focus-within .header-shortcuts-flyout {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.shortcuts-flyout-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
}

.shortcuts-flyout-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 240px;
  overflow-y: auto;
}

.shortcuts-flyout-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.shortcuts-flyout-item:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
}

.shortcuts-flyout-item .flyout-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 3px;
}

.shortcuts-flyout-item .flyout-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shortcuts-flyout-item .flyout-arrow {
  font-size: 0.7rem;
  opacity: 0.5;
  margin-left: auto;
}

/* ===================================================
   CLEAN HERO SCROLL & DIRECT LAUNCHPAD FOCUS
   =================================================== */
.hero-cockpit {
  transition: opacity 0.3s ease;
}

/* Group Action Icon Buttons inside Group Name Row */
.group-filter-actions-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 0.35rem;
  flex-shrink: 0;
  align-self: center;
}

.group-action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.group-action-icon-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: scale(1.12);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

@media (max-width: 1100px) {
  .header-scrolled-clocks {
    display: none;
  }
}

@media (max-width: 860px) {
  .header-scrolled-tools {
    display: none;
  }
}

#profiles-list {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

/* Apple-Style Expanding Profile Pill */
.profile-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.35, 1),
              padding 0.4s cubic-bezier(0.25, 1, 0.35, 1),
              background 0.25s ease,
              border-color 0.25s ease,
              color 0.2s ease,
              box-shadow 0.4s cubic-bezier(0.25, 1, 0.35, 1);
  transform-origin: center center;
  white-space: nowrap;
  user-select: none;
  overflow: hidden;
}

.profile-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.35, 1);
}

/* Fluid Apple Expanding Label Container (Grid 0fr -> 1fr animates actual text width steadily with zero dead-zone snapping) */
.profile-tab-name-wrap {
  display: inline-grid;
  grid-template-columns: 0fr;
  opacity: 0;
  margin-left: 0;
  overflow: hidden;
  pointer-events: none;
  vertical-align: middle;
  transition: grid-template-columns 0.4s cubic-bezier(0.25, 1, 0.35, 1),
              margin 0.4s cubic-bezier(0.25, 1, 0.35, 1),
              opacity 0.28s ease;
}

.profile-tab-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  transform: translateX(-8px);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.35, 1);
  letter-spacing: 0.2px;
}

/* Hover: Pill expands outward smoothly from center (both sides) revealing label */
.profile-tab:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: scale(1.05);
  padding: 0 13px;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.profile-tab:hover .profile-tab-icon {
  transform: scale(1.08);
}

.profile-tab:hover .profile-tab-name-wrap {
  grid-template-columns: 1fr;
  opacity: 1;
  margin-left: 7px;
  pointer-events: auto;
  transition: grid-template-columns 0.42s cubic-bezier(0.25, 1, 0.35, 1),
              margin 0.42s cubic-bezier(0.25, 1, 0.35, 1),
              opacity 0.32s ease 0.04s;
}

.profile-tab:hover .profile-tab-name {
  transform: translateX(0);
}

/* Active State */
.profile-tab.active {
  color: #fff;
  background: var(--profile-active-color, #6366f1);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.profile-tab.active:hover {
  background: var(--profile-active-color, #6366f1);
  filter: brightness(1.12);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

.profile-add-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px dashed var(--border-hover);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center center;
  flex-shrink: 0;
}

.profile-add-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  transform: scale(1.1);
}

.btn-color-swatch {
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease;
}

.btn-color-swatch:hover {
  transform: scale(1.25);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.45);
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* Main Dashboard Layout */
.dashboard-main {
  position: relative;
  z-index: 1;
  max-width: 1560px;
  margin: 1.25rem auto 3rem auto;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Hero Cockpit Section (Fills Left & Right Spaces) */
.hero-cockpit {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 2fr) minmax(220px, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .hero-cockpit {
    grid-template-columns: 1fr;
  }
  .hero-slot-left, .hero-slot-right {
    display: none;
  }
  .hero-center-clock-row {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }

  /* On mobile: group both left and right shortcuts together on the left */
  .hero-dock-left {
    order: 1 !important;
    min-width: auto !important;
    justify-content: flex-start !important;
  }

  .hero-dock-right {
    order: 2 !important;
    min-width: auto !important;
    justify-content: flex-start !important;
    margin-left: 0.25rem !important;
  }

  .hero-icon-dock.hero-dock-right.is-empty {
    display: none !important;
  }

  /* Main clock on the right side on mobile */
  .clock-display {
    order: 3 !important;
    flex: 1 !important;
    align-items: flex-end !important;
    text-align: right !important;
    margin: 0 0 0 auto !important;
    padding-right: 0.25rem !important;
  }

  .clock-display .clock-time {
    justify-content: flex-end !important;
    font-size: 2.1rem !important;
    letter-spacing: -0.02em !important;
  }

  .clock-display .clock-date {
    text-align: right !important;
    font-size: 0.78rem !important;
  }
}

.hero-slot-left,
.hero-slot-right {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.38s ease, filter 0.38s ease;
}

body.header-scrolled .hero-slot-left {
  transform: translateY(-20px) scale(0.96);
  opacity: 0.15;
  filter: blur(2px);
  pointer-events: none;
}

body.header-scrolled .hero-slot-right {
  transform: translateY(-20px) scale(0.96);
  opacity: 0.15;
  filter: blur(2px);
  pointer-events: none;
}

.hero-slot-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  width: 100%;
}

.hero-card {
  background: var(--bg-card);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

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

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.45rem;
}

.hero-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-status-tag {
  font-size: 0.68rem;
  color: var(--text-faint);
}

/* Note Mode Tabs - Modern Segmented Control */
.note-tabs-header {
  width: 100%;
}

.note-mode-tabs {
  display: flex;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
  box-sizing: border-box;
}

.note-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.28rem 0.35rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-family: inherit;
  white-space: nowrap;
  user-select: none;
}

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

.note-tab-btn.active {
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.note-tab-btn.active.quick-tab {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
}

.note-tab-btn.active.permanent-tab {
  background: #f59e0b !important;
  color: #111827 !important;
  font-weight: 700;
}

.note-tab-btn.active.sticky-tab {
  background: #eab308 !important; /* Post-it Gold */
  color: #1e293b !important;
  font-weight: 700;
}

/* Note Unified Sub-Toolbar (Constant height across all 3 modes to eliminate layout shift) */
.note-unified-toolbar {
  width: 100%;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  margin: 0.35rem 0 0.45rem 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.note-sub-toolbar {
  width: 100%;
  height: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  box-sizing: border-box;
}

.note-toolbar-left,
.note-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.note-info-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  user-select: none;
}

.note-info-badge.quick-badge {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.note-info-badge.perm-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-sub-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.18rem 0.42rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-sub-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sub-action.btn-sub-clear:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-sub-action.btn-sub-icon {
  padding: 0.18rem 0.28rem;
  font-size: 0.72rem;
}

.sticky-actions-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

/* Post-It Sticky Note Paper Themes */
.sticky-mode-yellow {
  background: #fef08a !important;
  color: #1e293b !important;
  border-color: #fde047 !important;
}

.sticky-mode-pink {
  background: #fbcfe8 !important;
  color: #1e293b !important;
  border-color: #f472b6 !important;
}

.sticky-mode-green {
  background: #bbf7d0 !important;
  color: #1e293b !important;
  border-color: #86efac !important;
}

.sticky-mode-blue {
  background: #bae6fd !important;
  color: #1e293b !important;
  border-color: #7dd3fc !important;
}

.sticky-mode-purple {
  background: #e9d5ff !important;
  color: #1e293b !important;
  border-color: #d8b4fe !important;
}

.sticky-mode-orange {
  background: #fed7aa !important;
  color: #1e293b !important;
  border-color: #fdba74 !important;
}

.sticky-textarea-dark {
  color: #1e293b !important;
  font-weight: 500;
}

.sticky-textarea-dark::placeholder {
  color: rgba(30, 41, 59, 0.45) !important;
}

.sticky-color-strip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  flex-shrink: 0;
}

.sticky-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.sticky-color-dot:hover {
  transform: scale(1.22);
}

.sticky-color-dot.active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--accent-primary);
  transform: scale(1.15);
}

.sticky-color-dot.yellow { background: #fef08a; }
.sticky-color-dot.pink { background: #fbcfe8; }
.sticky-color-dot.green { background: #bbf7d0; }
.sticky-color-dot.blue { background: #bae6fd; }
.sticky-color-dot.purple { background: #e9d5ff; }
.sticky-color-dot.orange { background: #fed7aa; }

/* Sticky Notes Multi-Toolbar & Controls */
.sticky-multi-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0;
  flex-wrap: nowrap;
  width: 100%;
  height: 32px;
  box-sizing: border-box;
}

.sticky-pager-group {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1px 3px;
  flex-shrink: 0;
}

.btn-sticky-nav {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-sticky-nav:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.sticky-pager-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 0 0.3rem;
  min-width: 44px;
  text-align: center;
}

.btn-sticky-action {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-primary);
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 0.18rem 0.45rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sticky-action:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-sticky-pin {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: auto;
}

.btn-sticky-pin:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-sticky-pin.pinned {
  background: #eab308 !important;
  color: #1e293b !important;
  border-color: #ca8a04 !important;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.4);
}

/* Floating Draggable Movable Sticky Notes Container */
.floating-sticky-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 99990;
  pointer-events: none;
}

.draggable-sticky-card {
  position: fixed;
  width: 250px;
  border-radius: 10px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.25);
  padding: 0.75rem;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  user-select: none;
  transition: box-shadow 0.2s ease, transform 0.1s ease;
  animation: stickyPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.draggable-sticky-card.dragging {
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35);
  transform: scale(1.02);
  cursor: grabbing !important;
}

.draggable-sticky-card.yellow { background: #fef08a; border-color: #fde047; --note-accent: #fde047; }
.draggable-sticky-card.pink { background: #fbcfe8; border-color: #f472b6; --note-accent: #f472b6; }
.draggable-sticky-card.green { background: #bbf7d0; border-color: #86efac; --note-accent: #86efac; }
.draggable-sticky-card.blue { background: #bae6fd; border-color: #7dd3fc; --note-accent: #7dd3fc; }
.draggable-sticky-card.purple { background: #e9d5ff; border-color: #d8b4fe; --note-accent: #d8b4fe; }
.draggable-sticky-card.orange { background: #fed7aa; border-color: #fdba74; --note-accent: #fdba74; }

/* Minimized Floating Sticky Note (Square with Rounded Corners following Active Theme) */
.draggable-sticky-card.minimized {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 14px;
  background: var(--bg-card, rgba(15, 23, 42, 0.88)) !important;
  backdrop-filter: var(--card-blur, blur(16px));
  -webkit-backdrop-filter: var(--card-blur, blur(16px));
  border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.14)) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  position: fixed;
  overflow: visible;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}

.draggable-sticky-card.minimized::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--note-accent, #fde047);
  box-shadow: 0 0 6px var(--note-accent, #fde047);
  opacity: 0.95;
  transition: width 0.18s ease;
}

.draggable-sticky-card.minimized:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--accent-primary, #6366f1) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 16px var(--accent-glow, rgba(99, 102, 241, 0.35));
}

.draggable-sticky-card.minimized:hover::before {
  width: 24px;
}

.draggable-sticky-card.minimized.dragging {
  cursor: grabbing !important;
  transform: scale(1.08);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow, rgba(99, 102, 241, 0.45));
}

.sticky-minimized-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: grab;
}

.draggable-sticky-card.minimized.dragging .sticky-minimized-wrapper {
  cursor: grabbing !important;
}

.sticky-paper-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
}

.sticky-paper-svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  transition: transform 0.15s ease;
  pointer-events: none;
}

.draggable-sticky-card.minimized:hover .sticky-paper-svg {
  transform: scale(1.06);
}

/* Paper colors by sticky note color */
.draggable-sticky-card.yellow .paper-sheet { fill: #fef08a; }
.draggable-sticky-card.yellow .paper-fold { fill: #fde047; }
.draggable-sticky-card.yellow .paper-num { fill: #713f12; }

.draggable-sticky-card.pink .paper-sheet { fill: #fbcfe8; }
.draggable-sticky-card.pink .paper-fold { fill: #f472b6; }
.draggable-sticky-card.pink .paper-num { fill: #831843; }

.draggable-sticky-card.green .paper-sheet { fill: #bbf7d0; }
.draggable-sticky-card.green .paper-fold { fill: #86efac; }
.draggable-sticky-card.green .paper-num { fill: #14532d; }

.draggable-sticky-card.blue .paper-sheet { fill: #bae6fd; }
.draggable-sticky-card.blue .paper-fold { fill: #7dd3fc; }
.draggable-sticky-card.blue .paper-num { fill: #0c4a6e; }

.draggable-sticky-card.purple .paper-sheet { fill: #e9d5ff; }
.draggable-sticky-card.purple .paper-fold { fill: #d8b4fe; }
.draggable-sticky-card.purple .paper-num { fill: #581c87; }

.draggable-sticky-card.orange .paper-sheet { fill: #fed7aa; }
.draggable-sticky-card.orange .paper-fold { fill: #fdba74; }
.draggable-sticky-card.orange .paper-num { fill: #7c2d12; }

.sticky-minimized-unpin {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.2));
  color: var(--text-secondary, #94a3b8);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.draggable-sticky-card.minimized:hover .sticky-minimized-unpin {
  opacity: 1;
}

.sticky-minimized-unpin:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: scale(1.15);
}

.draggable-sticky-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-weight: 700;
  font-size: 0.78rem;
  color: #1e293b;
  cursor: grab;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.draggable-sticky-header:active {
  cursor: grabbing;
}

.draggable-sticky-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drag-grip-icon {
  font-size: 0.8rem;
  opacity: 0.6;
  letter-spacing: -1px;
}

.draggable-sticky-textarea {
  width: 100%;
  height: 120px;
  background: transparent;
  border: none;
  outline: none;
  color: #1e293b;
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.45;
  resize: none;
  font-weight: 500;
  user-select: text;
}

.draggable-sticky-textarea::placeholder {
  color: rgba(30, 41, 59, 0.45);
}

.draggable-sticky-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.sticky-color-dots-mini {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.color-dot-mini {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.color-dot-mini:hover {
  transform: scale(1.3);
}

.color-dot-mini.active {
  box-shadow: 0 0 0 1.5px #ffffff, 0 0 0 3px #1e293b;
  transform: scale(1.15);
}

.color-dot-mini.yellow { background: #fef08a; }
.color-dot-mini.pink { background: #fbcfe8; }
.color-dot-mini.green { background: #bbf7d0; }
.color-dot-mini.blue { background: #bae6fd; }
.color-dot-mini.purple { background: #e9d5ff; }
.color-dot-mini.orange { background: #fed7aa; }

.sticky-save-indicator {
  font-size: 0.65rem;
  color: rgba(30, 41, 59, 0.7);
  font-weight: 600;
}

.btn-sticky-ctrl {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-sticky-ctrl:hover {
  background: rgba(0, 0, 0, 0.15);
}

.permanent-mode-glow {
  border-color: rgba(245, 158, 11, 0.45) !important;
}

.permanent-mode-glow:focus {
  border-color: #f59e0b !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25) !important;
}

.hero-scratchpad-input {
  flex: 1;
  width: 100%;
  min-height: 135px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.55rem;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.8rem;
  line-height: 1.4;
  resize: none;
  outline: none;
}

.hero-scratchpad-input:focus {
  border-color: var(--accent-primary);
}

.hero-quick-todo-row {
  display: flex;
  gap: 0.35rem;
}

.hero-todo-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 0.35rem 0.55rem;
  color: var(--text-main);
  font-size: 0.78rem;
  outline: none;
}

.hero-todo-input:focus {
  border-color: var(--accent-primary);
}

.hero-todo-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  max-height: 145px;
}

/* Hero Section */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.greeting-text {
  font-size: 0.85rem;
  color: var(--accent-primary);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease;
}

body.header-scrolled .greeting-text {
  transform: translateY(-20px) scale(0.9);
  opacity: 0;
  pointer-events: none;
}

.hero-center-clock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
  position: relative;
}

/* Hero Custom Icon Docks (Flank clock on desktop: left & right) */
.hero-icon-dock {
  width: auto;
  min-height: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.2rem;
  border-radius: 14px;
  transition: all 0.2s ease;
  user-select: none;
  box-sizing: border-box;
}

.hero-dock-left {
  order: 1;
  justify-content: flex-start;
  min-width: 50px;
  flex-shrink: 0;
  transition: transform 0.44s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.36s ease, filter 0.36s ease;
}

body.header-scrolled .hero-dock-left {
  transform: translateX(-40px) scale(0.65);
  opacity: 0;
  filter: blur(3px);
  pointer-events: none;
}

.hero-dock-right {
  order: 3;
  justify-content: flex-end;
  min-width: 50px;
  flex-shrink: 0;
  transition: transform 0.44s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.36s ease, filter 0.36s ease;
}

body.header-scrolled .hero-dock-right {
  transform: translateX(40px) scale(0.65);
  opacity: 0;
  filter: blur(3px);
  pointer-events: none;
}

/* Default empty state for dock */
.hero-icon-dock.is-empty {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-icon-dock.is-empty:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.04);
}

.hero-dock-empty-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.hero-icon-dock.is-empty:hover .hero-dock-empty-indicator {
  opacity: 1;
}

.empty-hint-text {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0 0.25rem;
}

/* Individual Dock Item */
.hero-dock-item {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-sizing: border-box;
}

.hero-dock-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-primary);
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
  z-index: 10;
}

.hero-dock-item img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  pointer-events: none;
}

.hero-dock-icon-symbol {
  font-size: 1.25rem;
  line-height: 1;
  pointer-events: none;
}

.hero-dock-item.dragging {
  opacity: 0.25;
  transform: scale(0.9);
  border: 2px dashed var(--accent-primary) !important;
}

.hero-dock-item.drag-over {
  border-color: #60a5fa !important;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.6) !important;
  transform: scale(1.12);
}

.hero-icon-dock.dock-drag-over {
  border-color: var(--accent-primary) !important;
  background: rgba(99, 102, 241, 0.08) !important;
}

/* Tooltip on Hover */
.hero-dock-tooltip {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 60;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.hero-dock-item:hover .hero-dock-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Icon Picker in Modal */
.hero-icon-preview-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.hero-icon-preview-box img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* Hero Icon Picker Tabs & Grid */
.hero-picker-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 2px;
}

.btn-picker-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1.2;
}

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

.btn-picker-tab.active {
  background: var(--accent-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.hero-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.45rem;
  max-height: 195px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.45rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.hero-icon-picker-grid::-webkit-scrollbar {
  width: 5px;
}

.hero-icon-picker-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.hero-icon-picker-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
}

.hero-icon-picker-grid::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
  box-shadow: 0 0 6px var(--accent-glow);
}

.icon-picker-item {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 1.15rem;
  padding: 0;
}

.icon-picker-item:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent-primary);
  transform: scale(1.1);
}

.icon-picker-item.selected {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 2px var(--accent-primary) !important;
  background: rgba(99, 102, 241, 0.2) !important;
}

.icon-picker-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.clock-display {
  order: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 220px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.44s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.38s ease, filter 0.38s ease;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  transform-origin: center top;
}

.clock-display:hover {
  transform: scale(1.02);
}

body.header-scrolled .clock-display {
  transform: scale(0.65) translateY(-45px);
  opacity: 0;
  filter: blur(5px);
  pointer-events: none;
}

.clock-time {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
}

.clock-time .seconds {
  font-size: 1.75rem;
  color: var(--accent-primary);
  font-weight: 500;
  margin-left: 0.2rem;
}

.clock-time .clock-ampm {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-left: 0.35rem;
  vertical-align: super;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.clock-date {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* World Clocks */
#widget-worldclocks {
  width: 100%;
  transition: transform 0.44s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.36s ease, filter 0.36s ease;
  transform-origin: center top;
}

body.header-scrolled #widget-worldclocks {
  transform: scale(0.75) translateY(-32px);
  opacity: 0;
  filter: blur(4px);
  pointer-events: none;
}

.world-clocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 0.5rem;
}

.world-clock-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 0.45rem 0.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  position: relative;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.35, 1);
  cursor: pointer;
  user-select: none;
}

.world-clock-badge:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.del-rate-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  color: white;
  border: none;
  font-size: 0.58rem;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

.rate-badge:hover .del-rate-btn {
  display: flex;
}

.add-clock-badge, .add-rate-badge {
  border: 1.5px dashed var(--border-hover) !important;
  background: transparent !important;
  cursor: pointer !important;
  color: var(--accent-primary) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px;
  transition: all 0.2s !important;
}

.add-clock-badge:hover, .add-rate-badge:hover {
  border-color: var(--accent-primary) !important;
  background: rgba(99, 102, 241, 0.1) !important;
}

/* Group Reordering Controls */
.link-group-reorder-btn {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.link-group-reorder-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.1);
}

.link-group-drag-handle {
  cursor: grab;
  color: var(--text-faint);
  font-size: 0.9rem;
  padding: 0 0.2rem;
  user-select: none;
}

.link-group-drag-handle:active {
  cursor: grabbing;
}

.link-group-card.dragging {
  opacity: 0.4;
  border: 2px dashed var(--accent-primary);
}

.link-group-card.drag-over {
  border-color: var(--accent-primary);
  transform: scale(1.02);
}

.world-clock-badge .city {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.world-clock-badge .time {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* Universal Search */
.search-container {
  width: 100%;
  max-width: 680px;
  position: relative;
  transition: transform 0.44s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.38s ease, filter 0.38s ease;
  transform-origin: center top;
}

body.header-scrolled .search-container {
  transform: scale(0.82) translateY(-35px);
  opacity: 0;
  filter: blur(4px);
  pointer-events: none;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: var(--card-blur);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.32rem 0.5rem 0.32rem 0.85rem;
  box-shadow: var(--shadow-md);
  transition: all 0.25s ease;
}

.search-bar:focus-within {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.search-engine-selector {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-right: 0.6rem;
  user-select: none;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.search-engine-selector:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 1rem;
  min-width: 0;
}

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

.search-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.search-btn:hover {
  background: var(--accent-primary-hover);
  transform: scale(1.05);
}

.engine-pills {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.engine-pill {
  font-size: 0.725rem;
  padding: 0.18rem 0.55rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.engine-pill:hover, .engine-pill.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border-color: rgba(99, 102, 241, 0.3);
}

/* ===================================================
   LINK GROUPS & LAUNCHPAD SYSTEM
   =================================================== */
.bookmarks-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bookmarks-controls-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.group-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.25rem 0;
  -webkit-overflow-scrolling: touch;
}

.group-filter-pills::-webkit-scrollbar {
  display: none;
}

.group-filter-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.group-filter-pill:hover, .group-filter-pill.active {
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.groups-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  align-items: start;
}

.link-group-card {
  background: var(--bg-card);
  backdrop-filter: var(--card-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, transform 0.2s;
  height: 100%;
}

.link-group-card:hover {
  border-color: var(--border-hover);
}

.link-group-card .bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 0.5rem;
}

.link-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.link-group-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.link-group-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  position: relative;
  user-select: none;
  flex-shrink: 0;
}

.link-group-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.link-group-count {
  font-size: 0.7rem;
  color: var(--text-faint);
  background: var(--bg-input);
  padding: 0.1rem 0.45rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.link-group-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.85rem 0.5rem;
  justify-items: center;
}

.bookmark-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.25rem 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-main);
  text-decoration: none;
  position: relative;
  cursor: pointer;
  width: 100%;
  max-width: 84px;
}

.bookmark-card:hover {
  background: transparent;
  border: none;
  box-shadow: none;
  transform: none;
}

/* REAL DASHBOARD APP ICON TILE (Exact Replica of Sample Demo Sheet) */
.icon-tile,
.bookmark-card .icon-tile {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.25s ease;
}

body[data-theme="light"] .icon-tile,
body[data-theme="light"] .bookmark-card .icon-tile {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.icon-tile img,
.bookmark-card .icon-tile img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  pointer-events: none;
  transition: transform 0.25s ease;
  z-index: 2;
  position: relative;
}

.icon-tile .bookmark-emoji-symbol,
.bookmark-card .icon-tile .bookmark-emoji-symbol {
  font-size: 1.65rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  pointer-events: none;
  transition: transform 0.25s ease;
  z-index: 2;
  position: relative;
}

.icon-tile:hover img,
.icon-tile:hover .bookmark-emoji-symbol,
.bookmark-card:hover .icon-tile img,
.bookmark-card:hover .icon-tile .bookmark-emoji-symbol {
  transform: scale(1.08);
}

.bookmark-card .bookmark-title,
.bookmark-card .icon-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.45rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.bookmark-card:hover .bookmark-title,
.bookmark-card:hover .icon-label {
  color: var(--text-main);
}



/* Group Icon in Header (Exact Demo Tile Replica) */
.icon-tile.link-group-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  user-select: none;
  flex-shrink: 0;
}

body[data-theme="light"] .icon-tile.link-group-icon {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.icon-tile.link-group-icon span.group-glyph {
  font-size: 1.15rem;
  line-height: 1;
  z-index: 2;
  position: relative;
}

.icon-tile.link-group-icon .tacho-svg {
  inset: -1.5px;
  width: calc(100% + 3px);
  height: calc(100% + 3px);
}

/* Hero Dock Icon Tile */
.hero-dock-item.icon-tile {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
}

.hero-dock-item.icon-tile .tacho-svg {
  inset: -1.5px;
  width: calc(100% + 3px);
  height: calc(100% + 3px);
}



/* =========================================================
   EMOJI GLYPH & ICON PICKER STYLES
   ========================================================= */
.bookmark-icon-wrap .bookmark-emoji-symbol {
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  transition: transform 0.25s ease;
}

.bookmark-card:hover .bookmark-emoji-symbol {
  transform: scale(1.15);
}

.emoji-preview-box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
  user-select: none;
}

.rich-emoji-picker-widget {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.6rem;
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rich-emoji-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rich-emoji-tabs {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.rich-emoji-tabs::-webkit-scrollbar {
  display: none;
}

.btn-picker-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-picker-pill:hover,
.btn-picker-pill.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.rich-emoji-search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.76rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.rich-emoji-search-input:focus {
  border-color: var(--accent-primary);
}

.rich-emoji-scroll-area {
  max-height: 165px;
  overflow-y: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.rich-emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: 0.32rem;
}

.rich-emoji-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  padding: 0;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.rich-emoji-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-primary);
  transform: scale(1.18);
  z-index: 2;
}

.rich-emoji-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-glow);
  transform: scale(1.1);
}

/* =========================================================
   14 ICON HOVER ANIMATION SUITE (Exact Replica of Sample Sheet)
   ========================================================= */

/* 1. Style 3: Luminous Rotating Border Beam */
.fx-border-beam {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  z-index: 1;
  transition: transform 0.25s ease;
}

.fx-border-beam::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  padding: 2.5px;
  background: conic-gradient(from 0deg, transparent 0%, #6366f1 25%, #38bdf8 50%, #ec4899 75%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: rotateBorder 3s linear infinite;
  pointer-events: none;
}

@keyframes rotateBorder {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fx-border-beam:hover,
.bookmark-card:hover .icon-tile.fx-border-beam {
  transform: scale(1.06);
}

.fx-border-beam:hover::before,
.bookmark-card:hover .icon-tile.fx-border-beam::before {
  opacity: 1;
}

/* 2. Option C: Sci-Fi HUD Reticle Brackets */
.fx-hud-brackets {
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s;
}

.fx-hud-brackets .bracket {
  position: absolute;
  width: 11px;
  height: 11px;
  border-color: var(--accent-primary, #6366f1);
  border-style: solid;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fx-hud-brackets .b-tl { top: 2px; left: 2px; border-width: 2.5px 0 0 2.5px; border-top-left-radius: 6px; }
.fx-hud-brackets .b-tr { top: 2px; right: 2px; border-width: 2.5px 2.5px 0 0; border-top-right-radius: 6px; }
.fx-hud-brackets .b-bl { bottom: 2px; left: 2px; border-width: 0 0 2.5px 2.5px; border-bottom-left-radius: 6px; }
.fx-hud-brackets .b-br { bottom: 2px; right: 2px; border-width: 0 2.5px 2.5px 0; border-bottom-right-radius: 6px; }

.fx-hud-brackets:hover,
.bookmark-card:hover .icon-tile.fx-hud-brackets {
  transform: scale(1.08);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

.fx-hud-brackets:hover .b-tl,
.bookmark-card:hover .icon-tile.fx-hud-brackets .b-tl { opacity: 1; top: -6px; left: -6px; }
.fx-hud-brackets:hover .b-tr,
.bookmark-card:hover .icon-tile.fx-hud-brackets .b-tr { opacity: 1; top: -6px; right: -6px; }
.fx-hud-brackets:hover .b-bl,
.bookmark-card:hover .icon-tile.fx-hud-brackets .b-bl { opacity: 1; bottom: -6px; left: -6px; }
.fx-hud-brackets:hover .b-br,
.bookmark-card:hover .icon-tile.fx-hud-brackets .b-br { opacity: 1; bottom: -6px; right: -6px; }

/* 3. Option E: Aurora Fluid Wave */
.fx-aurora {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: rgba(255, 255, 255, 0.06);
  z-index: 1;
}

.fx-aurora::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg,
    #14b8a6,
    #3b82f6,
    #8b5cf6,
    #ec4899,
    #14b8a6
  );
  filter: blur(14px);
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: auroraSpin 6s linear infinite;
  z-index: -2;
}

.fx-aurora::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 14px;
  background: var(--bg-card);
  z-index: -1;
}

body[data-theme="light"] .fx-aurora::after {
  background: #ffffff;
}

@keyframes auroraSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fx-aurora:hover,
.bookmark-card:hover .icon-tile.fx-aurora {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 12px 28px rgba(20, 184, 166, 0.35);
}

.fx-aurora:hover::before,
.bookmark-card:hover .icon-tile.fx-aurora::before {
  opacity: 0.95;
}

/* 4. Option F: Holographic Scanline */
.fx-holo {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s;
}

.fx-holo::before {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 35%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(56, 189, 248, 0.5) 50%,
    transparent 100%
  );
  opacity: 0;
  pointer-events: none;
}

.fx-holo:hover,
.bookmark-card:hover .icon-tile.fx-holo {
  transform: translateY(-3px) scale(1.06);
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.45);
}

.fx-holo:hover img,
.fx-holo:hover .bookmark-emoji-symbol,
.bookmark-card:hover .icon-tile.fx-holo img,
.bookmark-card:hover .icon-tile.fx-holo .bookmark-emoji-symbol {
  filter: drop-shadow(-2px 0 #ec4899) drop-shadow(2px 0 #38bdf8);
}

.fx-holo:hover::before,
.bookmark-card:hover .icon-tile.fx-holo::before {
  opacity: 1;
  animation: holoScan 1s linear infinite;
}

@keyframes holoScan {
  0% { top: -40%; }
  100% { top: 140%; }
}

/* 5. Option G: Neon Circuit Trace */
.fx-circuit {
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s;
}

.fx-circuit .trace-line {
  position: absolute;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.fx-circuit .tl-top { top: -4px; left: 15%; width: 0; height: 2px; }
.fx-circuit .tl-bottom { bottom: -4px; right: 15%; width: 0; height: 2px; }
.fx-circuit .tl-left { left: -4px; bottom: 20%; width: 2px; height: 0; }
.fx-circuit .tl-right { right: -4px; top: 20%; width: 2px; height: 0; }

.fx-circuit:hover,
.bookmark-card:hover .icon-tile.fx-circuit {
  transform: scale(1.07);
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.fx-circuit:hover .tl-top,
.bookmark-card:hover .icon-tile.fx-circuit .tl-top { width: 70%; opacity: 1; }
.fx-circuit:hover .tl-bottom,
.bookmark-card:hover .icon-tile.fx-circuit .tl-bottom { width: 70%; opacity: 1; }
.fx-circuit:hover .tl-left,
.bookmark-card:hover .icon-tile.fx-circuit .tl-left { height: 60%; opacity: 1; }
.fx-circuit:hover .tl-right,
.bookmark-card:hover .icon-tile.fx-circuit .tl-right { height: 60%; opacity: 1; }

/* 6. Option H: Tesla Plasma Arc */
.fx-tesla {
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s;
}

.fx-tesla:hover,
.bookmark-card:hover .icon-tile.fx-tesla {
  transform: scale(1.08);
  border-color: #ec4899;
  animation: teslaJitter 0.12s infinite;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.6), inset 0 0 8px rgba(236, 72, 153, 0.3);
}

@keyframes teslaJitter {
  0% { box-shadow: 0 0 12px #ec4899, 0 0 24px #38bdf8; }
  50% { box-shadow: 0 0 20px #38bdf8, 0 0 12px #ec4899; }
  100% { box-shadow: 0 0 14px #ec4899, 0 0 22px #a855f7; }
}

/* 7. Option J: Quantum Portal Ripple */
.fx-portal {
  position: relative;
  transition: transform 0.3s ease;
}

.fx-portal .portal-ring {
  position: absolute;
  inset: -4px;
  border-radius: 20px;
  border: 2px solid #6366f1;
  opacity: 0;
  pointer-events: none;
}

.fx-portal:hover,
.bookmark-card:hover .icon-tile.fx-portal {
  transform: scale(1.08);
  border-color: #6366f1;
}

.fx-portal:hover .portal-ring-1,
.bookmark-card:hover .icon-tile.fx-portal .portal-ring-1 {
  animation: portalWave 1.4s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.fx-portal:hover .portal-ring-2,
.bookmark-card:hover .icon-tile.fx-portal .portal-ring-2 {
  animation: portalWave 1.4s cubic-bezier(0.1, 0.8, 0.3, 1) infinite 0.45s;
}

@keyframes portalWave {
  0% {
    transform: scale(0.9);
    opacity: 0.9;
    border-color: #38bdf8;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
    border-color: #ec4899;
  }
}

/* 8. Option L: Cyber Matrix Rain */
.fx-matrix {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s;
}

.fx-matrix .matrix-dots {
  position: absolute;
  inset: 0;
  background: radial-gradient(#10b981 15%, transparent 16%), radial-gradient(#10b981 15%, transparent 16%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fx-matrix:hover,
.bookmark-card:hover .icon-tile.fx-matrix {
  transform: scale(1.08);
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.fx-matrix:hover .matrix-dots,
.bookmark-card:hover .icon-tile.fx-matrix .matrix-dots {
  opacity: 0.35;
  animation: matrixFall 1.2s linear infinite;
}

@keyframes matrixFall {
  0% { background-position: 0 0, 4px 4px; }
  100% { background-position: 0 24px, 4px 28px; }
}

/* 9. Option N: Gyroscope 3D Orbital Rings */
.fx-gyro {
  position: relative;
  perspective: 400px;
  transition: transform 0.25s ease;
}

.fx-gyro .gyro-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.fx-gyro .gr-1 {
  border-top-color: #38bdf8;
  border-bottom-color: #38bdf8;
  transform: rotateX(60deg);
}

.fx-gyro .gr-2 {
  border-left-color: #ec4899;
  border-right-color: #ec4899;
  transform: rotateY(60deg);
}

.fx-gyro:hover,
.bookmark-card:hover .icon-tile.fx-gyro {
  transform: scale(1.08);
  border-color: rgba(56, 189, 248, 0.4);
}

.fx-gyro:hover .gr-1,
.bookmark-card:hover .icon-tile.fx-gyro .gr-1 {
  opacity: 1;
  animation: spinGyro1 2s linear infinite;
}

.fx-gyro:hover .gr-2,
.bookmark-card:hover .icon-tile.fx-gyro .gr-2 {
  opacity: 1;
  animation: spinGyro2 2.5s linear infinite;
}

@keyframes spinGyro1 {
  0% { transform: rotateX(65deg) rotateZ(0deg); }
  100% { transform: rotateX(65deg) rotateZ(360deg); }
}

@keyframes spinGyro2 {
  0% { transform: rotateY(65deg) rotateZ(0deg); }
  100% { transform: rotateY(65deg) rotateZ(360deg); }
}

/* 10. Option S: Starburst Lens Flare */
.fx-flare {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s;
}

.fx-flare .flare-streak {
  position: absolute;
  top: 50%;
  left: -100%;
  width: 300%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8 45%, #ffffff 50%, #38bdf8 55%, transparent);
  box-shadow: 0 0 12px #38bdf8;
  transform: translateY(-50%) rotate(-30deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.fx-flare:hover,
.bookmark-card:hover .icon-tile.fx-flare {
  transform: translateY(-4px) scale(1.08);
  border-color: #38bdf8;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.5);
}

.fx-flare:hover .flare-streak,
.bookmark-card:hover .icon-tile.fx-flare .flare-streak {
  opacity: 1;
  animation: flareSweep 1.2s ease-in-out infinite;
}

@keyframes flareSweep {
  0% { transform: translateY(-50%) translateX(-40%) rotate(-30deg); }
  100% { transform: translateY(-50%) translateX(40%) rotate(-30deg); }
}

/* 11. Option W: Circular Radar Ping */
.fx-radar {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s;
}

.fx-radar .radar-sweep {
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 270deg, rgba(34, 197, 94, 0.45) 360deg);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.fx-radar:hover,
.bookmark-card:hover .icon-tile.fx-radar {
  transform: scale(1.08);
  border-color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.fx-radar:hover .radar-sweep,
.bookmark-card:hover .icon-tile.fx-radar .radar-sweep {
  opacity: 1;
  animation: radarSpin 1.8s linear infinite;
}

@keyframes radarSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 12. Option Z: Neon 3D Wireframe Cage */
.fx-wireframe {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fx-wireframe .wf-box {
  position: absolute;
  inset: -6px;
  border: 1.5px dashed rgba(236, 72, 153, 0.7);
  border-radius: 18px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  transform: scale(0.9);
}

.fx-wireframe:hover,
.bookmark-card:hover .icon-tile.fx-wireframe {
  transform: scale(1.08);
  border-color: #ec4899;
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.4);
}

.fx-wireframe:hover .wf-box,
.bookmark-card:hover .icon-tile.fx-wireframe .wf-box {
  opacity: 1;
  transform: scale(1.05);
  animation: wireframeSpin 4s linear infinite alternate;
}

@keyframes wireframeSpin {
  0% { border-color: #ec4899; }
  50% { border-color: #38bdf8; }
  100% { border-color: #a855f7; }
}

/* 13. Option AB: 100% FULL PERIMETER SPEEDOMETER SWEEP */
.fx-tachometer {
  position: relative;
  overflow: visible;
  transition: transform 0.25s ease;
}

.fx-tachometer .tacho-svg {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  pointer-events: none;
  overflow: visible;
}

.fx-tachometer .tacho-track {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 2.5;
  fill: none;
  transition: stroke 0.25s ease;
}

body[data-theme="light"] .fx-tachometer .tacho-track {
  stroke: rgba(0, 0, 0, 0.08);
}

.fx-tachometer .tacho-fill {
  stroke: url(#tachoGrad);
  stroke-width: 2.8;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 4px #38bdf8);
}

.fx-tachometer:hover,
.bookmark-card:hover .icon-tile.fx-tachometer {
  transform: scale(1.08);
  border-color: transparent;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
}

/* 100% FULL LINE COVERAGE ON HOVER */
.fx-tachometer:hover .tacho-fill,
.bookmark-card:hover .icon-tile.fx-tachometer .tacho-fill {
  stroke-dashoffset: 0;
}

/* 14. Option AD: Liquid Plasma Lava Lamp */
.fx-lava {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.fx-lava .lava-blob {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.fx-lava .lb-1 {
  top: -10px;
  left: -10px;
  background: #ec4899;
}

.fx-lava .lb-2 {
  bottom: -10px;
  right: -10px;
  background: #38bdf8;
}

.fx-lava:hover,
.bookmark-card:hover .icon-tile.fx-lava {
  transform: translateY(-4px) scale(1.07);
  border-color: #ec4899;
  box-shadow: 0 10px 25px rgba(236, 72, 153, 0.35);
}

.fx-lava:hover .lava-blob,
.bookmark-card:hover .icon-tile.fx-lava .lava-blob {
  opacity: 0.75;
  animation: lavaFloat 3s ease-in-out infinite alternate;
}

@keyframes lavaFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(22px, 22px) scale(1.2); }
}

/* Glassmorphism Context Menu */
.aether-context-menu {
  position: fixed;
  z-index: 999999;
  background: var(--bg-card);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 0.35rem;
  min-width: 180px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: contextMenuFadeIn 0.12s ease;
  user-select: none;
}

@keyframes contextMenuFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  color: var(--text-main);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.context-menu-item:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #ffffff;
}

.context-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #ef4444;
}

.context-menu-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-weight: 600;
}

.context-menu-item.active::after {
  content: '✓';
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--accent-primary, #6366f1);
  font-weight: 800;
}

.context-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.25rem 0;
}

/* Quick Emoji Suggestions Palette */
.emoji-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.emoji-pill {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.emoji-pill:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-primary);
  transform: scale(1.15);
}

.add-bookmark-card {
  border: 1.5px dashed var(--border-hover);
  background: transparent;
  cursor: pointer;
}

.add-bookmark-card:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

/* ===================================================
   MULTI-COLUMN 12-COLUMN DASHBOARD GRID & MASONRY
   =================================================== */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}

/* Explicit Column Spans for Grid View */
.col-span-3  { grid-column: span 3; }
.col-span-4  { grid-column: span 4; }
.col-span-5  { grid-column: span 5; }
.col-span-6  { grid-column: span 6; }
.col-span-7  { grid-column: span 7; }
.col-span-8  { grid-column: span 8; }
.col-span-9  { grid-column: span 9; }
.col-span-12 { grid-column: span 12 !important; width: 100% !important; }

/* Masonry Waterfall Layout (Equal Columns) */
.widgets-grid.masonry-view {
  display: block !important;
  columns: 3 320px !important;
  column-gap: 1.25rem !important;
  width: 100%;
}

.widgets-grid.masonry-view .widget-card {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  width: 100%;
}

/* In Masonry mode, full-width widgets span across all 3 columns */
.widgets-grid.masonry-view .col-span-12 {
  column-span: all !important;
  width: 100% !important;
  display: flex !important;
}

.widget-card.widget-hidden,
.widget-hidden,
.widget-card[data-hidden="true"],
.hero-slot.widget-hidden {
  display: none !important;
}

@media (max-width: 1050px) {
  .widgets-grid.masonry-view {
    columns: 2 280px !important;
  }
}

@media (max-width: 600px) {
  .widgets-grid.masonry-view {
    columns: 1 !important;
  }
}

/* Grid View Switcher Bar */
.grid-view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding: 0 0.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.grid-view-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-main);
}

.grid-mode-pills {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.grid-mode-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.grid-mode-pill:hover {
  color: var(--text-main);
}

.grid-mode-pill.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4);
}

/* ===================================================
   ENHANCED WIDGET RESIZE SYSTEM & CORNER HANDLES
   =================================================== */
.widget-card {
  background: var(--bg-card);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s, grid-column 0.25s ease;
  position: relative;
  min-width: 0;
}

/* Widget Reordering Controls */
.widget-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.15rem 0.35rem;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border-color);
  transition: all 0.15s;
}

.widget-drag-handle:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
}

.widget-drag-handle:active {
  cursor: grabbing;
}

.widget-move-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}

.widget-move-btn:hover {
  color: #fff;
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  transform: translateY(-1px);
}

.widget-card.widget-dragging {
  opacity: 0.35;
  border: 2px dashed var(--accent-primary) !important;
}

.widget-card.widget-drag-over {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), inset 0 0 15px rgba(99, 102, 241, 0.15) !important;
  transform: scale(1.02);
}

/* Bottom-right Corner Drag / Click Resize Handle */
.widget-resize-handle {
  position: absolute;
  bottom: 3px;
  right: 4px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-faint);
  cursor: se-resize;
  user-select: none;
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s, transform 0.2s;
  z-index: 5;
}

.widget-card:hover .widget-resize-handle {
  opacity: 0.9;
  color: var(--accent-primary);
}

.widget-resize-handle:hover {
  opacity: 1;
  color: #fff;
  transform: scale(1.2);
}

/* Clear Segmented Size Control in Header */
.widget-size-control {
  display: inline-flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  user-select: none;
}

.widget-size-control .size-tag {
  font-size: 0.68rem;
  color: var(--text-faint);
  padding: 0 0.35rem;
  font-weight: 600;
}

.widget-size-control .btn-size-step {
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.widget-size-control .btn-size-step:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.widget-size-control .btn-size-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}

.widget-size-control .btn-size-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.widget-size-control .btn-size-pill.active {
  background: var(--accent-primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4);
}

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

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.6rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.widget-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 7px;
  font-size: 0.725rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-chip:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

/* ===================================================
   1. Live Currency & Crypto Widget (Compact & Clean)
   =================================================== */
.currency-tabs {
  display: flex;
  gap: 0.4rem;
}

.currency-tab-btn {
  flex: 1;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.currency-tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.rates-ticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.45rem;
}

.rate-badge {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  display: flex;
  position: relative;
  flex-direction: column;
  gap: 0.15rem;
}

.rate-badge .pair {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rate-badge .value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.rate-badge .trend {
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.trend.up { color: var(--accent-success); }
.trend.down { color: var(--accent-danger); }

/* Currency Converter Card */
.converter-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.converter-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.converter-input {
  flex: 1;
  min-width: 80px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 0.35rem 0.5rem;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
}

.converter-select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 0.35rem 0.5rem;
  color: var(--text-main);
  font-size: 0.8rem;
  min-width: 80px;
  cursor: pointer;
}

.converter-swap {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.converter-swap:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.converter-result {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  font-weight: 500;
}

.converter-result strong {
  color: var(--accent-success);
  font-size: 0.95rem;
}

/* ===================================================
   2. Calendar & Google Hub (Balanced & Compact)
   =================================================== */
.calendar-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.calendar-month-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.calendar-nav-buttons {
  display: flex;
  gap: 0.25rem;
}

.cal-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
}

.cal-nav-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 0.2rem;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day-cell {
  aspect-ratio: 1.35;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  color: var(--text-muted);
  padding: 0;
}

.cal-day-cell:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.cal-day-cell.other-month {
  opacity: 0.25;
}

.cal-day-cell.today {
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 700;
}

.cal-day-cell.selected {
  background: var(--accent-primary);
  color: #fff;
}

.cal-day-cell .event-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-success);
  position: absolute;
  bottom: 2px;
}

.calendar-agenda-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
}

.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 95px;
  overflow-y: auto;
}

.agenda-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.55rem;
  border-radius: 7px;
  background: var(--bg-input);
  border-left: 3px solid var(--accent-primary);
  font-size: 0.78rem;
}

.agenda-item.work { border-left-color: #3b82f6; }
.agenda-item.personal { border-left-color: #ec4899; }
.agenda-item.google { border-left-color: #10b981; }

.agenda-time {
  font-size: 0.7rem;
  color: var(--text-faint);
}

.google-hub-strip {
  display: flex;
  gap: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-color);
  flex-wrap: wrap;
}

.google-app-pill {
  flex: 1;
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.35rem 0.45rem;
  border-radius: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.google-app-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--border-hover);
}

/* ===================================================
   3. Live Weather Widget
   =================================================== */
.weather-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.weather-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.weather-icon-huge {
  font-size: 2.2rem;
  color: #fbbf24;
}

.weather-temp-block {
  display: flex;
  flex-direction: column;
}

.weather-temp {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.weather-condition {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.weather-location {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--accent-primary);
  cursor: pointer;
}

.weather-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
}

.weather-metric-label {
  font-size: 0.65rem;
  color: var(--text-faint);
}

.weather-metric-val {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.forecast-strip {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  padding-top: 0.25rem;
}

.forecast-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===================================================
   4. To-Do Tasks Widget
   =================================================== */
.todo-input-row {
  display: flex;
  gap: 0.4rem;
}

.todo-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 0.35rem 0.65rem;
  color: var(--text-main);
  font-size: 0.8rem;
  min-width: 0;
}

.todo-add-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0 0.75rem;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 190px;
  overflow-y: auto;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.55rem;
  border-radius: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.todo-item:hover {
  border-color: var(--border-hover);
}

.todo-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.todo-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.todo-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-text.completed {
  text-decoration: line-through;
  color: var(--text-faint);
}

.todo-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0 0.25rem;
}

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

/* ===================================================
   5. Scratchpad & Pomodoro
   =================================================== */
.scratchpad-area {
  width: 100%;
  height: 140px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.825rem;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

.scratchpad-area:focus {
  border-color: var(--accent-primary);
}

.scratchpad-status {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.pomo-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
}

.pomo-time {
  font-size: 2.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  line-height: 1;
}

.pomo-controls {
  display: flex;
  gap: 0.4rem;
}

.pomo-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 7px;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pomo-btn.primary {
  background: var(--accent-primary);
  color: white;
}

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

/* News & Trends Widget */
.news-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  max-height: 240px;
}

.news-item-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s;
}

.news-item-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateX(2px);
}

.news-item-title {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-meta {
  font-size: 0.68rem;
  color: var(--text-faint);
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

/* Prevent background page from scrolling when modal or drawer is open */
body:has(.modal-backdrop.active),
body.modal-open,
body:has(.settings-drawer.active) {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

/* Modals & Settings Drawer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overscroll-behavior: contain;
}

.modal-backdrop.active {
  display: flex;
}

.modal-backdrop.active .modal-box {
  animation: modalScaleUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from {
    transform: scale(0.94);
    opacity: 0.5;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-box {
  background: #111827;
  border: 1px solid var(--border-hover);
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: #f1f5f9;
}

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

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 0.45rem 0.65rem;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

/* Keyboard hint indicators in modals */
.kbd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-family: inherit;
  font-weight: 600;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  color: var(--text-muted);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  letter-spacing: 0.02em;
}

.btn-kbd-sub {
  font-size: 0.64rem;
  opacity: 0.85;
  font-weight: 600;
  margin-left: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-block;
  line-height: 1.1;
  vertical-align: middle;
}

#note-confirm-btn-submit:focus-visible,
#note-confirm-btn-cancel:focus-visible {
  outline: 2px solid #ffffff !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5) !important;
}

/* Settings Drawer */
.settings-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 380px;
  height: 100vh;
  background: #0f172a;
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 110;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.settings-drawer.open {
  right: 0;
}

.drawer-header {
  position: sticky;
  top: -1.25rem;
  z-index: 10;
  background: inherit;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-top: -1.25rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}

.drawer-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 105;
  display: none;
}

.drawer-overlay.active {
  display: block;
}

.theme-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.theme-btn {
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.theme-btn:hover, .theme-btn.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.8rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--accent-primary);
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
  border-radius: 16px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-success);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ===================================================
   RESPONSIVE MEDIA QUERIES (TABLET & MOBILE BREAKPOINTS)
   =================================================== */

/* ===================================================
   RESPONSIVE MEDIA QUERIES (TABLET & MOBILE BREAKPOINTS)
   =================================================== */

/* Tablet & Intermediate Screens (769px - 1024px) */
@media (max-width: 1024px) {
  .col-span-8, .col-span-9 { grid-column: span 12; }
  .col-span-6 { grid-column: span 6; }
  .col-span-4 { grid-column: span 6; }
  .groups-container { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile & Small Tablets Responsive Header (<= 860px) */
@media (max-width: 860px) {
  .app-header {
    padding: 0.45rem 0.75rem 0.55rem 0.75rem;
  }

  .header-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem 0.5rem;
    position: relative;
    min-height: auto;
  }

  .logo-area {
    order: 1;
    z-index: 10;
  }

  .logo-text {
    font-size: 1.05rem;
  }

  .header-actions {
    order: 2;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    z-index: 10;
  }

  .header-actions .btn-icon {
    width: 32px;
    height: 32px;
  }

  /* Reset absolute positioning on mobile to prevent overlapping logo or buttons */
  .profiles-bar,
  body.header-scrolled .profiles-bar {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    order: 3 !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0.25rem auto 0 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 0.2rem 0.35rem !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-card) !important;
    box-shadow: var(--shadow-sm) !important;
  }

  #profiles-list {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    justify-content: center;
  }

  .header-scrolled-clocks,
  .header-scrolled-tools {
    display: none !important;
  }
}

/* Mobile & Small Tablets (<= 768px) */
@media (max-width: 768px) {

  .dashboard-main {
    margin: 0.75rem auto 2rem auto;
    padding: 0 0.65rem;
    gap: 1.25rem;
  }

  /* Full-width Stacked Widgets on Mobile */
  .widgets-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .widget-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.85rem 0.95rem !important;
    box-sizing: border-box !important;
  }

  /* Hide Desktop Grid Size Pills on Mobile */
  .widget-size-control {
    display: none !important;
  }

  .widget-resize-handle {
    display: none !important;
  }

  .widget-header {
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .widget-title {
    font-size: 0.85rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Full-Screen Native Mobile Settings Drawer */
  .settings-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    right: -100vw !important;
    border-radius: 0;
    padding: 1rem;
    box-sizing: border-box;
    z-index: 99999;
  }

  .settings-drawer.open {
    right: 0 !important;
  }

  /* Calendar Widget Mobile Polish */
  .calendar-days-grid {
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 2px !important;
  }

  .calendar-weekdays {
    font-size: 0.65rem;
  }

  .cal-day-cell {
    min-height: 28px;
    font-size: 0.72rem !important;
    aspect-ratio: 1.1;
  }

  .google-hub-strip {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.35rem !important;
  }

  .google-app-pill {
    padding: 0.35rem 0.2rem !important;
    font-size: 0.7rem !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Currency Widget Mobile Polish */
  .currency-tabs {
    display: flex;
    gap: 0.35rem;
  }

  .currency-tab-btn {
    font-size: 0.72rem;
    padding: 0.35rem 0.4rem;
    white-space: normal;
  }

  .rates-ticker-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem !important;
  }

  .converter-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
    align-items: center !important;
  }

  .converter-input, .converter-select {
    flex: 1 1 80px;
    min-width: 70px;
  }

  .converter-swap {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    align-self: center;
  }

  /* Link Groups on Mobile */
  .groups-container {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .bookmarks-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
    gap: 0.45rem !important;
  }

  .bookmark-card {
    padding: 0.5rem 0.3rem;
  }

  .bookmark-icon-wrap {
    width: 32px;
    height: 32px;
  }

  .bookmark-title {
    font-size: 0.72rem;
  }

  /* Universal Search on Mobile */
  .search-container {
    max-width: 100%;
  }

  .search-bar {
    padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  }

  .search-input {
    font-size: 0.88rem;
  }

  .engine-pills {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .clock-time {
    font-size: 2.5rem;
  }

  .clock-time .seconds {
    font-size: 1.25rem;
  }

  .clock-date {
    font-size: 0.82rem;
  }

  .world-clocks-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }

  .weather-details-grid {
    grid-template-columns: repeat(3, 1fr);
    font-size: 0.7rem;
  }

  .modal-box {
    max-width: 95%;
    width: 95%;
    padding: 1rem;
  }

  .daily-briefing-toast {
    top: 4.25rem !important;
    right: 0.75rem !important;
    left: auto !important;
    width: calc(100vw - 1.5rem) !important;
  }
}

/* Small Smartphone View (<= 480px) */
@media (max-width: 480px) {
  .clock-time {
    font-size: 2.1rem;
  }

  .bookmarks-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .rates-ticker-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ===================================================
   REMINDER NOTIFICATIONS & BRIEFING TOAST
   =================================================== */
.header-badge {
  position: absolute;
  top: -6px;
  right: -7px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.daily-briefing-toast {
  position: fixed;
  top: 4.5rem;
  right: 1.5rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.25);
  padding: 1rem 1.25rem;
  max-width: 380px;
  width: calc(100vw - 3rem);
  z-index: 9999;
  animation: slideInToastTopRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

@keyframes slideInToastTopRight {
  from { opacity: 0; transform: translateY(-15px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.briefing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

.briefing-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.briefing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 0.3rem 0;
  color: var(--text-muted);
}

.briefing-item strong {
  color: var(--text-main);
  font-weight: 600;
}

.briefing-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.btn-goto-reminder {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}

.btn-goto-reminder:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* ==============================================
   DATE & TIME COUNTER WIDGETS
   ============================================== */

/* Filter Bar in Widget Headers */
.counter-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.3rem 0.1rem;
  flex-wrap: wrap;
}

.counter-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.counter-options-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.counter-format-group,
.counter-layout-group {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.ctrl-subtag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 0.35rem 0 0.25rem;
}

.date-filter-pill,
.time-filter-pill,
.date-format-pill,
.counter-layout-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.date-format-pill,
.counter-layout-pill {
  border-radius: 6px;
  border: none;
  background: transparent;
  padding: 0.2rem 0.45rem;
  font-size: 0.69rem;
}

.date-filter-pill:hover,
.time-filter-pill:hover,
.date-format-pill:hover,
.counter-layout-pill:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.08);
}

.date-filter-pill.active,
.time-filter-pill.active,
.date-format-pill.active,
.counter-layout-pill.active {
  background: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px var(--accent-glow);
}

.btn-filter-add {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-filter-add:hover {
  background: var(--bg-surface);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Containers for n Cards: Square / Rectangle Tiles (2-3 or 4 per row!) */
.date-counters-container,
.time-counters-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 0.65rem;
  margin-top: 0.35rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Wide Cards Layout Override */
.date-counters-container.layout-cards,
.time-counters-container.layout-cards {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Individual Date Counter Tile / Card */
.date-counter-card {
  background: var(--bg-surface, rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  position: relative;
  overflow: hidden;
  min-height: 125px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.date-counter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, #6366f1);
  opacity: 0.95;
}

.date-counter-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Header inside Tile */
.counter-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.tile-format-indicator {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  line-height: 1.2;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.counter-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.counter-emoji {
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.counter-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

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

.counter-category {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.counter-card-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.btn-icon-mini {
  background: transparent;
  border: none;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-icon-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  transform: scale(1.15);
}

.btn-icon-mini.btn-icon-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Hero Center Displays for Tiles */
.counter-body-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.counter-body-wrap.clickable {
  cursor: pointer;
  border-radius: 8px;
  padding: 0.15rem 0.25rem;
  transition: transform 0.15s ease, background 0.15s ease;
  user-select: none;
}

.counter-body-wrap.clickable:hover {
  background: rgba(255, 255, 255, 0.035);
  transform: scale(1.02);
}

.counter-body-wrap.clickable:active {
  transform: scale(0.98);
}

/* Compact Days Hero Display */
.tile-hero-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.25rem;
}

.tile-hero-number {
  font-family: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace, sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -1px;
}

.tile-hero-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: 0.8px;
  margin-top: 0.25rem;
  text-transform: uppercase;
}

/* D:H Display */
.tile-dh-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.2rem;
  flex-wrap: wrap;
}

.dh-item {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.dh-num {
  font-family: monospace;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.dh-unit {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tile-dh-sub {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  margin-left: 2px;
}

/* Y•M•D & M•D Displays */
.tile-ymd-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.25rem 0.15rem;
  width: 100%;
}

.ymd-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  padding: 0.25rem 0.2rem;
  flex: 1;
  min-width: 0;
}

.ymd-num {
  font-family: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace, sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.ymd-unit {
  font-size: 0.52rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.5px;
  margin-top: 0.15rem;
  text-transform: uppercase;
}

.tile-ymd-sublabel {
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-align: center;
  margin-top: 0.1rem;
}

/* Footer strip in Tile */
.tile-footer-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.64rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.3rem;
  margin-top: 0.2rem;
}

.tile-category-tag {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.tile-badge-indicator {
  font-weight: 700;
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
}

.tile-badge-indicator.upcoming {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.tile-badge-indicator.past {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* 4-Box Date Ticker Grid (Compact Mode) */
.date-ticker-grid.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
  width: 100%;
}

.date-ticker-grid.compact .ticker-num {
  font-size: 0.95rem;
  font-weight: 700;
}

.date-ticker-grid.compact .ticker-unit {
  font-size: 0.52rem;
  margin-top: 0.15rem;
}

.date-ticker-grid.compact .ticker-colon {
  font-size: 0.85rem;
  padding-bottom: 0.4rem;
}

/* ==============================================
   TIME COUNTER TILES & CARDS
   ============================================== */
.time-counter-card {
  background: var(--bg-surface, rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  position: relative;
  overflow: hidden;
  min-height: 125px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.time-counter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, #6366f1);
  opacity: 0.95;
}

.time-counter-card.running {
  border-color: var(--accent-primary);
  box-shadow: 0 0 14px var(--accent-glow);
}

.time-counter-card.finished {
  border-color: #ef4444;
  animation: timerPulse 1.2s infinite;
}

.time-display-hero.compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.45rem 0.35rem;
  position: relative;
}

.time-counter-card.tile-mode .time-digits {
  font-family: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.5px;
  line-height: 1;
}

.time-finished-banner {
  margin-top: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  animation: bounce 0.8s infinite alternate;
}

/* Control Bar Compact */
.time-control-bar.compact {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.time-counter-card.tile-mode .btn-time-play {
  flex: 1.6;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.32rem 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
  line-height: 1;
}

.time-counter-card.tile-mode .btn-time-play:hover {
  filter: brightness(1.12);
}

.time-counter-card.tile-mode .btn-time-play.running {
  background: #f59e0b;
}

.time-counter-card.tile-mode .btn-time-ctrl {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 6px;
  padding: 0.32rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.time-counter-card.tile-mode .btn-time-ctrl:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

/* Color Accents for Cards */
.accent-indigo { --card-accent: #6366f1; }
.accent-purple { --card-accent: #a855f7; }
.accent-emerald { --card-accent: #10b981; }
.accent-rose { --card-accent: #f43f5e; }
.accent-amber { --card-accent: #f59e0b; }
.accent-cyan { --card-accent: #06b6d4; }

/* Empty State */
.counter-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
}

.counter-empty-icon {
  font-size: 1.8rem;
  margin-bottom: 0.35rem;
  opacity: 0.7;
}

.counter-empty-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.counter-empty-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  max-width: 320px;
  margin-bottom: 0.75rem;
}

.btn-primary-sm {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.32rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary-sm:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.counter-badge-count {
  font-weight: 800;
}

/* =========================================================
   STARDUST DISINTEGRATION & REASSEMBLY (MICRO-DUST SWARM)
   ========================================================= */
/* =========================================================
   ADMIN PANEL MODAL STYLES
   ========================================================= */
.admin-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.admin-tab-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.admin-tab-btn:hover:not(.active) {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  transition: background 0.15s ease;
}

.admin-user-row:last-child {
  border-bottom: none;
}

.admin-user-row:hover {
  background: var(--bg-card-hover);
}

.admin-role-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.admin-role-badge.admin {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.admin-role-badge.user {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-del-user {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.82rem;
  opacity: 0.75;
  transition: all 0.15s ease;
}

.btn-del-user:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.15);
}

/* Live Dedicated HTML Background Canvas */
.live-wallpaper-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.65;
  transition: opacity 0.5s ease;
}

/* Settings Drawer Collapsible Sections */
.settings-collapsible-section {
  border-top: 1px solid var(--border-color);
  padding: 0.7rem 0;
  transition: all 0.2s ease;
}

.settings-collapsible-section:first-of-type {
  border-top: none;
  padding-top: 0.2rem;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 0.25rem 0.2rem;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.settings-section-header:hover {
  background: var(--bg-card-hover);
}

.settings-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.settings-section-chevron {
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  display: inline-block;
}

.settings-collapsible-section.collapsed .settings-section-chevron {
  transform: rotate(-90deg);
}

.settings-collapsible-section.collapsed .settings-section-content {
  display: none !important;
}

.settings-section-content {
  margin-top: 0.65rem;
}

.wp-select-btn {
  justify-content: center;
  padding: 0.4rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wp-select-btn.active {
  background: linear-gradient(135deg, #4f46e5, #06b6d4) !important;
  color: #fff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

#dust-particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
}

/* Dissolving micro-dust effect on HTML Elements */
.dust-dissolving {
  filter: blur(8px) contrast(1.2) brightness(1.3) !important;
  opacity: 0 !important;
  transform: scale(0.92) !important;
  transition: filter 0.5s ease-out, opacity 0.5s ease-out, transform 0.5s ease-out !important;
}

/* Coalescence & landing sparkle on arrival */
.dust-reassembling {
  animation: reassembleSparkle 0.5s ease-out forwards;
}

@keyframes reassembleSparkle {
  0% {
    filter: blur(6px) drop-shadow(0 0 16px #38bdf8);
    opacity: 0.3;
    transform: scale(0.92);
  }
  70% {
    filter: drop-shadow(0 0 12px var(--accent-primary));
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    filter: none;
    opacity: 1;
    transform: scale(1);
  }
}
