/* The glass outline moves independently of navigation text and hit targets. */
body.ui-entry .header-container {
  isolation: isolate;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.ui-entry .header-container::before {
  position: absolute;
  inset: -1px;
  z-index: -1;
  border: 1px solid rgb(255 255 255 / 94%);
  border-radius: inherit;
  background: transparent;
  box-shadow: 0 12px 36px rgb(31 58 89 / 9%), inset 0 1px 1px #fff, inset 0 -1px 1px rgb(201 222 248 / 45%);

  content: '';
  pointer-events: none;
  transform-origin: center;
  transition: transform 420ms cubic-bezier(.2,.8,.2,1), box-shadow 420ms ease, background 420ms ease;
}

body.ui-entry .header-container.ui-header-scrolled::before {
  transform: scale(.976, .92);
  background: transparent;
  box-shadow: 0 15px 42px rgb(31 58 89 / 12%), inset 0 1px 1px #fff, inset 0 -1px 1px rgb(183 211 246 / 50%);
}

body[class*="ui-"] :is(button, input[type="button"], input[type="submit"], a.login-button, .index-button-container a, a.btn, a.cta-button, [role="button"]):not(#sidebar *) {
  transition: translate 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms ease, background-color 180ms ease, border-color 180ms ease;
}

body.ui-workspace #magic-tool .tools {
  transition: translate 280ms cubic-bezier(.2,.8,.2,1), box-shadow 280ms ease, border-color 220ms ease;
}

/* Business code sets data-state; these styles never infer state from button text. */
body.ui-workspace #btn_control[data-state="recording"] {
  background: linear-gradient(180deg, #bf4953, #ac3541) !important;
  box-shadow: 0 3px 9px rgb(172 53 65 / 16%), inset 0 1px 0 rgb(255 255 255 / 20%);
}
body.ui-workspace #btn_control[data-state="recording"]::before {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  -webkit-mask: none;
  mask: none;
}
body.ui-workspace #btn_control:is([data-state="connecting"], [data-state="closing"])::before {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  background: transparent;
  -webkit-mask: none;
  mask: none;
}
body[class*="ui-"] :is(button, input[type="submit"])[aria-busy="true"] { cursor: progress; }

@media (hover: hover) and (pointer: fine) {
  body[class*="ui-"] :is(button, input[type="button"], input[type="submit"], a.login-button, .index-button-container a, a.btn, a.cta-button, [role="button"]):not(#sidebar *):not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):hover {
    translate: 0 -1px;
    box-shadow: 0 7px 18px rgb(35 80 138 / 12%), inset 0 1px 0 rgb(255 255 255 / 28%);
  }

  body.ui-workspace #magic-tool .tools:hover {
    translate: 0 -2px;
    border-color: rgb(104 167 240 / 45%);
    box-shadow: 0 16px 32px rgb(31 73 130 / 11%), inset 0 1px 0 #fff;
  }
}

@media (max-width: 580px) {
  body.ui-entry .header-container.ui-header-scrolled::before { transform: scale(.985, .95); }
}

@media (prefers-reduced-transparency: reduce) {
  body.ui-entry .header-container::before,
  body.ui-entry .header-container.ui-header-scrolled::before {
    background: #f7faff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ui-entry .header-container::before,
  body.ui-entry .header-container.ui-header-scrolled::before { transition: none; transform: none; }
  body[class*="ui-"] :is(button, input[type="button"], input[type="submit"], a.login-button, .index-button-container a, a.btn, a.cta-button, [role="button"]):not(#sidebar *),
  body.ui-workspace #magic-tool .tools { transition: none; translate: none; }
}
