/* =============================================================================
   JUNGHAHN LABS - DESIGN SYSTEM & BLUE-DARK FROSTED GLASS THEME
   High-Precision Translucent Glassmorphism Command Centre
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. DESIGN TOKENS & PALETTE
   ----------------------------------------------------------------------------- */
:root {
  /* Dynamic Glassmorphism Controls */
  --glass-opacity: 0.72;
  --glass-blur: 24px;

  /* Refined React Bits Obsidian Glass Surfaces */
  --glass-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(13, 20, 36, 0.65) 40%, rgba(6, 11, 22, 0.82) 100%);
  --glass-bg-hover: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(18, 28, 52, 0.75) 40%, rgba(8, 14, 28, 0.90) 100%);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-top: rgba(255, 255, 255, 0.20);
  --glass-border-hover: rgba(56, 189, 248, 0.40);
  --glass-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.16), inset 0 -1px 2px rgba(0, 0, 0, 0.45);

  /* Status Colors */
  --status-active: #22c55e;
  --status-active-bg: rgba(34, 197, 94, 0.16);
  --status-active-border: rgba(34, 197, 94, 0.45);
  --status-warning: #f59e0b;
  --status-error: #ef4444;

  /* Accent Tones */
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-orange: #f97316;
  --accent-blue: #38bdf8;
  --accent-green: #10b981;

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Geometry & Typography */
  --radius-card: 14px;
  --radius-badge: 5px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

/* -----------------------------------------------------------------------------
   2. RESET & BASE LAYOUT
   ----------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  background-color: #0f1013 !important;
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

body {
  min-height: 100%;
  background-color: #0f1013 !important;
  background-image: none !important;
  color: var(--text-primary);
  font-family: var(--font-sans);
  position: relative;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* 1. Base Hardware-Accelerated Wallpaper Layer (Fixed GPU surface) */
#bgLayer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: #0d0e11;
  background-image: url('../assets/wallpaper.jpg?v=55.0');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: strict;
  opacity: 1;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

/* 2. Deep Vignette & Translucent Tint Overlay (Sits directly on top of wallpaper) */
#bgOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(2, 4, 9, 0.05) 0%, rgba(2, 4, 9, 0.65) 100%);
  pointer-events: none;
  z-index: 1;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  contain: strict;
}

/* 3. Interactive Particles Canvas (Sits in front of overlay for crisp starlight glow) */
#particlesCanvas,
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  contain: strict;
}

/* 4. Main Application Dashboard (Interactive UI layer) */
#app {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 2.5rem;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(6, 12, 22, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* -----------------------------------------------------------------------------
   3. TOP HEADER BAR
   ----------------------------------------------------------------------------- */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 2.5rem 0.85rem 2.5rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.brand:hover .brand-avatar {
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}

.header-greeting {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 0.85rem;
}

/* Center Telemetry Capsule in Header */
.header-telemetry {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-card);
  padding: 0.38rem 1.05rem;
  box-shadow: var(--glass-shadow);
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.telemetry-icon {
  width: 17px;
  height: 17px;
  color: var(--text-secondary);
}

.telemetry-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.telemetry-meter {
  width: 42px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.telemetry-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 2px;
}

/* Header Right: Clock & Controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Live Clock Capsule */
.clock-capsule {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-card);
  padding: 0.38rem 0.95rem;
  font-size: 0.82rem;
  box-shadow: var(--glass-shadow);
}

.clock-time {
  font-weight: 700;
  color: #ffffff;
}

.clock-date {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Action Control Buttons */
.header-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-card);
  color: var(--text-secondary);
  padding: 0.42rem 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(var(--glass-blur));
  transition: all 0.2s ease;
}

.header-btn:hover {
  background: var(--glass-bg-hover);
  color: #ffffff;
  border-color: var(--glass-border-hover);
}

/* -----------------------------------------------------------------------------
   4. MAIN DASHBOARD 3-COLUMN GRID
   ----------------------------------------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.5rem 2.5rem;
  width: 100%;
  align-items: start;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Group Section */
.group-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
}

.group-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.group-icon {
  width: 17px;
  height: 17px;
  color: var(--text-secondary);
}

/* -----------------------------------------------------------------------------
   5. FROSTED GLASS SERVICE CARDS
   ----------------------------------------------------------------------------- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-card);
  box-shadow: var(--glass-shadow);
  padding: 0.85rem 1.05rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* Card Header */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0 !important;
}

.widget-body-content {
  margin-top: 0.75rem;
}

.service-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.service-icon-wrap {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  border-radius: 8px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0 !important;
}

.service-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.service-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1.25;
}

.service-name {
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: #ffffff;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.service-subtitle {
  font-size: 0.75rem !important;
  color: var(--text-secondary);
  line-height: 1.25 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.5rem;
  border-radius: var(--radius-badge);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-badge.healthy,
.status-badge.active,
.status-badge.running,
.status-badge.online {
  background: var(--status-active-bg);
  border: 1px solid var(--status-active-border);
  color: var(--status-active);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.25);
}

/* -----------------------------------------------------------------------------
   6. PI-HOLE / NETWORK STATS & DONUT CHART
   ----------------------------------------------------------------------------- */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  margin-top: 0.75rem;
  text-align: center;
}

.metric-box {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.metric-val {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
}

.metric-lbl {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Pi-hole Donut Chart Area */
.pihole-donut-area {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.85rem;
  padding: 0.35rem 0.25rem;
}

.donut-container {
  position: relative;
  width: 86px;
  height: 86px;
  flex-shrink: 0;
}

.donut-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.donut-bg {
  fill: none;
  stroke: #22c55e;
  stroke-width: 10;
}

.donut-segment {
  fill: none;
  stroke: #ef4444;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dasharray 0.5s ease;
}

.donut-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-pct {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
}

.donut-sub {
  font-size: 0.56rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
}

.legend-label-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.legend-dot.green { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }

.legend-label {
  color: var(--text-secondary);
}

.legend-val {
  font-weight: 600;
  color: #ffffff;
}

/* -----------------------------------------------------------------------------
   7. MONITORING GAUGES (3 CIRCULAR RADIAL RINGS)
   ----------------------------------------------------------------------------- */
.monitoring-card {
  padding: 1rem 1.1rem;
}

.monitoring-rings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  text-align: center;
  margin-top: 0.65rem;
}

.radial-gauge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.radial-container {
  position: relative;
  width: 76px;
  height: 76px;
}

.radial-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.radial-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.radial-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.radial-fill.cpu { stroke: var(--accent-cyan); filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.6)); }
.radial-fill.ram { stroke: var(--accent-purple); filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.6)); }
.radial-fill.disk { stroke: var(--accent-orange); filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.6)); }

.radial-center-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.90rem;
  font-weight: 800;
  color: #ffffff;
}

.radial-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
}

.radial-detail {
  font-size: 0.64rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.sparkline-micro {
  width: 48px;
  height: 14px;
  margin-top: 2px;
}

/* -----------------------------------------------------------------------------
   8. INFRASTRUCTURE & AUTHENTICATION STATS CARDS
   ----------------------------------------------------------------------------- */
.stats-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  margin-top: 0.65rem;
  text-align: center;
}

.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  margin-top: 0.65rem;
  text-align: center;
}

