/* Keyline Days optical Liquid Glass layer.
 * Real engines are strictly bounded to the desktop hero, header controls and
 * four overview cards. Everything else keeps a low-cost, readable fallback. */
:root {
  --kd-optical-fill: rgba(255, 255, 255, 0.32);
  --kd-optical-fill-strong: rgba(255, 255, 255, 0.54);
  --kd-optical-fill-soft: rgba(248, 251, 255, 0.16);
  --kd-optical-line: rgba(255, 255, 255, 0.86);
  --kd-optical-line-low: rgba(91, 112, 146, 0.16);
  --kd-optical-shadow: 0 24px 64px rgba(50, 62, 86, 0.13), 0 5px 18px rgba(50, 62, 86, 0.07);
  --kd-optical-shadow-soft: 0 18px 48px rgba(50, 62, 86, 0.10), 0 3px 12px rgba(50, 62, 86, 0.05);
  --kd-optical-highlight: rgba(255, 255, 255, 0.92);
}

html[data-kd-color-mode="dark"],
html.theme-dark {
  --kd-optical-fill: rgba(29, 35, 46, 0.52);
  --kd-optical-fill-strong: rgba(44, 52, 66, 0.68);
  --kd-optical-fill-soft: rgba(23, 29, 39, 0.28);
  --kd-optical-line: rgba(255, 255, 255, 0.21);
  --kd-optical-line-low: rgba(255, 255, 255, 0.08);
  --kd-optical-shadow: 0 26px 70px rgba(0, 0, 0, 0.36), 0 5px 18px rgba(0, 0, 0, 0.24);
  --kd-optical-shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.29), 0 3px 12px rgba(0, 0, 0, 0.2);
  --kd-optical-highlight: rgba(255, 255, 255, 0.26);
}

/* Neutral veil reduces the source artwork's color mist by roughly 40% while
 * retaining enough tonal variation for the bounded refraction engines. */
html:not([data-kd-color-mode="dark"]):not(.theme-dark):has(#app:not(.visual-export-mode)) {
  background-color: #fafbfd !important;
  background-image:
    linear-gradient(rgba(250, 251, 253, 0.40), rgba(250, 251, 253, 0.40)),
    var(--kd-main-background-image) !important;
}

/* The capture scene is deliberately limited to the visible header strip. */
#app:not(.visual-export-mode) .header-top.page-hero {
  isolation: isolate;
}

#app:not(.visual-export-mode) .kd-header-glass-scene,
#app:not(.visual-export-mode) .header-top-actions .aa-launch-link,
#app:not(.visual-export-mode) .aa-launch-link {
  display: none !important;
  opacity: 0 !important;
  background: none !important;
}

#app:not(.visual-export-mode) .header-title-block,
#app:not(.visual-export-mode) .header-top-actions {
  position: relative;
  z-index: 2;
}

#app:not(.visual-export-mode) .overview-dashboard {
  position: relative;
  isolation: isolate;
}

#app:not(.visual-export-mode) .overview-dashboard::before {
  display: none !important;
  content: none !important;
  background: none !important;
}

#app:not(.visual-export-mode) .kd-overview-hero-root {
  position: relative;
  width: 100%;
  min-width: 0;
  border-radius: 24px;
  isolation: isolate;
  overflow: visible;
}

#app:not(.visual-export-mode) .kd-overview-hero-root > .kd-liquid-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 7% 12%, rgba(127, 180, 255, 0.29), transparent 38%),
    radial-gradient(ellipse at 91% 82%, rgba(255, 156, 192, 0.25), transparent 42%),
    radial-gradient(ellipse at 55% 116%, rgba(186, 159, 255, 0.17), transparent 44%),
    linear-gradient(118deg, rgba(245, 249, 253, 0.74), rgba(255, 247, 250, 0.58) 54%, rgba(249, 247, 253, 0.56));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

