/* ==========================================================================
   Command Hub · App-Dashboard — Modern Spatial & Bento Design System
   ========================================================================== */

:root {
  /* Dark Theme (Default Obsidian Glass) */
  --bg-base: #080a0f;
  --bg-elevated: rgba(19, 23, 34, 0.72);
  --bg-card: rgba(23, 28, 41, 0.68);
  --bg-card-hover: rgba(30, 36, 54, 0.84);
  --bg-glass-strong: rgba(15, 18, 28, 0.88);
  --bg-input: rgba(10, 13, 20, 0.65);

  --text-primary: #f3f5fa;
  --text-secondary: #9ba3b8;
  --text-muted: #646d85;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-highlight: rgba(255, 255, 255, 0.15);
  --card-shadow: 0 14px 36px -10px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);

  --accent-primary: #ff2a5c;
  --accent-gold: #f5b82e;
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html[data-theme="light"] {
  --bg-base: #f2f5fa;
  --bg-elevated: rgba(255, 255, 255, 0.82);
  --bg-card: rgba(255, 255, 255, 0.78);
  --bg-card-hover: rgba(255, 255, 255, 0.96);
  --bg-glass-strong: rgba(248, 250, 254, 0.94);
  --bg-input: rgba(237, 241, 248, 0.85);

  --text-primary: #111625;
  --text-secondary: #4f5973;
  --text-muted: #7c86a1;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-highlight: rgba(15, 23, 42, 0.16);
  --card-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: calc(108px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================================================
   Ambient Background Mesh & Grid
   ========================================================================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.26;
  transition: opacity 0.4s ease;
  animation: floatOrb 22s ease-in-out infinite alternate;
}

html[data-theme="light"] .ambient-orb {
  opacity: 0.16;
}

.orb-1 {
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, #ff2a5c 0%, transparent 70%);
  top: -180px;
  left: -120px;
}

.orb-2 {
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, #f5b82e 0%, transparent 70%);
  top: 15%;
  right: -200px;
  animation-delay: -7s;
}

.orb-3 {
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
  bottom: -200px;
  left: 25%;
  animation-delay: -14s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.08); }
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 30%, transparent 100%);
  opacity: 0.45;
}

/* ==========================================================================
   Shared Glass Panel
   ========================================================================== */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  line-height: 1.2;
}

html[data-theme="light"] kbd {
  background: rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   Top Navigation Bar
   ========================================================================== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-elevated);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  padding: calc(env(safe-area-inset-top) + 10px) 24px 10px;
}

.top-bar-inner {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-logo-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}

.brand-logo {
  width: 100%;
  height: 100%;
  border-radius: 11px;
  box-shadow: 0 4px 14px rgba(255, 42, 92, 0.3);
}

.brand-pulse {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-emerald);
  border: 2px solid var(--bg-base);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Command Trigger Button */
.cmd-trigger {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cmd-trigger:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(255, 42, 92, 0.12);
}

.cmd-trigger-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

.cmd-trigger-text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right Actions */
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-pill:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.status-dot.checking {
  background: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.4; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.2); }
}

.segmented-control {
  display: inline-flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.seg-btn svg {
  width: 14px;
  height: 14px;
}

.seg-btn.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.icon-btn svg {
  width: 18px;
  height: 18px;
}

html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }

/* ==========================================================================
   Main Layout & Hero Section
   ========================================================================== */
.dashboard-main {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: padding-right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-section {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.hero-greeting-card {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero-greeting-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 42, 92, 0.14), transparent 70%);
  pointer-events: none;
}

.hero-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.shift-badge, .kw-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.kw-badge {
  font-family: var(--font-mono);
  color: var(--accent-gold);
  border-color: rgba(245, 184, 46, 0.25);
  background: rgba(245, 184, 46, 0.08);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.6vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 22px;
  max-width: 66ch;
}

/* Filter Bar & Category Tabs */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cat-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.cat-tab.active {
  background: var(--text-primary);
  color: var(--bg-base);
  border-color: transparent;
}

.cat-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.75;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.2);
}

.cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.rd-dot { background: #ff2a5c; box-shadow: 0 0 6px #ff2a5c; }
.perf-dot { background: #ff6b2b; box-shadow: 0 0 6px #ff6b2b; }
.life-dot { background: #eab308; box-shadow: 0 0 6px #eab308; }

.inline-search-wrap {
  position: relative;
  min-width: 210px;
  flex: 1;
  max-width: 260px;
}

.inline-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.inline-search-input {
  width: 100%;
  padding: 7px 28px 7px 32px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inline-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(255, 42, 92, 0.15);
}

.inline-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
}

/* Hero Side Stack: Clock & Scratchpad */
.hero-side-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.clock-card {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.clock-tz {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.clock-time-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0 8px;
}

.clock-time {
  font-family: var(--font-display);
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.clock-seconds {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.clock-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.76rem;
}

.recent-label {
  color: var(--text-muted);
}

.recent-app-pill {
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 9px;
  border-radius: 999px;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Scratchpad Widget */
.scratchpad-card {
  padding: 14px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scratchpad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
}

.scratchpad-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-gold);
}

.scratchpad-icon {
  width: 14px;
  height: 14px;
}

.scratchpad-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scratchpad-saved {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.scratchpad-saved.visible {
  opacity: 1;
}

.scratchpad-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.74rem;
  transition: color 0.15s;
}

.scratchpad-link:hover {
  color: var(--accent-gold);
}

.scratchpad-input {
  width: 100%;
  flex: 1;
  resize: none;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.2s;
}

.scratchpad-input:focus {
  border-color: rgba(245, 184, 46, 0.5);
}

/* ==========================================================================
   Bento App Grid & Interactive App Cards
   ========================================================================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

/* Responsive Spans for the 7 Apps in a 12-Column Bento Layout */
.app-card {
  grid-column: span 4;
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--card-shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.26s ease, box-shadow 0.26s ease, background 0.26s ease;
  cursor: pointer;
}

/* Highlight wide cards for visual rhythm when all 7 are shown */
.app-card.bento-wide {
  grid-column: span 6;
}

/* Dynamic Cursor Spotlight Overlay */
.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    480px circle at var(--mouse-x, 50%) var(--mouse-y, 0%),
    var(--app-glow, rgba(255, 255, 255, 0.08)),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

/* Top Accent Line */
.app-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--app-accent, #ff2a5c), transparent);
  opacity: 0.55;
  transition: opacity 0.25s ease, left 0.25s ease, right 0.25s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--app-border, rgba(255, 255, 255, 0.22));
  box-shadow: 0 20px 44px -12px rgba(0, 0, 0, 0.65), 0 0 28px -8px var(--app-glow, rgba(255, 42, 92, 0.3));
}

.app-card:hover::before {
  opacity: 1;
}

.app-card:hover::after {
  opacity: 1;
  left: 12px;
  right: 12px;
}

.app-card > * {
  position: relative;
  z-index: 1;
}

/* Card Header */
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.app-identity {
  display: flex;
  align-items: center;
  gap: 15px;
}

.app-icon-box {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 16px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12);
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-card:hover .app-icon-box {
  transform: scale(1.06) rotate(-1.5deg);
}

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

.app-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.app-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--app-accent, #ff2a5c);
}

.app-title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.app-domain {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.domain-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

/* Card Top Right Actions (Shortcut Key + Pin + Split View) */
.card-meta-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shortcut-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.card-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.card-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.card-action-btn.pinned {
  color: var(--accent-gold);
  border-color: rgba(245, 184, 46, 0.4);
  background: rgba(245, 184, 46, 0.12);
}

.card-action-btn svg {
  width: 14px;
  height: 14px;
}

/* Card Description & Interactive Feature Area */
.app-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Embedded Quick Search inside Wissen Card */
.card-inline-Prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 6px 10px;
  margin-top: -2px;
}

.card-inline-Prompt input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.81rem;
  outline: none;
}

.card-inline-Prompt button {
  padding: 4px 10px;
  border-radius: 7px;
  border: none;
  background: var(--app-accent, #f5b82e);
  color: #0b0d13;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

/* Quick Chips / Deep-Link Sub-Actions */
.card-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
}

html[data-theme="light"] .quick-chip {
  background: rgba(15, 23, 42, 0.04);
}

.quick-chip:hover {
  background: var(--app-glow, rgba(255, 255, 255, 0.12));
  color: var(--text-primary);
  border-color: var(--app-accent, var(--border-highlight));
  transform: translateY(-1px);
}

/* Card Footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  gap: 10px;
}

.card-telemetry {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.launch-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.app-card:hover .launch-cta {
  background: var(--app-accent, #ff2a5c);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--app-glow, rgba(255, 42, 92, 0.35));
}

/* Ensure dark text on bright gold/yellow accents when hovered */
.app-card[data-contrast="dark"]:hover .launch-cta {
  color: #0b0d13;
}

/* ==========================================================================
   Multi-App Workflows Section
   ========================================================================== */
.workflows-section {
  padding: 22px 26px;
}

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

.workflows-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
}

.workflows-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.workflows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.workflow-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.workflow-card:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.wf-icon-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.wf-icon-group img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 2px solid var(--bg-base);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.wf-icon-group img + img {
  margin-left: -10px;
}

.wf-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.wf-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.wf-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-arrow {
  color: var(--text-muted);
  font-weight: 700;
  transition: transform 0.2s ease, color 0.2s ease;
}