/* -----------------------------------------------------------------------------
   9. APPLICATIONS LAUNCHER LIST
   ----------------------------------------------------------------------------- */
.app-launcher-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: 8px;
  padding: 0.62rem 0.95rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.app-row:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-1.5px);
}

.app-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-icon {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-chevron {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.app-row:hover .app-chevron {
  transform: translateX(3px);
  color: #ffffff;
}

.view-all-apps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.35rem;
  width: 100%;
}

.view-all-apps-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* -----------------------------------------------------------------------------
   10. SYSTEM INFO 2-COLUMN TABLE GRID
   ----------------------------------------------------------------------------- */
.sysinfo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem 1.2rem;
  padding: 0.4rem 0.2rem;
}

.sysinfo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.35rem;
}

.sysinfo-key {
  color: var(--text-muted);
}

.sysinfo-val {
  font-weight: 600;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

/* -----------------------------------------------------------------------------
   11. MIDDLE TIER (2-COLUMN BALANCED SECTION: STORAGE & RESOURCES)
   ----------------------------------------------------------------------------- */
.middle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
  max-width: 1600px;
  margin: 1.35rem auto 0 auto;
  padding: 0 2.5rem;
  width: 100%;
}

/* -----------------------------------------------------------------------------
   12. LOWER TIER: DYNAMIC USER-EDITABLE BOOKMARKS
   ----------------------------------------------------------------------------- */
.bookmarks-container {
  max-width: 1600px;
  margin: 1.35rem auto 0 auto;
  padding: 0 2.5rem;
  width: 100%;
}

.bookmarks-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding: 0 0.25rem;
}

.bookmarks-section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.35rem;
  width: 100%;
}

.bookmark-group-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-card);
  padding: 0.95rem 1.05rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bookmark-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bookmark-group-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.bookmark-group-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bm-cat-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.bm-cat-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.bookmark-rows-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.bookmark-row {
  display: flex;
  align-items: center;
  background: rgba(14, 24, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  overflow: hidden;
  transition: all 0.18s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
}

.bookmark-row:hover {
  background: rgba(20, 35, 60, 0.65);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.bookmark-link {
  display: flex;
  align-items: center;
  flex: 1;
  text-decoration: none;
  color: inherit;
  padding: 0.45rem 0.65rem 0.45rem 0;
  min-width: 0;
}

.bookmark-icon-box {
  width: 34px;
  height: 34px;
  background: rgba(0, 0, 0, 0.35);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 0.65rem;
  overflow: hidden;
}

.bookmark-favicon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}

.bookmark-row:hover .bookmark-favicon-img {
  transform: scale(1.15);
}

.bookmark-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.bookmark-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-domain {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: auto;
  padding-right: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.bookmark-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.15s ease, color 0.15s ease;
  margin-right: 0.35rem;
}

.bookmark-row:hover .bookmark-arrow {
  color: #38bdf8;
  transform: translate(2px, -2px);
}

.bookmark-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding-right: 0.45rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.bookmark-row:hover .bookmark-actions {
  opacity: 1;
}

.bm-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.22rem 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.bm-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.bm-btn.bm-del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

.add-bookmark-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 0.42rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  margin-top: 0.2rem;
  width: 100%;
}

.add-bookmark-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
}

.action-pill-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  color: #38bdf8;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.action-pill-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
}

/* -----------------------------------------------------------------------------
   12. INTERACTIVE WIDGETS (TODO, NOTES, TERMINAL)
   ----------------------------------------------------------------------------- */
.extra-widgets-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.35rem;
  max-width: 1600px;
  margin: 1.5rem auto 0 auto;
  padding: 0 2.5rem;
  width: 100%;
}