#app:not(.visual-export-mode) .kd-overview-hero-root > .overview-hero-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
  border-radius: 24px !important;
  border: 1px solid var(--kd-optical-line) !important;
  background: linear-gradient(132deg, rgba(255, 255, 255, 0.66), rgba(248, 251, 255, 0.36)) !important;
  box-shadow:
    inset 0 1px 0 var(--kd-optical-highlight),
    inset 0 -1px 0 var(--kd-optical-line-low),
    var(--kd-optical-shadow) !important;
  overflow: visible !important;
}

#app:not(.visual-export-mode) .kd-overview-hero-root > .overview-hero-panel::before {
  display: none !important;
  content: none !important;
}

#app:not(.visual-export-mode) .kd-overview-hero-root > .overview-hero-panel::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 1px !important;
  z-index: 1 !important;
  border-radius: 23px !important;
  pointer-events: none !important;
  background: linear-gradient(122deg, rgba(255, 255, 255, 0.58), transparent 25%, transparent 75%, rgba(153, 188, 255, 0.09)) !important;
  opacity: 0.78 !important;
}

#app:not(.visual-export-mode) .overview-hero-panel > :not(canvas),
#app:not(.visual-export-mode) .overview-action-card > :not(canvas) {
  position: relative;
  z-index: 3;
}

#app:not(.visual-export-mode) .kd-overview-hero-root-active {
  contain: layout !important;
}

#app:not(.visual-export-mode) .overview-hero-panel.kd-liquid-webgl-live {
  background: linear-gradient(132deg, rgba(255, 255, 255, 0.66), rgba(248, 251, 255, 0.36)) !important;
  border-color: rgba(255, 255, 255, 0.54) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 1px 0 0 rgba(255, 255, 255, 0.38),
    inset -1px 0 0 rgba(117, 144, 187, 0.14),
    inset 0 -1px 0 rgba(86, 105, 139, 0.16),
    0 24px 58px rgba(49, 61, 84, 0.12) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}

#app:not(.visual-export-mode) .overview-hero-panel.kd-liquid-webgl-live > canvas:first-child {
  z-index: 0 !important;
  opacity: 0.32 !important;
  pointer-events: none !important;
  border-radius: 24px !important;
  mix-blend-mode: screen !important;
  filter: brightness(1.06) saturate(0.72) !important;
}

#app:not(.visual-export-mode) .overview-hero-panel .overview-hero-status {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.11)) !important;
  border: 1px solid rgba(255, 255, 255, 0.76) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 15px 38px rgba(60, 69, 91, 0.09) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.12) !important;
  backdrop-filter: blur(8px) saturate(1.12) !important;
}

/* jbbixler SVG displacement: the same optical settings are applied to all four cards. */
#app:not(.visual-export-mode) .overview-main-cards > .overview-action-card {
  --glass-radius: 22px;
  --glass-tint: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(132deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.18) 48%, rgba(211, 224, 255, 0.13)) !important;
  border: 1px solid var(--kd-optical-line) !important;
  box-shadow:
    inset 0 1px 0 var(--kd-optical-highlight),
    inset 0 -1px 0 var(--kd-optical-line-low),
    var(--kd-optical-shadow-soft) !important;
  overflow: hidden;
  transform: translateZ(0);
  transition: transform 190ms cubic-bezier(.22, 1, .36, 1), box-shadow 190ms ease, background-color 190ms ease !important;
}

#app:not(.visual-export-mode) .overview-main-cards > .overview-action-card.kd-liquid-svg-active {
  background: linear-gradient(132deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.095) 52%, rgba(191, 211, 255, 0.1)) !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(74, 94, 128, 0.14),
    var(--kd-optical-shadow-soft) !important;
}

#app:not(.visual-export-mode) .overview-main-cards > .overview-action-card::before {
  background: linear-gradient(127deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.08) 28%, transparent 48%) !important;
  opacity: 0.74 !important;
}

#app:not(.visual-export-mode) .overview-main-cards > .overview-action-card :is(
  .overview-card-kicker,
  .overview-card-body strong,
  .studio-card-link
) {
  color: #283141 !important;
}

