/* A web approximation of the native app's behind-window vibrancy.
 * The native surface is tinted at 62%; content cards darken it at 66%.
 * Glass is reserved for window furniture and floating controls; charts stay quiet. */
:root {
  --window-material: rgba(5, 6, 8, .62);
  --card-material: rgba(11, 13, 15, .66);
  --group-material: rgba(31, 32, 38, .62);
  --glass-edge: rgba(255, 255, 255, .16);
  --glass-reflection: linear-gradient(135deg, rgba(255,255,255,.055), transparent 32%, rgba(255,255,255,.018) 74%, rgba(255,255,255,.035));
}
.win, .frag, .native-controls { --group: var(--group-material); }
.win {
  background: var(--glass-reflection), var(--window-material);
  backdrop-filter: blur(32px) saturate(1.25);
  -webkit-backdrop-filter: blur(32px) saturate(1.25);
  box-shadow: inset 0 0 0 .5px var(--glass-edge), inset 0 1px 0 rgba(255,255,255,.12), 0 24px 70px rgba(0,0,0,.28);
}
.win__bar { background: linear-gradient(rgba(255,255,255,.025), transparent); }
.win__chart { background: var(--card-material); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.09); }
.win__sidebar { background: rgba(8,10,13,.09); }
/* Liquid Glass controls. From the bottom up: the blurred, saturated backdrop (bent at the rim by
 * glass.js where the browser can), a clear tint, a sheen that sits above the control until a
 * pointer moves it, and the edge light glass.js draws for the control's exact shape (--lg-rim).
 * Until that arrives, and where scripts are off, inset shadows stand in for the rim. */
:is(.win__sbtn, .win__tools, .status, .mk:not(.is-done), .readout, .tip, .sugg__do, .native-button, .btn--ghost, .btn--soon) {
  background-image: var(--lg-rim, none),
    radial-gradient(var(--lg-sheen-w, 120px) var(--lg-sheen-h, 64px) at var(--lg-x, 28%) var(--lg-y, -34px), rgba(255,255,255,var(--lg-glow, .1)), transparent 72%),
    linear-gradient(172deg, rgba(255,255,255,.06), transparent 44%, rgba(255,255,255,.028));
  background-size: 100% 100%; background-repeat: no-repeat; background-origin: border-box; background-clip: border-box;
  border-color: transparent;
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: var(--lg-filter, blur(18px) saturate(1.5));
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.2), inset 0 1px 0 rgba(255,255,255,.2), inset 0 -1px 0 rgba(255,255,255,.07),
              inset 0 0 10px rgba(255,255,255,.035), 0 8px 22px -10px rgba(0,0,0,.55);
}
/* Once glass.js has drawn the rim, the shadow falls away from the light (--lg-sx, --lg-sy) and sits
 * deep enough that the control reads as lifted off the page. */
:is(.win__sbtn, .win__tools, .status, .mk:not(.is-done), .readout, .tip, .sugg__do, .native-button, .btn--ghost, .btn--soon)[data-lg] {
  box-shadow: inset 0 0 18px rgba(255,255,255,.04),
              var(--lg-sx, 0px) var(--lg-sy, 12px) var(--lg-shadow-blur, 32px) -12px rgba(0,0,0,var(--lg-shadow, .72)),
              calc(var(--lg-sx, 0px) * .25) calc(var(--lg-sy, 12px) * .25) 5px -1px rgba(0,0,0,calc(var(--lg-shadow, .72) * .45));
}
/* The page's lifted glass: the shadow and sheen ease as the light swings. */
:is(.btn--ghost, .btn--soon)[data-lg] { transition: transform .18s var(--ease, ease), background-color .2s, box-shadow .25s ease-out; }
/* Inside the app the glass is the app's: no sheen, a faint edge, a shallow shadow. */
.win :is(.win__sbtn, .win__tools, .status, .mk:not(.is-done), .readout, .tip, .sugg__do), .native-button {
  background-image: var(--lg-rim, none), linear-gradient(172deg, rgba(255,255,255,.03), transparent 50%);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.1), inset 0 1px 0 rgba(255,255,255,.07);
}
.win :is(.win__sbtn, .win__tools, .status, .mk:not(.is-done), .readout, .tip, .sugg__do)[data-lg], .native-button[data-lg] {
  box-shadow: calc(var(--lg-sx, 0px) * .6) calc(var(--lg-sy, 10px) * .6) 16px -11px rgba(0,0,0,.55);
}
/* The title bar's glass sits on the window's own material. .win is a backdrop root, so a backdrop
 * filter there sees only that dark fill and lays it down a second time, which reads as black.
 * These two are a light translucent fill with the rim instead, as the native title bar's are. */
