.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: 56px;
}
.hero-copy, .hero-demo { display: flex; flex-direction: column; }
.hero-copy { gap: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-demo { width: min(100%, 416px); justify-self: end; gap: 12px; }
.hero-uses { margin-top: 56px; }
.hero-uses ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  row-gap: 8px;
}
.hero-uses a {
  display: block;
  min-height: 44px;
  padding-block: 10px;
  text-underline-offset: .2em;
}

.orb-card {
  position: relative;
  border: 1px solid oklch(80% .07 245 / .18);
  border-radius: 28px;
  padding: 4px 12px 12px;
  background: var(--navy);
}
.orb-btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  max-height: 440px;
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: radial-gradient(circle at 50% 46% in oklch, oklch(42% .07 245) 0%, oklch(29% .05 245) 62%);
  cursor: pointer;
}
.orb-btn svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.orb-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: -6px; }
.orb-btn:disabled { cursor: not-allowed; }

.orb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.orb-picker {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 5px;
  min-width: 0;
}
.orb-picker:last-child { flex: none; }
.orb-picker label { line-height: 18px; }
.orb-sel, .orb-compat-face, .orb-chevron { grid-area: 1 / 2; }
.orb-chevron {
  place-self: center end;
  margin-inline-end: 3px;
  width: 6px;
  height: 6px;
  border: solid var(--ink-2);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.orb-sel { field-sizing: content; }
.orb-sel, .orb-compat-face {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  padding: 0 14px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 500 13px/18px var(--sans);
  cursor: pointer;
}
.orb-compat-face {
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.orb-sel:disabled, .orb-sel:disabled + .orb-chevron,
.orb-compat-face:disabled, .orb-compat-face:disabled + .orb-chevron { opacity: .5; cursor: not-allowed; }
.orb-sel:focus-visible, .orb-compat-face:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }
.orb-compat-face[aria-expanded="true"] { outline: none; }
.orb-sel:open + .orb-chevron { transform: rotate(225deg); }
.orb-compat-face[aria-expanded="true"] + .orb-chevron { transform: rotate(225deg); }
.orb-compat-face:enabled:is(:hover, [aria-expanded="true"]) { color: var(--accent); }

/* Overlay the orb and its footer without moving the header or changing the
   44px target. The near edge clears the 18px setting line by 4px. */
.orb-picker:focus-within { z-index: 3; }
.orb-compat-list {
  position: absolute;
  z-index: 4;
  top: calc(50% + 13px);
  left: 0;
  right: auto;
  box-sizing: border-box;
  width: 15rem;
  max-width: calc(100vw - 76px); /* page insets and card padding */
  max-height: var(--orb-list-height, 50vh);
  overflow: auto;
  overscroll-behavior: contain;
  list-style: none;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--raised);
  color: var(--ink);
  font: 400 14px/1.45 var(--sans);
}
.orb-picker:last-child > .orb-compat-list { width: 8rem; left: auto; right: 0; }
.orb-compat-list[data-above], .orb-picker[data-above] > .orb-compat-list {
  top: auto;
  bottom: calc(50% + 13px);
}
.orb-sel option, .orb-compat-option {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 400 14px/1.45 var(--sans);
  white-space: normal;
  cursor: pointer;
}
.orb-sel option::checkmark { display: none; content: none; }
.orb-sel option:checked, .orb-compat-option[aria-selected="true"] {
  background-color: var(--line-2);
  font-weight: 500;
  --orb-hover: var(--line-3);
}
.orb-sel option:hover, .orb-compat-option:hover { background-color: var(--orb-hover, var(--line)); }
.orb-sel option:is(:focus, :focus-visible), .orb-compat-option[data-active] {
  outline: none;
  background-color: oklch(53% 0 0);
}
@media (pointer: coarse) {
  .orb-sel option, .orb-compat-option { min-height: 36px; }
}
@media (forced-colors: active) {
  .orb-compat-list { border-color: CanvasText; }
  .orb-sel:focus-visible, .orb-compat-face:focus-visible { outline-color: Highlight; }
  .orb-sel option:is(:focus, :focus-visible), .orb-compat-option[data-active] {
    forced-color-adjust: none;
    background-color: Highlight;
    color: HighlightText;
  }
}