#app:not(.visual-export-mode) .overview-main-cards > .overview-action-card :is(
  .overview-card-body span,
  .overview-card-body small,
  .overview-card-empty
) {
  color: #667083 !important;
}

html:is([data-kd-color-mode="dark"], .theme-dark) #app:not(.visual-export-mode) .kd-overview-hero-root > .overview-hero-panel {
  background: linear-gradient(132deg, var(--kd-optical-fill-strong), var(--kd-optical-fill-soft)) !important;
}

html:is([data-kd-color-mode="dark"], .theme-dark) #app:not(.visual-export-mode) .overview-main-cards > .overview-action-card :is(
  .overview-card-kicker,
  .overview-card-body strong,
  .studio-card-link
) {
  color: #f1f4f9 !important;
}

html:is([data-kd-color-mode="dark"], .theme-dark) #app:not(.visual-export-mode) .overview-main-cards > .overview-action-card :is(
  .overview-card-body span,
  .overview-card-body small,
  .overview-card-empty
) {
  color: #b1bac8 !important;
}

@media (hover: hover) and (pointer: fine) {
  #app:not(.visual-export-mode) .overview-main-cards > .overview-action-card:hover {
    transform: translateY(-3px) translateZ(0) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.98),
      inset 0 -1px 0 var(--kd-optical-line-low),
      0 28px 72px rgba(46, 58, 83, 0.16),
      0 6px 18px rgba(46, 58, 83, 0.08) !important;
  }
}

/* Calendar remains stable and readable: optical shell, no text displacement. */
#app:not(.visual-export-mode) .overview-calendar-wrap {
  position: relative;
  padding: 1px;
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(153, 183, 235, 0.2), rgba(255, 186, 207, 0.17));
  box-shadow: var(--kd-optical-shadow-soft);
}

#app:not(.visual-export-mode) .overview-calendar-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.54), rgba(248, 250, 255, 0.3)) !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), inset 0 -1px 0 rgba(78, 96, 128, 0.08) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.1) !important;
  backdrop-filter: blur(12px) saturate(1.1) !important;
}

#app:not(.visual-export-mode) .overview-calendar-panel .calendar-day:not(.today) {
  background: rgba(255, 255, 255, 0.27) !important;
  border: 1px solid rgba(82, 99, 128, 0.16) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62) !important;
}

#app:not(.visual-export-mode) .overview-calendar-panel .calendar-day.today {
  border: 1px solid rgba(36, 47, 66, 0.28) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 20px rgba(28, 38, 58, 0.18) !important;
}

#app:not(.visual-export-mode) .overview-calendar-panel .calendar-nav-btn {
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  background: rgba(255, 255, 255, 0.34) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 5px 13px rgba(46, 58, 83, 0.08) !important;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease !important;
}

@media (hover: hover) and (pointer: fine) {
  #app:not(.visual-export-mode) .overview-calendar-panel .calendar-nav-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.58) !important;
    box-shadow: inset 0 1px 0 #fff, 0 9px 20px rgba(46, 58, 83, 0.12) !important;
  }
}