/* Terminal Widget */
.terminal-card {
  background: rgba(8, 14, 24, 0.85);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: var(--radius-card);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.85rem 1rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.45rem;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.terminal-dots {
  display: flex;
  gap: 5px;
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.terminal-dot.r { background: #ef4444; }
.terminal-dot.y { background: #f59e0b; }
.terminal-dot.g { background: #22c55e; }

.terminal-body {
  min-height: 100%;
  background-color: #0f1013 !important;
  background-image: none !important;
  color: var(--text-primary);
  font-family: var(--font-sans);
  position: relative;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.terminal-prompt {
  color: #22c55e;
  font-weight: 700;
}

.terminal-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  width: 100%;
  outline: none;
}

/* Todo & Notes Widgets */
.todo-input-row, .note-input-row {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.widget-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
  outline: none;
}

.widget-btn {
  background: var(--accent-purple);
  border: none;
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0 0.75rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.widget-btn:hover {
  opacity: 0.85;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 160px;
  overflow-y: auto;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
}

.todo-item.done span {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.todo-del-btn:hover {
  color: #ef4444;
}

/* -----------------------------------------------------------------------------
   13. MODALS & OVERLAYS
   ----------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.50);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: rgba(14, 24, 40, 0.90);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-top);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.12);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  width: 92%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1.35rem;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-content::-webkit-scrollbar {
  width: 5px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.6);
}

.modal-backdrop.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.65rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.35rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #ffffff;
}

/* Settings Tabs Navigation & Categorization */
.settings-tabs-nav {
  display: flex;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.32);
  padding: 0.28rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.15rem;
}

.settings-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0.45rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.settings-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.settings-tab-pane {
  display: none;
  flex-direction: column;
  gap: 1.05rem;
}

.settings-tab-pane.active {
  display: flex;
}

/* -----------------------------------------------------------------------------
   14. UNIFIED DASHBOARD CANVAS & RESPONSIVE BREAKPOINTS
   ----------------------------------------------------------------------------- */
.dashboard-canvas {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 1.35rem !important;
  max-width: 1600px;
  margin: 1.35rem auto 2.5rem auto;
  padding: 0 2.5rem;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-col {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  overflow: visible !important;
}

.dashboard-widget-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  overflow: visible !important;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.22s ease;
}

.dashboard-widget-wrapper:hover {
  z-index: 25 !important;
}

.dashboard-widget-wrapper .bookmarks-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.drag-grip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: grab;
}

.drag-grip:active {
  cursor: grabbing;
}

.resize-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.resize-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

.resize-pill-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.45rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.resize-pill-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.resize-pill-btn.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .header-bar {
    padding: 1rem 1.5rem;
  }
  .dashboard-canvas {
    padding: 0 1.5rem;
    gap: 1.15rem;
  }
}

@media (max-width: 1024px) {
  .dashboard-canvas {
    grid-template-columns: repeat(6, 1fr);
  }
  .dashboard-widget-wrapper[data-span="4"] {
    grid-column: span 3 !important;
  }
  .dashboard-widget-wrapper[data-span="6"] {
    grid-column: span 6 !important;
  }
  .dashboard-widget-wrapper[data-span="8"] {
    grid-column: span 6 !important;
  }
  .dashboard-widget-wrapper[data-span="12"] {
    grid-column: span 6 !important;
  }
  .bookmarks-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .dashboard-canvas {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 1rem !important;
    gap: 1.15rem !important;
  }
  .dashboard-col {
    width: 100% !important;
    gap: 1.15rem !important;
  }
  .dashboard-widget-wrapper {
    grid-column: span 12 !important;
    width: 100%;
  }
  .bookmarks-grid {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------------------------
   15. PI-HOLE MANUAL REFRESH BUTTON & SPINNER
   ----------------------------------------------------------------------------- */
.pihole-refresh-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 0.70rem;
  font-weight: 600;
  padding: 0.24rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pihole-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.30);
  transform: translateY(-1px);
}

.refresh-icon.spinning {
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* -----------------------------------------------------------------------------
   16. HOMESCREEN LAYOUT EDITOR & DRAG-AND-DROP STYLES
   ----------------------------------------------------------------------------- */
.layout-edit-banner {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  transition: all 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  pointer-events: none;
  opacity: 0;
  width: 90%;
  max-width: 720px;
}

.layout-edit-banner.active {
  top: 1.25rem;
  opacity: 1;
  pointer-events: auto;
}

.layout-edit-banner-content {
  background: rgba(14, 24, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-top: 1px solid rgba(56, 189, 248, 0.8);
  border-radius: var(--radius-card);
  padding: 0.75rem 1.25rem;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.layout-edit-banner-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: #ffffff;
}

.layout-edit-pulse {
  width: 9px;
  height: 9px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 10px #38bdf8;
  animation: pulseEdit 1.5s infinite;
}

@keyframes pulseEdit {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

.layout-edit-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 400;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 0.65rem;
}

.layout-edit-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

/* Edit mode active states on cards */
body.layout-edit-mode [data-widget-id] {
  cursor: grab;
  user-select: none;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

body.layout-edit-mode [data-widget-id]:active {
  cursor: grabbing;
}

body.layout-edit-mode [data-widget-id] .group-section,
body.layout-edit-mode [data-widget-id].glass-card {
  border: 1px dashed rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15) !important;
}

.widget-drag-handle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(14, 24, 42, 0.95);
  border: 1px dashed rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #38bdf8;
  margin-bottom: 0.5rem;
}

body.layout-edit-mode .widget-drag-handle {
  display: flex;
}

.widget-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.remove-widget-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 4px;
  color: #f87171;
  cursor: pointer;
  padding: 0.18rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.remove-widget-btn:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Edit Mode Blueprint Matrix Background on Dashboard Canvas */
body.layout-edit-mode .dashboard-canvas {
  background-image: 
    linear-gradient(to right, rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.08) 1px, transparent 1px);
  background-size: calc((100% - 11 * 1.35rem) / 12 + 1.35rem) 70px;
  background-position: 0 0;
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 1.5rem 2.5rem;
  min-height: 500px;
  transition: all 0.3s ease;
}

body.layout-edit-mode .dashboard-widget-wrapper {
  cursor: grab;
  user-select: none;
  position: relative;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.22s ease, opacity 0.2s ease;
}

body.layout-edit-mode .dashboard-widget-wrapper:active {
  cursor: grabbing;
}

body.layout-edit-mode .dashboard-widget-wrapper.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.4) !important;
}

/* Grid Snap Target Ghost Placeholder */
.grid-snap-ghost {
  background: rgba(56, 189, 248, 0.06);
  border: 2px dashed #38bdf8;
  border-radius: var(--radius-card);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 25px rgba(56, 189, 248, 0.15), 0 0 15px rgba(56, 189, 248, 0.25);
  animation: ghostPulse 1.4s ease-in-out infinite alternate;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes ghostPulse {
  0% { border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.04); }
  100% { border-color: rgba(56, 189, 248, 0.9); background: rgba(56, 189, 248, 0.12); }
}

.ghost-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #38bdf8;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* -----------------------------------------------------------------------------
   17. TOAST NOTIFICATION
   ----------------------------------------------------------------------------- */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(14, 24, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-top: 1px solid rgba(56, 189, 248, 0.8);
  color: #ffffff;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.toast-notification.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* -----------------------------------------------------------------------------
   18. TOP QUICK LAUNCH LOGO DOCK (PURE ICONS & SQUIRCLE LIQUID GLASS TILES)
   ----------------------------------------------------------------------------- */
.top-dock-container {
  max-width: 1600px;
  margin: 0.85rem auto 0 auto;
  padding: 0 1rem;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.dock-glass-bar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(14, 25, 45, 0.65) 45%, rgba(7, 14, 28, 0.82) 100%);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 18px;
  padding: 0.35rem 0.55rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: calc(100vw - 2rem);
  min-width: 0;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
}

.dock-tiles-track {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  scroll-behavior: smooth;
  scrollbar-width: none;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  padding: 0.15rem 0.1rem;
  box-sizing: border-box;
  flex: 0 1 auto;
}

.dock-tiles-track::-webkit-scrollbar {
  display: none !important;
  width: 0;
  height: 0;
}

.dock-tile-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dock-item-edit-btn {
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0ea5e9;
  border: 2px solid #ffffff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75);
}



.dock-item-edit-btn:hover {
  background: #38bdf8;
  color: #0c182a;
  transform: scale(1.18);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.7);
}

.dock-item-del-btn {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #ffffff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75);
}

body.layout-edit-mode .dock-item-del-btn,
body.layout-edit-mode .dock-item-edit-btn {
  opacity: 1;
  pointer-events: auto;
}

.dock-item-del-btn:hover {
  background: #dc2626;
  transform: scale(1.2);
}

body.layout-edit-mode .dock-glass-bar {
  border: 1px dashed rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  animation: dockBlueprintGlow 3s infinite alternate ease-in-out;
}

@keyframes dockBlueprintGlow {
  0% { border-color: rgba(56, 189, 248, 0.35); }
  100% { border-color: rgba(56, 189, 248, 0.85); box-shadow: 0 0 30px rgba(56, 189, 248, 0.3); }
}

body.layout-edit-mode .dock-tile-wrapper {
  cursor: grab;
  user-select: none;
}

body.layout-edit-mode .dock-tile-wrapper:active {
  cursor: grabbing;
}

body.layout-edit-mode .dock-tile {
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

body.layout-edit-mode .dock-tile-icon,
body.layout-edit-mode .dock-tile-fallback {
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

body.layout-edit-mode .dock-item-edit-btn,
body.layout-edit-mode .dock-item-del-btn {
  pointer-events: auto;
}

.dock-tile-wrapper.is-dragging {
  opacity: 0.35;
  transform: scale(0.9);
}

.dock-snap-ghost {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 2px dashed #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
  flex-shrink: 0;
  animation: dockGhostPulse 1s infinite alternate ease-in-out;
}

@keyframes dockGhostPulse {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.05); opacity: 1; }
}

.dock-tile {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.dock-tile:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(56, 189, 248, 0.50);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.25);
  z-index: 10;
}

.dock-tile-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease;
  pointer-events: none;
}

.dock-tile:hover .dock-tile-icon {
  transform: scale(1.08);
}

.dock-tile-fallback {
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: var(--font-mono);
}

.dock-add-btn {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  display: none !important; /* Hidden by default in normal mode */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

body.layout-edit-mode .dock-add-btn {
  display: flex !important; /* Visible ONLY when in Edit Mode */
  animation: softFade 0.2s ease-out both;
}

.dock-add-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.65);
  color: #ffffff;
  transform: translateY(-2px) scale(1.06);
}

@media (max-width: 768px) {
  .top-dock-container {
    padding: 0 1rem;
  }
}

