.sim-layouts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  align-self: center;
  pointer-events: auto;
  padding: 2px;
  background: #e1e3e5;
  border: 1px solid #cdd0d4;
  border-radius: 10px;
}
.sim-layouts a {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  color: #343b42;
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 550;
  border-radius: 7px;
}
.sim-layouts a[aria-current] { background: #fcfcfd; box-shadow: 0 1px 3px #2a35361e; }
.sim-layouts a:focus-visible, .side-crown:focus-visible { outline: 2px solid #4874a1; outline-offset: 2px; }
.river-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.river-simulator[data-river-ready="true"] .sim-hint.keyboard-guide {
  display: flex;
  justify-content: center;
  inset-inline: max(9px, env(safe-area-inset-left)) max(9px, env(safe-area-inset-right));
  z-index: 2;
}
.keyboard-shortcuts { display: none; }
[data-river-layout="wheel"] [data-keyboard-layout="wheel"],
[data-river-layout="crown"] [data-keyboard-layout="crown"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 12px;
  font: 500 12px/1.35 Inter, -apple-system, system-ui, sans-serif;
}
.keyboard-title { font-weight: 650; }
.keyboard-shortcut { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.keyboard-shortcut kbd {
  min-width: 18px;
  padding: 1px 4px;
  border: 1px solid #ccd0d3;
  border-radius: 5px;
  background: #fefefe;
  color: #353b42;
  font: inherit;
  font-weight: 650;
  text-align: center;
}
[data-river-layout="wheel"] .keyboard-shortcut kbd {
  border-color: #ddba98;
  background: #fff0df;
  color: #482c1f;
}

.handset > .wheel,
[data-river-layout="crown"] .handset > :is(.pad-front, .pad-lanyard, .pad-top-recess, .pad-dial, .pad-talk, .d-pad) { display: none; }

[data-river-layout="wheel"] body.river-simulator {
  --studio-ink: #fff4e5;
  background: radial-gradient(ellipse at 57% 82%, #d9965d 0%, #aa683a 46%, #734121 72%, #512d1b 100%);
}
[data-river-layout="wheel"] .sim-hint { color: #ffe9d5; }
[data-river-layout="wheel"] .sim-stage { padding-top: 108px; }
[data-river-layout="wheel"] .handset {
  --case-outline: polygon(0 5.5%, 7.2% 0, 93% 0, 100% 5.5%, 100% 95%, 93.6% 100%, 6.2% 100%, 0 95.3%);
  width: min(calc(100cqw - 19px), 65cqh, 468px);
  aspect-ratio: 76.6 / 108.49;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border: 0;
  filter: drop-shadow(0 15px 15px #3f1d0d50);
}
[data-river-layout="wheel"] .handset::before,
[data-river-layout="wheel"] .handset::after,
.pad-front {
  position: absolute;
  clip-path: var(--case-outline);
  pointer-events: none;
}
[data-river-layout="wheel"] .handset::before {
  content: '';
  z-index: -3;
  inset: 0 .25% -.48% -3%;
  background: linear-gradient(115deg, #9c7a56, #b4936c 19%, #7f5c3d 72%);
}
[data-river-layout="wheel"] .handset::after {
  content: '';
  z-index: -2;
  inset: 0;
  background: linear-gradient(142deg, #e6cea5 2%, #c9ad83 30%, #b48f66 97%);
}
.pad-front {
  z-index: -1;
  inset: 1.35% 1.65%;
  background: linear-gradient(150deg, #dfc7a0 5%, #d1b38b 65%, #c7a77c 99%);
}
[data-river-layout="wheel"] .handset .cover-glass {
  top: 7%; left: 5.2%; width: 89.6%; height: auto;
  aspect-ratio: 10 / 9;
  border-radius: 4.15%;
  background: #a88057;
  box-shadow: inset 0 2px 4px #75512f62, 0 1px 2px #f4e1c380;
}
[data-river-layout="wheel"] .handset .device-screen {
  top: 7.65%; left: 6%; width: 88%;
  border-radius: 3.05%;
  box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #131311e6;
}

.pad-lanyard {
  position: absolute;
  z-index: -3;
  left: 33%; bottom: 99%; width: 24%; height: 12.2%;
  border: clamp(7px, 2.25cqh, 16px) solid #d7bc92;
  border-right-color: #c8a87e;
  border-top-color: #e5cda7;
  border-radius: 36% 36% 9% 9% / 42% 42% 9% 9%;
  box-shadow: inset -2px 2px 2px #956b4b86, 0 1px 3px #63462d62;
}
.pad-top-recess {
  position: absolute;
  z-index: 1;
  left: 72%; top: 2%; width: 16%; height: 2.6%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 52% 64%, #66615c 0%, #f9f4ea 29%, #867a69 40%, #9b7752 48%, #d4bb96 66%, #eacfa5 77%);
  box-shadow: inset -1px 1px 2px #56382366;
  pointer-events: none;
}
.pad-dial,
.pad-talk {
  position: absolute;
  z-index: 2;
  padding: 0;
  border: 1px solid #201c19;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.pad-dial {
  left: 17.5%; bottom: 98%; width: 15.5%; height: 11%;
  border-radius: 20% / 13%;
  background: linear-gradient(90deg, #07070746, transparent 22%, #0005), repeating-linear-gradient(90deg, #2b2928 0 5px, #373432 5px 6px, #221f1e 6px 8px);
  box-shadow: 0 2px 3px #4e3827a8, inset 1px 0 1px #9e93852f;
  cursor: ns-resize;
}
.pad-dial::before {
  content: '';
  position: absolute;
  inset: -2% -1px auto;
  height: 16%;
  border-radius: 50%;
  background: linear-gradient(180deg, #54514d, #353230);
  box-shadow: inset 0 1px 0 #9e95834f;
}
.pad-dial[data-turning] { filter: brightness(1.18); }
.pad-talk {
  top: 14%; left: -3.5%; width: 7.5%; min-width: 21px; height: 15.6%;
  border-radius: 22% / 13%;
  background: repeating-linear-gradient(180deg, #272423 0 9px, #322e2b 9px 10px, #201d1c 10px 12px);
  box-shadow: inset 2px 0 3px #756b6144, 0 2px 3px #61452b60;
}
.pad-talk[data-pressed] { transform: translateX(2px); }
.pad-talk[aria-pressed="true"] { box-shadow: 0 0 0 1px #e6ebed, 0 0 10px #cfeaffaa; }

.d-pad {
  position: absolute;
  left: 25.2%; top: 81.2%; width: 36%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(146deg, #b18b625e, #e1c49c7c 93%);
  box-shadow: inset 0 2px 3px #77543b66, inset 0 -1px 1px #fae0b953;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.d-pad-cross {
  position: absolute;
  inset: 11.5%;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px #4b33249c);
}
.d-pad-cross::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, #423e3b 3%, #2c2928 35%, #212120 97%);
  clip-path: polygon(36% 0, 64% 0, 68% 4%, 68% 32%, 96% 32%, 100% 36%, 100% 64%, 96% 68%, 68% 68%, 68% 96%, 64% 100%, 36% 100%, 32% 96%, 32% 68%, 4% 68%, 0 64%, 0 36%, 4% 32%, 32% 32%, 32% 4%);
}
.d-pad button { position: absolute; padding: 0; border: 0; border-radius: 6px; background: transparent; }
.d-pad :is(.d-pad-up, .d-pad-down) { height: 37%; width: 42%; left: 29%; }
.d-pad-up { top: 3%; }
.d-pad-down { bottom: 3%; }
.d-pad :is(.d-pad-left, .d-pad-right) { height: 42%; width: 37%; top: 29%; }
.d-pad-left { left: 3%; }
.d-pad-right { right: 3%; }
.d-pad:has(button:is(:active, [data-pressed])) .d-pad-cross { transform: translateY(1px); filter: brightness(.84); }

[data-river-layout="wheel"] .case-select { left: 65.7%; top: 83.55%; }
[data-river-layout="wheel"] .case-home { left: 83.5%; top: 76.8%; }
[data-river-layout="wheel"] .case-key {
  width: max(13.4%, 40px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #211e1c;
  background: linear-gradient(140deg, #403b38, #262423 72%);
  box-shadow: 0 0 0 3px #d0ae83, 0 0 0 4px #a57e54, inset 1px 1px 2px #82766b51;
  color: #b4a493;
  touch-action: none;
  -webkit-touch-callout: none;
}
[data-river-layout="wheel"] .case-key:is(:active, [data-pressed]) { background: #24211f; box-shadow: 0 0 0 3px #d0ae83, 0 0 0 4px #9d794e, inset 0 2px 4px #110d0ba8; }
[data-river-layout="wheel"] .case-key svg { width: 53%; max-width: 25px; }
.case-select span { width: 39%; aspect-ratio: 1; border: 1px solid #b4a493a9; border-radius: 50%; box-shadow: inset 0 0 0 1px #24211e; }
:is(.d-pad button, .pad-dial, .pad-talk, .case-key):focus-visible { outline: 2px solid #ffedd2; outline-offset: 2px; }

[data-river-layout="crown"] .handset {
  --crown-size: clamp(16px, 4.4cqw, 27px);
  width: min(calc(100cqw - var(--crown-size)), 67.1cqh, 468px);
  aspect-ratio: 76.6 / 113.4;
  border-radius: 5.4% / 3.65%;
  margin-left: var(--crown-size);
}
[data-river-layout="crown"] .handset .cover-glass {
  top: 3.7%; left: 2%; width: 96%; height: 85%; border-radius: 5.2% / 4.57%;
}
[data-river-layout="crown"] .handset .device-screen {
  top: 5%; left: 3.5%; width: 93%;
  aspect-ratio: 71.2 / 92.6;
  border-radius: 5.1% / 3.92%;
}
[data-river-layout="crown"] .device-screen:focus { outline: none; }
[data-river-layout="crown"] .wheel, [data-river-layout="crown"] .case-key { display: none; }

.side-crown {
  position: absolute;
  z-index: 2;
  top: 15.7%;
  right: calc(100% - 3px);
  width: var(--crown-size);
  height: 12.3%;
  min-height: 44px;
  display: grid;
  place-items: stretch;
  padding: 4px 2px;
  background: #25282b;
  color: #e8ecef;
  border: 1px solid #171a1d;
  border-radius: 8px 3px 3px 8px;
  box-shadow: 0 2px 4px #181d2640;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.crown-grooves {
  display: block;
  border-radius: inherit;
  background: repeating-linear-gradient(0deg, #303437 0 2px, #23272a 2px 5px);
}
.side-crown[data-pressed], .side-crown:active { transform: translateX(2px); }
.side-crown[data-listening] { box-shadow: 0 0 0 2px #c5e3fa, 0 0 13px #96c9e792; }

[data-river-layout="crown"] .app-dock[data-layout="circle"] .orbit-name { top: calc(15.6667cqw - 63.32cqw * var(--spread, 0)); }
[data-river-layout="crown"] .circle-invitation { top: 46%; }

.crown-app-rail { z-index: 2; }
.crown-app-rail .thread-contact:is(:hover, :focus-visible) { color: #fff; }
.crown-app-rail .thread-contact svg { width: 100%; height: 100%; }
.crown-app-rail .thread-contact.chosen { color: #fff; }
.crown-app-rail .thread-contact span { text-shadow: 0 1px 8px #000, 0 0 4px #000; }
.crown-app-rail .thread-contact.chosen::before {
  position: absolute;
  inset: -.6cqw;
  border-radius: 50%;
  border: 1px solid #e2e9e7b0;
  content: '';
  pointer-events: none;
}
.crown-app-rail .thread-fade {
  background: linear-gradient(90deg, #080909 1%, #080909f2 22%, #080909d8 33%, #08090918 57%, transparent 76%);
}
[data-river-layout="crown"] .river-page[data-crown-dock-open] .messages-thread .thread-rail { visibility: hidden; }

.crown-edge, .crown-all-apps { position: absolute; z-index: 6; border: 0; padding: 0; display: grid; place-items: center; color: #ecf1f1; }
.crown-edge { width: min(34px, 7.2cqw); height: max(44px, 13cqw); top: 45%; background: transparent; }
.crown-edge--dock { left: 0; }
.crown-edge--back { right: 0; }
.crown-edge i { width: 3px; height: 23px; border-radius: 4px; background: #d5dcdf99; }
.crown-edge--back i { width: 7px; height: 7px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: .75; background: transparent; border-radius: 0; }
.crown-edge--back:hover i, .crown-edge--dock:hover i { opacity: 1; }
.river-page[data-crown-home] .crown-edge--back { visibility: hidden; }
.crown-all-apps {
  top: 3.2%; left: 3.4%;
  width: max(38px, 8.8cqw); height: max(38px, 8.8cqw);
  border-radius: 50%;
  background: #141719;
  visibility: hidden;
}
.crown-all-apps svg { width: 68%; height: 68%; }
.river-page[data-crown-dock-open]:not([data-crown-dock-idle]) .crown-all-apps { visibility: visible; }
.river-page[data-crown-dock-open]:not([data-crown-dock-idle]) .bud-status-row { opacity: .55; }

/* The rail uses the left edge, leaving the original action bar at the foot of each app. */
[data-river-layout="crown"] #screen .voice-key { min-height: max(39px, 8.25cqw); }
[data-river-layout="crown"] #screen :is(.river-content > .app-actions,.river-home > .app-actions,.thread-actions) { bottom: 4.5%; }
[data-river-layout="crown"] #screen .river-content > .river-chat,
[data-river-layout="crown"] #screen .river-content .river-rows:is(.meetings,.notes,.tasks) { bottom: max(15.2%, 54px); }
[data-river-layout="crown"] #screen .thread-content { bottom: max(15.2%, 56px); }
[data-river-layout="crown"] #screen .river-entry article { bottom: max(18%, 62px); }
[data-river-layout="crown"] #screen .grok-prompt { bottom: max(15.2%, 54px); }
[data-river-layout="crown"] #screen .grok-detail > .voice-key { bottom: 4.5%; }
[data-river-layout="crown"] #screen .river-home .river-orb { top: 44%; }

@media (max-width: 600px) {
  .sim-layouts { gap: 2px; background: #e4e6e8; }
  .sim-layouts a { min-height: 32px; font-size: 11.5px; padding-inline: 6px; }
  .sim-header { display: flex; gap: 5px; align-items: flex-end; }
}

@media (max-width: 600px), (pointer: coarse) and (max-height: 600px) {
  .keyboard-guide { bottom: calc(env(safe-area-inset-bottom) + 54px); }
  [data-river-layout] .keyboard-shortcuts { gap: 4px 8px; font-size: 11px; }
  .sim-stage { padding-bottom: 107px; }
  [data-river-layout="wheel"] .sim-stage { padding-top: 62px; }
}

@media (max-width: 360px) {
  [data-river-layout="crown"] .sim-stage { padding-bottom: 131px; }
}

.d-pad .d-pad-centre{inset:38%;width:24%;height:24%;border-radius:50%;z-index:1}.d-pad-centre::after{content:"";position:absolute;inset:34%;border-radius:50%;background:#ffffff24}