@media (max-width: 420px) {
  /* Shorten the closed face visually, never the option or its name. */
  .orb-sel selectedcontent .orb-qualifier, .orb-compat-face .orb-qualifier {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html[data-motion="on"] :is(.orb-sel option, .orb-compat-option) { transition: background-color .12s ease-out; }
  html[data-motion="on"] .orb-chevron { transition: transform .15s var(--ease-out); }
  html[data-motion="on"] .orb-compat-list:not([hidden]) { animation: orb-list-enter .15s ease-out; }
}
@keyframes orb-list-enter { from { opacity: .7; } to { opacity: 1; } }

@supports (appearance: base-select) and selector(::picker(select)) and
  (position-area: block-end span-inline-end) and (position-anchor: --orb-agent-trigger) {
  .orb-sel, .orb-sel::picker(select) { appearance: base-select; }
  .orb-sel { align-items: center; gap: 0; }
  .orb-sel > button { display: contents; color: inherit; font: inherit; }
  .orb-sel::picker-icon { display: none; }
  .orb-sel:enabled:is(:hover, :open) { color: var(--accent); }

  /* Anchor the native top-layer panel to the label/value pair, not the
     narrower select. Agent opens from the left edge, Voice from the right. */
  .orb-picker:has(#orb-agent) { anchor-name: --orb-agent-trigger; }
  #orb-agent::picker(select) { position-anchor: --orb-agent-trigger; }
  .orb-picker:has(#orb-voice) { anchor-name: --orb-voice-trigger; }
  .orb-sel::picker(select) {
    --menu-width: min(15rem, calc(100dvw - 16px));
    position: fixed;
    position-area: block-end span-inline-end;
    inset: auto;
    place-self: start;
    position-try-order: normal;
    position-try-fallbacks: flip-block;
    box-sizing: border-box;
    inline-size: var(--menu-width);
    min-inline-size: 0;
    max-inline-size: 100%;
    block-size: max-content;
    /* Even a centrally placed trigger leaves room on at least one side.
       Scroll the rows rather than detaching the panel on short screens. */
    max-block-size: calc(50dvh - 32px);
    overflow: auto;
    overscroll-behavior: contain;
    /* (44px target - 18px text line) / 2 - 9px = 4px of clearance.
       Symmetric block margins preserve the gap when the picker flips. */
    margin: -9px 0;
    padding: 4px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--raised);
    color: var(--ink);
    font: 400 14px/1.45 var(--sans);
  }
  #orb-voice::picker(select) {
    --menu-width: min(8rem, calc(100dvw - 16px));
    position-anchor: --orb-voice-trigger;
    position-area: block-end span-inline-start;
    justify-self: end;
  }
  .orb-sel:open { outline: none; }

  @media (prefers-reduced-motion: no-preference) {
    html[data-motion="on"] .orb-sel::picker(select) {
      opacity: 0;
      /* Keep the closing panel in the top layer until the fade completes. */
      transition: opacity .15s ease-out, display .15s allow-discrete, overlay .15s allow-discrete;
    }
    html[data-motion="on"] .orb-sel:open::picker(select) {
      opacity: 1;
    }
    @starting-style {
      html[data-motion="on"] .orb-sel:open::picker(select) {
        opacity: 0;
      }
    }
  }
}
.orb-demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.hero-demo [hidden] { display: none; }
.orb-foot {
  position: absolute;
  z-index: 2;
  inset: auto 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  pointer-events: none;
}
.orb-status { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; font-weight: 500; }
.orb-line { max-width: 300px; min-height: 44px; color: oklch(90% .02 245); font-size: 14px; }
/* Connecting and thinking reserve dialogue space even without text. */
.hero-demo:has(#orb-live[hidden]) .orb-line:empty { display: none; }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-demo { justify-self: start; }
}
@media (scripting: none) {
  .orb-foot { display: none; }
}