/* -----------------------------------------------------------------------------
   SPEEDTEST WIDGET STYLES & MICRO-ANIMATIONS
   ----------------------------------------------------------------------------- */
.spin-animation {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* -----------------------------------------------------------------------------
   SETTINGS SLIDERS & THEME CONTROLS
   ----------------------------------------------------------------------------- */
.theme-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.theme-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.theme-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.9);
}

.theme-range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  cursor: pointer;
}




/* =============================================================================
   25. SOFT SWEEPING ENTRANCE ANIMATIONS
   Silky-smooth, staggered Apple-style reveal on initial page load / refresh
   ============================================================================= */

@keyframes softSweepDown {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.99);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

@keyframes tileFadeIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softBloom {
  0% {
    opacity: 0.15;
    filter: blur(16px);
  }
  100% {
    opacity: 1;
    filter: blur(var(--wallpaper-blur, 4px));
  }
}

@keyframes softFade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Background wallpaper soft bloom */
#bgLayer {
  animation: softBloom 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Particles Canvas soft fade-in */
#particlesCanvas,
#particles-js {
  animation: softFade 1.4s ease-out 0.15s both;
}

/* Top Header Bar sweeps down softly */
.header-bar {
  animation: softSweepDown 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}

/* Top Quick Launch Dock sweeps up gracefully */
.top-dock-container {
  animation: softSweepUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.14s both;
}

/* Dashboard Widget Cards cascade smoothly one by one */
.dashboard-widget-wrapper {
  animation: tileFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dashboard-widget-wrapper:nth-child(1) { animation-delay: 0.02s; }
.dashboard-widget-wrapper:nth-child(2) { animation-delay: 0.04s; }
.dashboard-widget-wrapper:nth-child(3) { animation-delay: 0.06s; }
.dashboard-widget-wrapper:nth-child(4) { animation-delay: 0.08s; }
.dashboard-widget-wrapper:nth-child(n+5) { animation-delay: 0.10s; }

/* In layout edit mode, disable entrance animations for instant drag-and-drop */
body.layout-edit-mode .dashboard-widget-wrapper,
body.layout-edit-mode .header-bar,
body.layout-edit-mode .top-dock-container {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* Accessibility: respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .header-bar,
  .top-dock-container,
  .dashboard-widget-wrapper,
  #bgLayer,
  #particlesCanvas {
    animation: softFade 0.3s ease-out both !important;
    transform: none !important;
    filter: none !important;
  }
}



.dashboard-widget-wrapper { height: auto; }

.dashboard-widget-wrapper > .glass-card,
.dashboard-widget-wrapper > .group-section,
.dashboard-widget-wrapper > div:not(.widget-edit-controls),
.dashboard-widget-wrapper > a {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-widget-wrapper .glass-card {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 11px 1.05rem 1rem 1.05rem !important;
}

.dashboard-widget-wrapper textarea#notesContentArea {
  flex: 1;
  min-height: 150px;
  height: 100%;
}

.dashboard-widget-wrapper .todo-list {
  flex: 1;
  max-height: 240px;
  overflow-y: auto;
}

/* =============================================================================
 * TAB NAVIGATION BAR (Compact, Minimalist & Elegant)
 * ============================================================================= */
.tabs-nav-wrap {
  display: flex;
  justify-content: center;
  margin: 0.45rem 0 1.1rem 0;
  width: 100%;
}

.tabs-nav-bar {
  display: inline-flex;
  align-items: center;
  background: rgba(14, 16, 22, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  font-family: inherit;
  padding: 0.26rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Tab-based visibility preservation (prevents destroying DOM nodes & losing widget states) */
.dashboard-widget-wrapper.tab-hidden {
  display: none !important;
}

/* React Bits Tactile Film Grain Overlay */
.bg-noise-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Card Hover Spotlight Accent */
.glass-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.glass-card:hover {
  border-color: rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.08) !important;
}

/* Static Wallpaper permanently disabled in favor of live interactive canvas */


/* =============================================================================
   EMBER DUSK - AURA (MESH) SYSTEM
   Multi-layered organic glowing mesh with GPU-accelerated diffuse blurs
   ============================================================================= */

.aura-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 50% 30%, #0d0c12 0%, #060609 60%, #020204 100%);
}

.aura-layer {
  position: absolute;
  inset: -20%;
  width: 140%;
  height: 140%;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* Layer 1 - Deep Ember (Warm Orange) */
.aura-layer-1 {
  background: radial-gradient(circle at 30% 35%, rgba(234, 88, 12, 0.32) 0%, transparent 48%);
  filter: blur(140px);
  animation: auraDrift1 24s ease-in-out infinite alternate;
}

/* Layer 2 - Soft Dusk Amber */
.aura-layer-2 {
  background: radial-gradient(circle at 72% 30%, rgba(251, 146, 60, 0.24) 0%, transparent 45%);
  filter: blur(160px);
  animation: auraDrift2 28s ease-in-out infinite alternate;
}

/* Layer 3 - Crimson Wine Depth */
.aura-layer-3 {
  background: radial-gradient(circle at 50% 75%, rgba(185, 28, 28, 0.24) 0%, transparent 52%);
  filter: blur(200px);
  animation: auraDrift3 32s ease-in-out infinite alternate;
}

/* Layer 4 - Warm Saffron Gold */
.aura-layer-4 {
  background: radial-gradient(circle at 20% 80%, rgba(251, 191, 36, 0.16) 0%, transparent 40%);
  filter: blur(160px);
  animation: auraDrift4 26s ease-in-out infinite alternate;
}

@keyframes auraDrift1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3%, 2.5%) scale(1.05); }
  100% { transform: translate(-2.5%, 1.5%) scale(0.97); }
}

@keyframes auraDrift2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-3%, 3%) scale(1.04); }
  100% { transform: translate(2.5%, -2%) scale(0.98); }
}

@keyframes auraDrift3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(2.5%, -3%) scale(1.06); }
  100% { transform: translate(-2%, 2%) scale(0.96); }
}

@keyframes auraDrift4 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2%, -2%) scale(1.04); }
  100% { transform: translate(3%, 1.5%) scale(0.98); }
}


/* =============================================================================
   EMBERVEIL - AURA (NEBULA) SYSTEM
   ============================================================================= */

.aura-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* Layer 1 - screen */
.aura-layer-1 {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 45% 50% at 28% 62%, rgba(143,77,39,0.28) 0%, rgba(79,45,27,0.13) 45%, transparent 80%);
  mix-blend-mode: screen;
  filter: blur(150px);
  transform: translateZ(0);
  will-change: transform;
  pointer-events: none;
}

/* Layer 2 - screen */
.aura-layer-2 {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 18% 22% at 31% 60%, rgba(211,119,58,0.13) 0%, transparent 72%);
  mix-blend-mode: screen;
  filter: blur(75px);
  opacity: 0.75;
  transform: translateZ(0);
  will-change: transform;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .aura-layer-1 {
    filter: blur(216px);
  }
  .aura-layer-2 {
    filter: blur(108px);
  }
}

.aura-content {
  position: relative;
  z-index: 1;
}



.aura-bg {
  display: none !important;
}

