/* Performance Mode: static decoration, live controls and data.
   Loaded last so legacy mobile rules cannot restore expensive effects. */
html.perf-lite .day-cycle-arc,
html.perf-lite .day-cycle-arc *,
html.perf-lite .day-cycle-arc *::before,
html.perf-lite .day-cycle-arc *::after {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important;
  transition: none !important;
  will-change: auto !important;
}
/* Sky colour and clock remain; omit layers designed around large soft blurs. */
html.perf-lite :is(.day-cycle-arc__sun-rays,.day-cycle-arc__sun-haze,.day-cycle-arc__moon-halo,.day-cycle-arc__shooting-stars,.arc-weather-accumulation) {
  display: none !important;
}
html.perf-lite .glass-panel::before,
html.perf-lite .glass-panel::after,
html.perf-lite .device-status-light,
html.perf-lite .latency-live,
html.perf-lite .billie-energy-sheen {
  animation: none !important;
  filter: none !important;
  will-change: auto !important;
}
html.perf-lite .subscription-card__bg-video { display: none !important; }
html.perf-lite .subscription-card { background: linear-gradient(145deg,#303844,#151922) !important; }
html.perf-lite #matrix-sea { display: none !important; }
/* Off-screen panels should not maintain speculative compositor layers. */
html.perf-lite :is(.life-panel,.trading__sim-panel,.timing__panel,.routine-finance-panel,.color_engine-panel):not(.is-open) {
  will-change: auto !important;
}
html.perf-lite .subscription-card__ivy-branch,
html.perf-lite .subscription-purchase-button__text::before,
html.perf-lite .ai-panel__energy-fill::after {
  animation: none !important;
  filter: none !important;
}
html.perf-lite :is(.life-panel,.trading__sim-panel,.timing__panel,.routine-finance-panel,.color_engine-panel):not(.is-open) *,
html.perf-lite :is(.life-panel,.trading__sim-panel,.timing__panel,.routine-finance-panel,.color_engine-panel):not(.is-open) *::before,
html.perf-lite :is(.life-panel,.trading__sim-panel,.timing__panel,.routine-finance-panel,.color_engine-panel):not(.is-open) *::after {
  animation-play-state: paused !important;
}

/* Performance+ leaves geometry and content intact, retaining the background arc. */
html:root.perf-plus.perf-lite *, html:root.perf-plus.perf-lite *::before, html:root.perf-plus.perf-lite *::after {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  filter: none !important; box-shadow: none !important; text-shadow: none !important;
  mix-blend-mode: normal !important; will-change: auto !important;
  animation-duration: 1ms !important; animation-delay: 0ms !important;
  animation-iteration-count: 1 !important; transition-duration: 1ms !important;
  transition-delay: 0ms !important; scroll-behavior: auto !important;
}
html.perf-plus :is(.glass-panel,.ai-panel__surface,.timing__panel,.routine-finance-panel,.trading__sim-panel,.life-panel,.color_engine-panel,.profile-panel) {
  background: #252a32 !important; color: #e7eaf0;
  --ambient-text-primary: #e7eaf0; --ambient-text-secondary: #bac2cf;
}
html.perf-plus .glass-panel::before, html.perf-plus .glass-panel::after { content: none !important; }
/* Performance+ uses opaque surfaces, so home text must not follow the sky's
   light-background palette. Scope this to Billie, not other panels. */
html:root.perf-plus .ai-panel,
html:root.perf-plus .ai-panel__surface,
html:root.perf-plus .ai-panel__input-pill {
  --ambient-text-primary: #f5f7fa !important;
  --ambient-text-secondary: #cbd5e1 !important;
  color: #f5f7fa;
}
html:root.perf-plus :is(.ai-panel-Premium-connect-line,.divider-Conversation__button,.ai-panel__input-pill) {
  background: #303946 !important;
  border-color: #738195 !important;
}
html:root.perf-plus :is(.ai-panel__energy-wrap,.ai-panel__input-field) {
  background: #222a35 !important;
}
html:root.perf-plus :is(.ai-connect-rail__status,.ai-connect-rail__status strong,.ai-focus-trigger,.ai-panel__energy-label,.ai-panel__energy-label strong,.divider-Conversation__button,.ai-panel__input-field) {
  color: #f5f7fa !important;
}
html:root.perf-plus .ai-panel__input-field::placeholder {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}
/* Keep the login gate's pointer/disabled behaviour, without multiplying two
   opacity reductions that make its labels disappear. */
html:root.perf-plus .ai-panel.is-open,
html:root.perf-plus .ai-panel__input-pill.is-disabled,
html:root.perf-plus .ai-panel__input-pill.is-disabled .ai-panel__input-field {
  opacity: 1 !important;
}
html:root.perf-plus :is(.billie-typewriter.is-disabled,.ai-focus-trigger[aria-disabled="true"]) {
  opacity: .8 !important;
}
html.perf-plus .day-cycle-arc { background: transparent !important; }
html.perf-plus :is(.day-cycle-arc__clouds,.day-cycle-arc__weather,.day-cycle-arc__stars,.day-cycle-arc__sun,.day-cycle-arc__moon) { display: none !important; }
.perf-plus-option { display:flex; align-items:center; justify-content:space-between; flex-basis:100%; gap:12px; padding-top:10px; margin-top:10px; border-top:1px solid #ffffff20; font-size:14px; color:#fff; }
.perf-mode-container-bar { flex-wrap:wrap; }
.perf-plus-checkbox { width:42px; height:26px; padding:3px; border:0; border-radius:20px; background:#747982; cursor:pointer; }
.perf-plus-checkbox span { display:block; width:20px; height:20px; border-radius:50%; background:white; }
.perf-plus-checkbox[aria-checked="true"] { background:#34c759; }
.perf-plus-checkbox[aria-checked="true"] span { transform:translateX(16px); }
.dark-mode-container-bar[data-category="function"] { top:232px !important; }
@media(max-width:768px) { .dark-mode-container-bar[data-category="function"] { top:386px !important; } }
.perf-mode-container-bar[data-category="function"] {
  height: 88px !important; min-height: 88px !important; align-content: flex-start;
}
.perf-mode-container-bar > .perf-mode-label { display:flex; align-items:center; min-height:44px; }
.perf-mode-container-bar > .perf-plus-option { box-sizing:border-box; height:40px; margin:0; padding:0; }

/* Two evenly sized rows; keep captions from wrapping controls onto a third line. */
.perf-mode-container-bar[data-category="function"] {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 44px 44px;
  align-content: start;
  column-gap: 12px;
}
.perf-mode-container-bar[data-category="function"].visible { display: grid !important; }
.perf-mode-container-bar > .perf-mode-label { min-width: 0; min-height: 0; grid-column: 1; grid-row: 1; }
.perf-mode-container-bar > .perf-mode-checkbox { grid-column: 2; grid-row: 1; justify-self: end; margin: 0; }
.perf-mode-container-bar > .perf-mode-caption,
.dark-mode-container-bar > .dark-mode-caption { display: none !important; }
.perf-mode-container-bar > .perf-plus-option {
  grid-column: 1 / -1; grid-row: 2; height: 44px;
  align-self: stretch; align-items: center; margin: 0; padding: 0;
  font: inherit; color: inherit;
}
.perf-plus-option > span { font-size: .85rem; font-weight: 500; }
.perf-plus-checkbox { flex: 0 0 42px; margin: 0; }