.win :is(.win__sbtn, .win__tools) { -webkit-backdrop-filter: none; backdrop-filter: none; }
.win__sbtn { background-color: rgba(255,255,255,.1); }
.mk { border: 0; }
.mk.is-done { -webkit-backdrop-filter: none; backdrop-filter: none; }
.native-button, .btn--ghost { transition: transform .18s var(--ease, ease), background-color .2s; }
.native-button:active, .btn--ghost:active { transform: scale(.97); }
.win__tools { background-color: rgba(255,255,255,.075); border-color: rgba(255,255,255,.08); }
.dropbtn { background: var(--lg-rim, none) 0 0 / 100% 100% no-repeat, linear-gradient(150deg, rgba(255,255,255,.09), transparent 55%), rgba(72,83,102,.42); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.16), inset 0 1px 0 rgba(255,255,255,.12); }
.dropbtn[data-lg] { box-shadow: none; }
.dropbtn.is-open { background: var(--lg-rim, none) 0 0 / 100% 100% no-repeat, rgba(255,255,255,.1); }
.status { background-color: rgba(46,49,58,.5); }
.mk:not(.is-done) { background-color: rgba(100,104,115,.15); }
.mk.is-next { background-color: rgba(10,105,205,.66); }
.igroup { background-image: linear-gradient(130deg, rgba(255,255,255,.018), transparent 60%); }
.igroup--stats { background-color: rgba(33,35,42,.5); }
.ctl__track em { background: linear-gradient(160deg, #fbfbfd, #d4d6de); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.75), inset 0 1px 0 #fff, 0 1px 3px rgba(0,0,0,.45), 0 0 0 .5px rgba(0,0,0,.18); }
.stepper, .ask__send { background: linear-gradient(150deg, rgba(255,255,255,.13), rgba(255,255,255,.07)); }
.toggle { background: linear-gradient(150deg, rgba(255,255,255,.16), transparent), rgba(10,132,255,.86); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.16); }
.toggle::after { background: linear-gradient(160deg, #fff, #dfe1e8); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.8), 0 1px 2px rgba(0,0,0,.35); }
.tip, .readout { background-color: rgba(25,28,36,.78); border-color: rgba(255,255,255,.14); }

/* The same materials in the profile sheet and its neighboring app fragments. */
.design-card { background: linear-gradient(145deg, rgba(255,255,255,.018), transparent 50%), rgba(17,18,20,.88); }
.design-card__ui { position: relative; isolation: isolate; }
.design-card__ui::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 12px; pointer-events: none; background: radial-gradient(ellipse at 5% 10%, rgba(77,148,255,.07), transparent 60%), radial-gradient(ellipse at 95% 90%, rgba(176,108,255,.05), transparent 65%); }
.phase-editor::before, .ask-designer::before { content: none; }
.profile-sheet { background: var(--glass-reflection), rgba(31,32,44,.74); outline-color: rgba(255,255,255,.1); }
.profile-sheet, .profile-chart, .phase-list, .frag {
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}
.profile-fields { background: rgba(255,255,255,.038); }
.profile-chart { background: var(--card-material); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.07); }
.phase-list { background: var(--glass-reflection), var(--group-material); }
.native-button { background-color: rgba(25,91,151,.55); }
.frag { background: var(--glass-reflection), rgba(20,21,25,.74); }

/* The timeline keeps its broad page fades and stable framing. */
.stage__scene { background: transparent; }
.stage .win { background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .win { background-color: #121317; }
  .profile-sheet { background-color: #20212c; }
  .native-controls, .tip, .readout { --group: #1a1b20; background-color: #181a20; }
  .beam .native-controls::before { background: #181a20; }
}
@media (prefers-reduced-transparency: reduce) {
  .win, .profile-sheet, .frag, .native-controls, .beam[data-focus] .native-controls { background-color: #15161b; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .win__chart, .profile-chart { background-color: #0c0d0f; }
  .beam .native-controls::before { background: #15161b; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