/* High-Quality Mechanical Tech Wallpaper & Translucency Overlay Stack */
#bgLayer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-image: var(--custom-wallpaper, url('../assets/wallpaper.jpg?v=55.0'));
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  contain: strict;
  display: block !important;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

#bgOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--wallpaper-overlay, rgba(13, 14, 17, 0.25));
  backdrop-filter: blur(var(--wallpaper-blur, 0px));
  -webkit-backdrop-filter: blur(var(--wallpaper-blur, 0px));
  z-index: 1;
  pointer-events: none;
  display: block !important;
  transition: background 0.15s ease, backdrop-filter 0.15s ease;
}

#particlesCanvas,
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 3;
}

/* =============================================================================
 * TOP BOOKMARKS DOCK - RESPONSIVE & MOBILE TOUCH FORMATTING
 * ============================================================================= */

/* Desktop Mouse Devices: Enable Fish-eye Magnification & Wave Expansion */
@media (hover: hover) and (min-width: 769px) {
  .dock-glass-bar {
    overflow: visible !important;
  }

  .dock-tiles-track {
    overflow: visible !important;
    padding: 0.35rem 0.25rem !important;
  }

  .dock-tile {
    transform-origin: bottom center !important;
    will-change: transform;
    transition: transform 0.14s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.14s ease, border-color 0.14s ease !important;
  }
}

/* Mobile & Touch Screens: Contained Glass Bar with Smooth Horizontal Momentum Carousel */
@media (max-width: 768px), (hover: none) {
  .top-dock-container {
    padding: 0 0.85rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .dock-glass-bar {
    width: max-content !important;
    max-width: calc(100vw - 1.7rem) !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    border-radius: 16px !important;
    padding: 0.35rem 0.55rem !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  .dock-tiles-track {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    scrollbar-width: none !important;
    width: max-content !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    padding: 0.15rem 0.2rem !important;
  }

  .dock-tiles-track::-webkit-scrollbar {
    display: none !important;
  }

  .dock-tile-wrapper {
    flex-shrink: 0 !important;
  }

  .dock-tile {
    width: 38px !important;
    height: 38px !important;
    border-radius: 9px !important;
    flex-shrink: 0 !important;
    transform: none !important;
  }

  .dock-tile-icon {
    width: 22px !important;
    height: 22px !important;
  }

  .dock-add-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 9px !important;
    flex-shrink: 0 !important;
  }
}


/* =============================================================================
 * WIDGET COLLAPSE / EXPAND STYLES
 * ============================================================================= */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.card-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.widget-collapse-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-secondary);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  flex-shrink: 0;
}

.widget-collapse-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.06);
}

.collapse-chevron {
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
  transform: rotate(0deg);
}

/* =============================================================================
   COLLAPSED WIDGET STATE: STRICT UNIFORM HEIGHT & LEVEL ALIGNMENT
   Guarantees left and right columns are 100% pixel-perfect level with each other
   when widgets are collapsed.
   ============================================================================= */
.dashboard-widget-wrapper.widget-collapsed:not(.tab-hidden) {
  height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: stretch !important;
  align-self: stretch !important;
  overflow: visible !important;
  margin: 0 !important;
}

.dashboard-widget-wrapper.widget-collapsed:not(.tab-hidden) > div:not(.widget-edit-controls),
.dashboard-widget-wrapper.widget-collapsed:not(.tab-hidden) > a {
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: stretch !important;
  margin: 0 !important;
  padding: 0 !important;
}

.dashboard-widget-wrapper.widget-collapsed:not(.tab-hidden) .glass-card,
.dashboard-widget-wrapper.widget-collapsed:not(.tab-hidden) > .glass-card {
  height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  box-sizing: border-box !important;
  padding: 0 1.05rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  overflow: visible !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
  transition: box-shadow 0.25s ease;
  margin: 0 !important;
}

.dashboard-widget-wrapper.widget-collapsed .card-top {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
  cursor: pointer;
}

.dashboard-widget-wrapper.widget-collapsed .collapse-chevron {
  transform: rotate(-90deg) !important;
}

/* Hide all card body elements when collapsed */
.dashboard-widget-wrapper.widget-collapsed .widget-body-content {
  display: none !important;
}

/* Tab-hidden state MUST strictly remove elements from layout, overriding collapsed display */
.dashboard-widget-wrapper.tab-hidden,
.dashboard-widget-wrapper.widget-collapsed.tab-hidden {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}


/* =============================================================================
 * QUICKDROP SHARE & QR CODE MODAL
 * ============================================================================= */
.quickdrop-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  padding: 1rem;
  box-sizing: border-box;
}

.quickdrop-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.quickdrop-modal-card {
  background: rgba(14, 20, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 1.25rem;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
  transform: translateY(12px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.quickdrop-modal-backdrop.active .quickdrop-modal-card {
  transform: translateY(0) scale(1);
}

.quickdrop-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.quickdrop-modal-close:hover {
  color: #ffffff;
}

.qd-net-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.3rem 0.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qd-net-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}


#quickDropQrWrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.85rem !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 248, 255, 0.93) 100%) !important;
  border-radius: 16px !important;
  margin: 0 auto 0.85rem auto !important;
  width: 175px !important;
  height: 175px !important;
  box-sizing: border-box !important;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.35), 0 10px 30px rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  position: relative !important;
}


/* Sleek, Uncluttered Layout Edit Mode Controls */
.widget-edit-controls {
  display: none !important;
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 100;
  align-items: center;
  gap: 4px;
  background: rgba(14, 24, 42, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 20px;
  padding: 3px 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 10px rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: editPillPop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes editPillPop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

body.layout-edit-mode .dashboard-widget-wrapper {
  position: relative !important;
  overflow: visible !important;
}
body.layout-edit-mode .dashboard-widget-wrapper.widget-collapsed {
  overflow: visible !important;
}
body.layout-edit-mode .dashboard-widget-wrapper.widget-collapsed .glass-card {
  overflow: visible !important;
}

body.layout-edit-mode .widget-edit-controls {
  display: inline-flex !important;
}

.widget-size-toggles {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-right: 4px;
  padding-right: 5px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.widget-edit-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.widget-edit-btn svg {
  pointer-events: none;
}

.widget-edit-btn.size-pill {
  width: auto;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 700;
}

.widget-edit-btn.size-pill.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  color: #38bdf8;
}

.widget-edit-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
  transform: scale(1.1);
}

.widget-edit-btn.remove-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.widget-edit-btn.remove-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.1);
}

.widget-drag-handle {
  display: none !important;
}