@media (min-width: 900px) and (pointer: fine) {
  /* Low-strength SVG/CSS navigation glass: no large canvas and no capture. */
  #app:not(.visual-export-mode) #desktopSidebar.kd-liquid-js-surface {
    background:
      linear-gradient(104deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.26)),
      radial-gradient(circle at 12% 8%, rgba(166, 200, 255, 0.2), transparent 36%) !important;
    border: 1px solid rgba(255, 255, 255, 0.78) !important;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.84), var(--kd-optical-shadow-soft) !important;
    -webkit-backdrop-filter: blur(15px) saturate(1.14) !important;
    backdrop-filter: blur(15px) saturate(1.14) !important;
    overflow: hidden !important;
  }

  #app:not(.visual-export-mode) #desktopSidebar.kd-liquid-js-surface::before {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 2px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.92) 18%, rgba(158, 185, 229, 0.28) 70%, transparent);
  }

  #app:not(.visual-export-mode) .studio-search-entry.kd-liquid-js-surface {
    background: rgba(255, 255, 255, 0.34) !important;
    border-color: rgba(255, 255, 255, 0.68) !important;
    -webkit-backdrop-filter: blur(8px) saturate(1.08) !important;
    backdrop-filter: blur(8px) saturate(1.08) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 8px 20px rgba(46, 58, 83, 0.07) !important;
  }

  #app:not(.visual-export-mode) .desktop-nav-item.kd-liquid-js-surface:not(.desktop-nav-active) {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  #app:not(.visual-export-mode) .desktop-nav-item.kd-liquid-js-surface:not(.desktop-nav-active):hover {
    background: linear-gradient(100deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.2)) !important;
    border-color: rgba(255, 255, 255, 0.58) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 8px 20px rgba(46, 58, 83, 0.06) !important;
  }

  /* dashersw/liquid-glass-js adopted buttons keep original content and events. */
  #app:not(.visual-export-mode) .header-top-actions > :is(.aa-launch-link, .top-action-btn, .settings-btn).kd-liquid-js-surface {
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08)) !important;
    border: 1px solid rgba(255, 255, 255, 0.88) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), inset 1px 0 0 rgba(255, 255, 255, 0.38), inset -1px 0 0 rgba(86, 108, 146, 0.14), inset 0 -1px 0 rgba(66, 85, 118, 0.16), 0 12px 28px rgba(41, 52, 75, 0.11) !important;
    -webkit-backdrop-filter: blur(8px) saturate(1.14) !important;
    backdrop-filter: blur(8px) saturate(1.14) !important;
  }

  #app:not(.visual-export-mode) .header-top-actions > :is(.aa-launch-link, .top-action-btn, .settings-btn).kd-liquid-js-live {
    background: rgba(255, 255, 255, 0.1) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  #app:not(.visual-export-mode) .header-top-actions .kd-liquid-js-live > canvas:first-child {
    z-index: 0 !important;
    opacity: 0.76 !important;
    pointer-events: none !important;
    border-radius: inherit !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 10px 25px rgba(41, 52, 75, 0.12) !important;
  }

  #app:not(.visual-export-mode) .header-top-actions .kd-liquid-js-live > :not(canvas) {
    position: relative;
    z-index: 3;
  }
}

@media (max-width: 1099px) {
  #app:not(.visual-export-mode) .kd-overview-hero-root {
    order: 1;
  }

  #app:not(.visual-export-mode) .kd-overview-hero-root > .overview-hero-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.5)) !important;
    -webkit-backdrop-filter: blur(7px) saturate(1.08) !important;
    backdrop-filter: blur(7px) saturate(1.08) !important;
  }
}

@media (max-width: 767px) {
  #app:not(.visual-export-mode) .kd-header-glass-scene {
    display: none !important;
  }

  #app:not(.visual-export-mode) .kd-overview-hero-root,
  #app:not(.visual-export-mode) .kd-overview-hero-root > .overview-hero-panel {
    border-radius: 20px !important;
  }

  #app:not(.visual-export-mode) .kd-overview-hero-root > .kd-liquid-scene {
    border-radius: 20px;
    opacity: 0.54;
  }

  #app:not(.visual-export-mode) .kd-overview-hero-root > .overview-hero-panel,
  #app:not(.visual-export-mode) .overview-main-cards > .overview-action-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.56)) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 11px 28px rgba(50, 62, 86, 0.08) !important;
  }

  #app:not(.visual-export-mode) .overview-main-cards > .overview-action-card {
    overflow: hidden;
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce), (prefers-reduced-transparency: reduce) {
  #app:not(.visual-export-mode) :is(
    #desktopSidebar,
    .header-top-actions > .aa-launch-link,
    .header-top-actions > .top-action-btn,
    .header-top-actions > .settings-btn,
    .overview-hero-panel,
    .overview-action-card,
    .overview-calendar-panel
  ) {
    background: var(--kd-safe-glass-fill) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    transition: none !important;
    transform: none !important;
  }
}