.workflow-card:hover .wf-arrow {
  transform: translateX(3px);
  color: var(--text-primary);
}

/* ==========================================================================
   Floating Quick-Launch Dock (macOS / iPadOS Style)
   ========================================================================== */
.floating-dock {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  width: min(440px, calc(100vw - 16px));
}

.dock-inner {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 22px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--border-highlight);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
}

.dock-item {
  position: relative;
  width: 100%;
  max-width: 48px;
  aspect-ratio: 1 / 1;
  border-radius: 26%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-item img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.dock-item:hover {
  transform: translateY(-7px) scale(1.14);
}

.dock-item::after {
  content: attr(data-title);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-glass-strong);
  color: var(--text-primary);
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border-highlight);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

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

.dock-dot {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-secondary);
  opacity: 0;
}

.dock-item.active .dock-dot {
  opacity: 1;
  background: var(--accent-primary);
}

/* ==========================================================================
   Integrated Split-Cockpit Drawer
   ========================================================================== */
.cockpit-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(680px, 94vw);
  z-index: 60;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid var(--border-highlight);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  transform: translateX(104%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), width 0.3s ease;
}

.cockpit-drawer.open {
  transform: translateX(0);
}

.cockpit-drawer.expanded {
  width: min(1240px, 96vw);
}

.cockpit-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(4, 6, 12, 0.55);
  backdrop-filter: blur(4px);
}

.cockpit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.cockpit-app-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cockpit-app-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.cockpit-app-title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
}

.cockpit-app-url {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}

.cockpit-app-switcher {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.cockpit-switch-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s, transform 0.15s;
}

.cockpit-switch-btn:hover, .cockpit-switch-btn.active {
  opacity: 1;
  transform: scale(1.08);
}

.cockpit-switch-btn img {
  width: 100%;
  height: 100%;
  border-radius: 7px;
}

.cockpit-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cockpit-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.cockpit-btn svg {
  width: 14px;
  height: 14px;
}

.cockpit-btn.primary {
  background: var(--accent-primary);
  color: #fff;
  border-color: transparent;
}

.cockpit-body {
  position: relative;
  flex: 1;
  background: #0b0d13;
}

.cockpit-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.cockpit-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-base);
  color: var(--text-secondary);
  font-size: 0.85rem;
  z-index: 2;
}

.cockpit-loader[hidden] {
  display: none;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  animation: spin 0.75s linear infinite;
}

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

/* ==========================================================================
   Command Palette Modal (Cmd+K)
   ========================================================================== */
.cmd-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 7, 14, 0.68);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 16px 16px;
}

.cmd-modal-backdrop[hidden] {
  display: none;
}

.cmd-modal {
  width: 100%;
  max-width: 620px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-highlight);
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.75);
}

.cmd-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.cmd-search-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-primary);
}

.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
}

.cmd-results {
  max-height: 390px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.cmd-item.selected, .cmd-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .cmd-item.selected,
html[data-theme="light"] .cmd-item:hover {
  background: rgba(15, 23, 42, 0.06);
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cmd-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.cmd-item-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.cmd-item-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.cmd-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cmd-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.74rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.18);
}

/* ==========================================================================
   iPhone Home-Screen Install Guide Modal
   ========================================================================== */
.ios-guide-modal {
  max-width: 560px;
}

.ios-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.ios-modal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ios-preview-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.ios-modal-brand h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.ios-modal-brand p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.ios-modal-body {
  padding: 22px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  align-items: center;
}

.ios-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}

.ios-qr-img {
  width: 132px;
  height: 132px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.ios-qr-caption {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.ios-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ios-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ios-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.ios-steps strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.ios-steps p {
  font-size: 0.79rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.ios-steps code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-gold);
  word-break: break-all;
}

@media (max-width: 600px) {
  .ios-modal-body {
    grid-template-columns: 1fr;
  }
  .ios-qr-box {
    display: none;
  }
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  animation: slideInToast 0.22s ease;
}

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

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1120px) {
  .hero-section {
    grid-template-columns: 1fr;
  }
  .hero-side-stack {
    flex-direction: row;
  }
  .clock-card, .scratchpad-card {
    flex: 1;
  }
  .app-card, .app-card.bento-wide {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  .top-bar {
    padding: calc(env(safe-area-inset-top) + 8px) 14px 8px;
  }
  .brand-subtitle, .status-label, .segmented-control span {
    display: none;
  }
  .cmd-trigger-text {
    font-size: 0.8rem;
  }
  .dashboard-main {
    padding: 16px 14px 32px;
  }
  .hero-greeting-card {
    padding: 20px;
  }
  .hero-side-stack {
    flex-direction: column;
  }
  .app-card, .app-card.bento-wide {
    grid-column: span 12;
  }
  .cockpit-app-switcher {
    display: none;
  }
}