/* Mobile Responsive Adjustments for Layout Edit Banner */
@media (max-width: 768px) {
  .layout-edit-banner {
    width: calc(100% - 1.25rem) !important;
    max-width: 100% !important;
    top: -160px !important;
  }

  .layout-edit-banner.active {
    top: 0.65rem !important;
  }

  .layout-edit-banner-content {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.55rem !important;
    padding: 0.65rem 0.85rem !important;
  }

  .layout-edit-banner-info {
    justify-content: space-between !important;
    width: 100% !important;
  }

  .layout-edit-hint {
    display: none !important;
  }

  .layout-edit-banner-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1.2fr !important;
    gap: 0.45rem !important;
    width: 100% !important;
  }

  #layoutAddWidgetSelect {
    grid-column: span 3 !important;
    width: 100% !important;
    margin-bottom: 2px !important;
  }

  .layout-edit-banner-actions button {
    padding: 0.45rem 0.4rem !important;
    font-size: 0.72rem !important;
    text-align: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }

  .widget-size-toggles,
  .widget-col-toggle {
    display: none !important; /* Resizing & column toggles have no effect on mobile 1-column layout */
  }

  .widget-edit-controls {
    top: 12px !important;
    right: 8px !important;
    max-width: calc(100% - 16px) !important;
    padding: 2px 5px !important;
    gap: 3px !important;
  }

  .widget-edit-btn {
    width: 28px !important;
    height: 28px !important;
  }

  .widget-edit-btn.size-pill {
    padding: 2px 6px !important;
    font-size: 0.65rem !important;
  }
}


/* -----------------------------------------------------------------------------
   MOBILE GPU PERFORMANCE & LAYER STABILITY
   Fixes iOS Safari disappearing header / dock and scroll stuttering
   ----------------------------------------------------------------------------- */
.header-bar,
.top-dock-container {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

@media (max-width: 768px) {
  /* Eliminate heavy particle & noise overlays that choke mobile GPU */
  #particlesCanvas,
  .bg-noise-layer {
    display: none !important;
  }

  /* Optimized high-performance solid obsidian glass (no layer thrashing) */
  .glass-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, rgba(13, 20, 36, 0.92) 40%, rgba(8, 14, 28, 0.96) 100%) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
  }

  .dock-glass-bar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(13, 20, 36, 0.94) !important;
  }

  .header-telemetry {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(13, 20, 36, 0.92) !important;
  }

  
}


/* -----------------------------------------------------------------------------
   DESKTOP DOCK MAGNIFICATION UNCLIPPED & EDIT BUTTON STACKING
   ----------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .top-dock-container {
    overflow: visible !important;
    padding-top: 16px !important;
    padding-bottom: 8px !important;
    margin-top: 0.25rem !important;
  }

  .dock-glass-bar {
    overflow: visible !important;
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
  }

  .dock-tiles-track {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  .dock-tile-wrapper {
    overflow: visible !important;
  }





  .dock-add-btn {
    margin-left: 6px !important;
  }
}

/* iOS Safari Tactile Glass & Fluid Scrolling */
@media (max-width: 768px) {
  html, body {
    -webkit-overflow-scrolling: touch !important;
  }

  /* Shift page down in Edit Mode so the fixed top banner never covers the bookmarks dock */
  body.layout-edit-mode {
    padding-top: 155px !important;
    transition: padding-top 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  /* Rich frosted glass depth on mobile (GPU-calibrated 14px blur) */
  .glass-card {
    backdrop-filter: blur(14px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(160%) !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(14, 23, 42, 0.75) 40%, rgba(8, 14, 28, 0.88) 100%) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5) !important;
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s ease, border-color 0.2s ease !important;
  }

  .glass-card:active {
    transform: scale(0.988) !important;
  }

  .dock-glass-bar {
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    background: rgba(14, 25, 45, 0.82) !important;
  }

  /* Touch-friendly corner badges on dock in edit mode */

}





/* In Layout Edit Mode: Widen tile track spacing so 24px corner badges never collide */
body.layout-edit-mode .dock-tiles-track {
  gap: 1.5rem !important;
  padding: 0.75rem 0.65rem !important;
}

body.layout-edit-mode .dock-glass-bar {
  padding: 0.55rem 0.85rem !important;
}

body.layout-edit-mode .dock-item-edit-btn,
body.layout-edit-mode .dock-item-del-btn {
  opacity: 1 !important;
  pointer-events: auto !important;
  width: 24px !important;
  height: 24px !important;
}


/* Dock Edit Button: Hidden in Normal Mode, Visible ONLY in Layout Edit Mode */
.dock-item-edit-btn {
  display: none !important;
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0284c7;
  border: 2px solid #ffffff;
  color: #ffffff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.15s ease;
  z-index: 99;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
}

body.layout-edit-mode .dock-item-edit-btn {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.layout-edit-mode .dock-item-edit-btn:hover {
  background: #38bdf8 !important;
  color: #0c182a !important;
  transform: scale(1.2);
}

/* =============================================================================
   URL SHORTENER WIDGET
   High-density dark frosted glass card, micro-link badges & QR section
   ============================================================================= */
.urlshortener-deck {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.urlshortener-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.urlshortener-field-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  padding: 0.25rem 0.4rem 0.25rem 0.65rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.urlshortener-field-row:focus-within {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.urlshortener-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

.urlshortener-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.78rem;
}

.urlshortener-aux-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  border-radius: 6px;
  padding: 0.25rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.urlshortener-aux-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.urlshortener-action-row {
  display: flex;
  width: 100%;
  margin-top: 0.25rem;
}

.urlshortener-submit-btn {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 8px;
}

.urlshortener-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-size: 0.74rem;
  line-height: 1.35;
}

/* Result Card */
.urlshortener-result-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.2s ease-out;
}

.urlshortener-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.urlshortener-result-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
}

.urlshortener-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-family: var(--font-mono, monospace);
}

.savings-badge {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.info-badge {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.urlshortener-result-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.urlshortener-link-text {
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}

.urlshortener-link-text:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.urlshortener-btn-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.urlshortener-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  transition: all 0.2s;
}

.urlshortener-copy-btn.copied {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
}

.urlshortener-qr-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  padding: 0.35rem 0.6rem;
  border-radius: 7px;
}

/* QR Code Section */
.urlshortener-qr-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem;
  animation: fadeIn 0.2s ease-out;
}

.urlshortener-qr-canvas {
  flex-shrink: 0;
  background: #ffffff;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.urlshortener-qr-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.urlshortener-qr-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
}

.urlshortener-qr-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.35;
}

/* History */
.urlshortener-history-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.urlshortener-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.urlshortener-history-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
}

.urlshortener-clear-hist-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.66rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.urlshortener-clear-hist-btn:hover {
  color: #ef4444;
}

.urlshortener-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.urlshortener-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  padding: 0.35rem 0.55rem;
  transition: background 0.15s;
}

