/*
 * Insights signal field
 *
 * The renderer is deliberately below the canonical Core shell. The main
 * content surface stays opaque, so this layer can only frame the workspace.
 */
:root {
  --insights-background-content-left: 0px;
  --insights-background-content-right: 100%;
  --insights-background-fade: 22px;
}

#appRoot {
  position: relative;
  isolation: isolate;
}

.insights-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.insights-background__canvas {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(
    90deg,
    #000 0,
    #000 max(0px, calc(var(--insights-background-content-left) - var(--insights-background-fade))),
    transparent var(--insights-background-content-left),
    transparent var(--insights-background-content-right),
    #000 min(100%, calc(var(--insights-background-content-right) + var(--insights-background-fade))),
    #000 100%
  );
  mask-image: linear-gradient(
    90deg,
    #000 0,
    #000 max(0px, calc(var(--insights-background-content-left) - var(--insights-background-fade))),
    transparent var(--insights-background-content-left),
    transparent var(--insights-background-content-right),
    #000 min(100%, calc(var(--insights-background-content-right) + var(--insights-background-fade))),
    #000 100%
  );
}

.insights-background__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .24), transparent 38%, rgba(255, 255, 255, .16));
  opacity: .48;
}

.main-content {
  z-index: 1;
}

[data-theme="dark"] .insights-background__veil {
  background: linear-gradient(180deg, rgba(15, 17, 23, .34), transparent 38%, rgba(15, 17, 23, .2));
  opacity: .42;
}

@media (max-width: 1199px) {
  .insights-background {
    opacity: .72;
  }

  .insights-background__veil {
    opacity: .62;
  }
}

@media (max-width: 767px) {
  .insights-background {
    opacity: .5;
  }

  .insights-background__veil {
    opacity: .74;
  }
}

@media (max-width: 580px), (prefers-reduced-motion: reduce) {
  .insights-background__canvas {
    -webkit-mask-image: linear-gradient(90deg, #000, transparent 28%, transparent 72%, #000);
    mask-image: linear-gradient(90deg, #000, transparent 28%, transparent 72%, #000);
  }
}

/* Ambient mode controls mirror Ledger's profile-menu affordance. */
.profile-ambient-mode-options {
  display: grid;
  gap: 6px;
  margin: 0 12px 8px;
}

.profile-ambient-mode-option {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.profile-ambient-mode-option:hover,
.profile-ambient-mode-option:focus-visible,
.profile-ambient-mode-option.is-active {
  background: color-mix(in srgb, var(--ionix-product-accent) 5%, var(--surface) 95%);
  border-color: color-mix(in srgb, var(--ionix-product-accent) 34%, var(--border) 66%);
}

.profile-ambient-mode-option:hover,
.profile-ambient-mode-option:focus-visible {
  transform: translateY(-1px);
}

.profile-ambient-mode-option.is-active {
  box-shadow: inset 2px 0 0 var(--ionix-product-accent);
}

.profile-ambient-mode-swatch {
  position: relative;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 9px;
  background: #121427;
}

.profile-ambient-mode-swatch::before,
.profile-ambient-mode-swatch::after {
  position: absolute;
  left: -5px;
  width: 38px;
  height: 1px;
  border-radius: 999px;
  content: "";
  transform: rotate(-18deg);
}

.profile-ambient-mode-swatch::before { top: 10px; }
.profile-ambient-mode-swatch::after { top: 17px; }
.profile-ambient-mode-swatch.mode-quiet::before { background: #6b63bd; box-shadow: 0 0 6px rgba(108, 92, 231, .42); }
.profile-ambient-mode-swatch.mode-quiet::after { background: #4b7cb8; box-shadow: 0 0 5px rgba(96, 165, 250, .32); }
.profile-ambient-mode-swatch.mode-flow::before { background: #8a7cff; box-shadow: 0 0 7px rgba(108, 92, 231, .55); }
.profile-ambient-mode-swatch.mode-flow::after { background: #5eb3ff; box-shadow: 0 0 7px rgba(96, 165, 250, .48); }
.profile-ambient-mode-swatch.mode-luminous::before { background: #b1a8ff; box-shadow: 0 0 9px rgba(139, 92, 246, .72); }
.profile-ambient-mode-swatch.mode-luminous::after { background: #8fd0ff; box-shadow: 0 0 9px rgba(96, 165, 250, .66); }

.profile-ambient-mode-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile-ambient-mode-title { font-size: 13px; font-weight: 600; }
.profile-ambient-mode-meta { color: var(--text-muted); font-size: 11px; line-height: 1.25; }
.profile-ambient-mode-selected { min-width: 52px; color: var(--ionix-product-accent); font-size: 10px; font-weight: 700; text-align: right; }

@media (max-width: 980px) {
  /* Keep the account control in the mobile topbar so its profile menu—and
     the ambient mode switch—remain reachable on phones. */
  .topnav-top { flex-wrap: nowrap; }
  .topnav-icons { order: initial; margin-left: auto; }
}