.urlshortener-history-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.urlshortener-history-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.urlshortener-history-short {
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.urlshortener-history-short:hover {
  text-decoration: underline;
}

.urlshortener-history-orig {
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.urlshortener-history-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.urlshortener-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.15s;
}

.urlshortener-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.urlshortener-icon-btn.copied {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

.urlshortener-icon-btn.history-del-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

@media (max-width: 640px) {
  .urlshortener-qr-box {
    flex-direction: column;
    text-align: center;
  }
  .urlshortener-result-link-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .urlshortener-btn-group {
    width: 100%;
    justify-content: flex-end;
  }
}

/* =============================================================================
   COMMAND & LINK VAULT WIDGET STYLES
   ============================================================================= */

.keepsakes-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.keepsakes-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.keepsakes-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-secondary, #9ca3af);
  font-size: 0.70rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.keepsakes-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.keepsakes-pill.active {
  background: rgba(6, 182, 212, 0.18);
  border-color: rgba(6, 182, 212, 0.45);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.keepsakes-add-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.15s;
}

.keepsakes-add-trigger-btn:hover {
  opacity: 0.9;
}

.keepsakes-search-row {
  margin-bottom: 0.65rem;
}

.keepsakes-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.keepsakes-search-icon {
  position: absolute;
  left: 0.65rem;
  color: var(--text-muted, #6b7280);
  pointer-events: none;
}

.keepsakes-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.45rem 1.8rem 0.45rem 2.1rem;
  font-size: 0.76rem;
  color: var(--text-primary, #f3f4f6);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.keepsakes-search-input:focus {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}

.keepsakes-search-clear {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.2rem;
}

.keepsakes-search-clear:hover {
  color: #ffffff;
}

/* Form */
.keepsakes-form-card {
  background: rgba(10, 16, 26, 0.75);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: ksFormIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ksFormIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.keepsakes-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.keepsakes-form-title {
  font-size: 0.80rem;
  font-weight: 700;
  color: #ffffff;
}

.keepsakes-form-close {
  background: none;
  border: none;
  color: var(--text-muted, #6b7280);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.keepsakes-form-close:hover {
  color: #ffffff;
}

.keepsakes-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.keepsakes-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.keepsakes-form-field.full-width {
  grid-column: 1 / -1;
}

.keepsakes-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.keepsakes-input, .keepsakes-select, .keepsakes-textarea {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #ffffff;
  padding: 0.4rem 0.6rem;
  font-size: 0.76rem;
  outline: none;
  box-sizing: border-box;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.15s;
}

.keepsakes-textarea {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  line-height: 1.4;
  resize: vertical;
}

.keepsakes-input:focus, .keepsakes-select:focus, .keepsakes-textarea:focus {
  border-color: rgba(6, 182, 212, 0.55);
}

.keepsakes-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Items List */
.keepsakes-items-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 2px;
}

.keepsakes-card-item {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: background 0.15s, border-color 0.15s;
}

.keepsakes-card-item:hover {
  background: rgba(0, 0, 0, 0.38);
  border-color: rgba(255, 255, 255, 0.12);
}

.keepsakes-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.keepsakes-item-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

.keepsakes-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.ks-badge-command {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.ks-badge-link {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.ks-badge-snippet {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.ks-badge-note {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.keepsakes-item-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keepsakes-item-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.keepsakes-mini-btn {
  background: none;
  border: none;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.keepsakes-mini-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.keepsakes-mini-btn.del-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

.keepsakes-code-box {
  position: relative;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.45rem 3.6rem 0.45rem 0.65rem;
  min-height: 28px;
  display: flex;
  align-items: center;
}

.keepsakes-code-text {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  color: #38bdf8;
  word-break: break-all;
  white-space: pre-wrap;
  line-height: 1.35;
}

.keepsakes-code-copy-btn {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.keepsakes-code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.keepsakes-code-copy-btn.copied {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

.keepsakes-link-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
}

.keepsakes-link-text {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: #34d399;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.keepsakes-link-text:hover {
  text-decoration: underline;
}

.keepsakes-link-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.keepsakes-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #e2e8f0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.keepsakes-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.keepsakes-icon-btn.copied {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

.keepsakes-note-box {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 0.45rem 3.6rem 0.45rem 0.65rem;
  min-height: 28px;
  display: flex;
  align-items: center;
}

.keepsakes-note-text {
  font-size: 0.74rem;
  color: #e2e8f0;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.keepsakes-tags-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.keepsakes-tag-pill {
  font-size: 0.62rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted, #6b7280);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  padding: 1px 5px;
}

.keepsakes-empty-state {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.76rem;
  color: var(--text-muted, #6b7280);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

/* =============================================================================
   SSD FILE BROWSER WIDGET STYLES
   ============================================================================= */

.file-browser-card {
  min-height: 220px;
}

.file-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
}

.file-nav-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.file-up-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.file-up-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(-1px);
}

.file-breadcrumbs-trail {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.file-breadcrumbs-trail::-webkit-scrollbar {
  display: none;
}

.file-bc-crumb {
  cursor: pointer;
  color: var(--text-secondary, #cbd5e1);
  padding: 1px 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.file-bc-crumb:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.file-bc-crumb.active {
  color: #38bdf8;
  font-weight: 600;
  cursor: default;
  background: transparent;
}

.file-bc-sep {
  color: rgba(255, 255, 255, 0.22);
  font-size: 0.7rem;
  user-select: none;
}

.file-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 120px;
  min-width: 90px;
  flex-shrink: 0;
}

.file-search-icon {
  position: absolute;
  left: 7px;
  color: var(--text-muted, #64748b);
  pointer-events: none;
}

.file-filter-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 5px;
  padding: 3px 6px 3px 22px;
  font-size: 0.72rem;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s;
}

.file-filter-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.25);
}

.file-items-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 2px;
}

.file-items-container::-webkit-scrollbar {
  width: 4px;
}

.file-items-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 2px;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.file-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(2px);
}

.file-row-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.file-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-icon-wrap.folder {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.file-icon-wrap.app {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.file-icon-wrap.video {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.file-icon-wrap.audio {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.file-icon-wrap.image {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.file-icon-wrap.archive {
  background: rgba(234, 179, 8, 0.12);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.25);
}

.file-icon-wrap.document {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.file-icon-wrap.generic {
  background: rgba(100, 116, 139, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.file-row-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.file-row-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-row-sub {
  font-size: 0.65rem;
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.file-row-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.file-folder-arrow {
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  padding: 4px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.file-row:hover .file-folder-arrow {
  color: #38bdf8;
  transform: translateX(2px);
}

.file-download-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #38bdf8;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.file-download-btn:hover {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.file-empty-state {
  padding: 2rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.file-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Storage Card File Browser Integration */
.storage-browse-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.storage-browse-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

.storage-browse-toggle-btn.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.browse-chevron {
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.browse-chevron.rotated {
  transform: rotate(180deg);
}

.storage-browse-pill.active {
  background: rgba(56, 189, 248, 0.22) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

.storage-browser-drawer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: 1px solid transparent !important;
  transition: grid-template-rows 0.52s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
              margin-top 0.42s cubic-bezier(0.22, 1, 0.36, 1),
              padding-top 0.42s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s ease;
  will-change: grid-template-rows, opacity;
}

.storage-browser-drawer.drawer-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 0.85rem !important;
  padding-top: 0.75rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.storage-browser-drawer > div {
  overflow: hidden;
  min-height: 0;
}

.storage-drive-item {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.015);
}

.storage-drive-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.storage-drive-item.drive-active {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.35);
}

.file-drive-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

.embedded-file-browser .file-nav-bar {
  margin-bottom: 0.55rem;
  background: rgba(0, 0, 0, 0.32);
}

.embedded-file-browser .file-items-container {
  max-height: 290px;
}

/* PDF Toolkit Merge Reordering */
.pdf-merge-list {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 2px;
}

.pdf-merge-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 8px;
  gap: 6px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.pdf-merge-item:hover {
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(244, 63, 94, 0.3);
}

.pdf-merge-item.dragging {
  opacity: 0.4;
  border-style: dashed;
  border-color: #f43f5e;
}

.pdf-merge-item.drag-over {
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.15);
  transform: translateY(2px);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.25);
}

.pdf-drag-handle {
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #94a3b8);
  padding: 2px;
  transition: color 0.15s ease;
}

.pdf-drag-handle:active {
  cursor: grabbing;
}

.pdf-drag-handle:hover {
  color: #f43f5e;
}

.pdf-order-badge {
  background: rgba(244, 63, 94, 0.18);
  color: #f43f5e;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono, monospace);
  flex-shrink: 0;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.pdf-reorder-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #cbd5e1);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.pdf-reorder-btn:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.2);
  color: #ffffff;
  border-color: rgba(244, 63, 94, 0.4);
}

.pdf-reorder-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.pdf-remove-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  margin-left: 2px;
}

.pdf-remove-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Audio Trimmer Interactive Waveform & Draggable Scrub */
.audio-waveform-wrap {
  position: relative;
  width: 100%;
  height: 74px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: crosshair;
}

.audio-waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.audio-trim-mask {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  pointer-events: none;
  backdrop-filter: blur(1px);
  transition: width 0.05s ease;
}

.audio-mask-left {
  left: 0;
}

.audio-mask-right {
  right: 0;
}

.audio-trim-active-region {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(245, 158, 11, 0.12);
  border-top: 2px solid rgba(245, 158, 11, 0.55);
  border-bottom: 2px solid rgba(245, 158, 11, 0.55);
  pointer-events: none;
  box-shadow: inset 0 0 16px rgba(245, 158, 11, 0.1);
}

.audio-marker-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f59e0b;
  cursor: ew-resize;
  z-index: 10;
  touch-action: none;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.audio-marker-handle {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #0f172a;
  font-size: 0.62rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  padding: 1px 5px;
  border-radius: 0 0 4px 4px;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: ew-resize;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  user-select: none;
  transition: transform 0.1s ease, background 0.1s ease;
}

.audio-marker-handle:hover,
.audio-marker-line:hover .audio-marker-handle {
  background: #fbbf24;
  transform: translateX(-50%) scale(1.08);
}

.audio-playhead-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #38bdf8;
  z-index: 12;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.9);
  transition: transform 0.05s linear;
}

.audio-playhead-badge {
  position: absolute;
  bottom: 2px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #38bdf8;
  color: #38bdf8;
  font-size: 0.58rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
}

.audio-time-tooltip {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.60rem;
  font-family: var(--font-mono, monospace);
  padding: 1px 5px;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 15;
}

.audio-waveform-wrap:hover .audio-time-tooltip {
  opacity: 1;
}

/* =============================================================================
   JSON STUDIO & EPHEMERAL HOSTER STYLES
   ============================================================================= */
.json-editor-card {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.json-editor-card.fullscreen {
  position: fixed !important;
  inset: 1rem !important;
  z-index: 9999 !important;
  height: calc(100vh - 2rem) !important;
  max-height: none !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(25px) !important;
  -webkit-backdrop-filter: blur(25px) !important;
}

.json-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 0.65rem;
}

.json-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.json-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.32rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
  user-select: none;
}

.json-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.json-btn.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #f59e0b;
}

.json-btn-host {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.95) 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(245, 158, 11, 0.8) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.json-btn-host:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.55);
}

.json-workspace {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 320px;
  max-height: 520px;
  background: rgba(5, 7, 12, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.json-editor-card.fullscreen .json-workspace {
  max-height: none !important;
  flex: 1;
}

.json-code-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.json-line-numbers {
  width: 44px;
  background: rgba(0, 0, 0, 0.4);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #64748b;
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  line-height: 1.5;
  padding: 0.75rem 0.4rem;
  text-align: right;
  user-select: none;
  overflow: hidden;
}

.json-textarea {
  flex: 1;
  background: transparent;
  color: #f8fafc;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 0.75rem 0.85rem;
  border: none;
  outline: none;
  resize: none;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}

.json-tree-container {
  width: 100%;
  height: 100%;
  padding: 0.75rem;
  overflow-y: auto;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  line-height: 1.6;
}

.json-tree-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.json-tree-filter-input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  flex: 1;
  outline: none;
}

.json-tree-node {
  margin-left: 1.25rem;
  position: relative;
}

.json-tree-node.root {
  margin-left: 0;
}

.json-tree-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  color: #94a3b8;
  font-size: 0.65rem;
  user-select: none;
  transition: transform 0.15s ease;
}

.json-tree-toggle.collapsed {
  transform: rotate(-9deg);
}

.json-tree-key {
  color: #38bdf8;
  font-weight: 600;
}

.json-tree-string {
  color: #34d399;
}

.json-tree-number {
  color: #fbbf24;
}

.json-tree-boolean {
  color: #c084fc;
}

.json-tree-null {
  color: #94a3b8;
  font-style: italic;
}

.json-tree-bracket {
  color: #94a3b8;
}

.json-tree-badge {
  font-size: 0.64rem;
  color: #64748b;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 5px;
}

.json-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-top: 0.65rem;
  font-size: 0.72rem;
}

.json-valid-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #10b981;
  font-weight: 600;
}

.json-error-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #f43f5e;
  font-weight: 600;
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal for JSON Short URL & QR */
.json-host-modal-card {
  background: rgba(13, 16, 26, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.75), 0 0 25px rgba(245, 158, 11, 0.15);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 16px;
  padding: 1.25rem;
  max-width: 420px;
  width: 92%;
  animation: scaleUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}





/* =============================================================================
   NOTES WIDGET MULTI-NOTE CYCLING & EXPANDED STYLES
   ============================================================================= */
.notes-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.notes-cycle-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 2px 4px;
}

.notes-nav-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.notes-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.notes-cycle-indicator {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: #fbbf24;
  padding: 0 4px;
  min-width: 34px;
  text-align: center;
}

.notes-pills-carousel {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  max-width: calc(100% - 250px);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.notes-pills-carousel::-webkit-scrollbar {
  display: none;
}

.note-pill-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-secondary, #9ca3af);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.note-pill-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.note-pill-tab.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.notes-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.notes-btn-tool {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.70rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.notes-btn-tool:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}

.notes-btn-tool.primary {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.notes-btn-tool.primary:hover {
  background: #f59e0b;
  color: #000000;
}

.notes-btn-tool.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.notes-textarea-large {
  width: 100% !important;
  min-height: 380px !important;
  height: 380px !important;
  resize: vertical !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: 0.82rem !important;
  line-height: 1.55 !important;
  padding: 0.85rem 1rem !important;
  border-radius: 9px !important;
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #f1f5f9 !important;
}

.dashboard-widget-wrapper textarea#notesContentArea {
  min-height: 380px !important;
  height: 380px !important;
}

@media (max-width: 768px) {
  .notes-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .notes-pills-carousel {
    max-width: 100%;
  }
  .notes-action-buttons {
    justify-content: flex-end;
  }
  .notes-textarea-large {
    min-height: 280px !important;
    height: 280px !important;
  }
}

/* Keepsakes Collapsed Items */
.keepsakes-card-item {
  cursor: default;
}

.keepsakes-card-item .keepsakes-item-header {
  cursor: pointer;
  user-select: none;
}

.keepsakes-card-item.is-collapsed {
  padding: 0.5rem 0.75rem;
  gap: 0;
}

.keepsakes-card-item.is-collapsed:hover {
  background: rgba(255, 255, 255, 0.05);
}

.keepsakes-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
