/* Same approved panel/button PNGs, with uniformly scaled nine-slice corners.
   The scroll body never displaces the upgrade action or covers navigation. */
.stage[data-screen="robots"] .robot-panel.robot-detail {
  right: 2.8%; top: 15%; width: 44%; height: 69%; max-height: 69%;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px;
  padding: 8px 12px; overflow: visible; background: none;
  border: solid transparent; border-width: 23px 16px;
  border-image-source: var(--ui-panel-readable); border-image-slice: 230 160 230 160 fill;
  border-image-width: 1; border-image-repeat: stretch;
}
.robot-detail-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.robot-detail-heading h2 { margin: 0; font-size: clamp(20px, 2cqw, 30px); line-height: 1.2; }
.robot-detail-heading > small { flex: 0 0 auto; font-size: 12px; line-height: 1.3; }
.robot-detail-body { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 3px 6px 5px 3px; }
.robot-detail-body:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.robot-detail-identity { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.robot-detail-identity h3 { margin: 0; min-width: 0; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.robot-detail-identity h3 small { margin-left: 10px; font-size: 13px; white-space: nowrap; }
.robot-detail-identity .robot-state { margin: 0; min-width: 0; flex: 0 0 auto; text-align: center; }
.robot-detail-overview { display: grid; grid-template-columns: minmax(0, 36%) minmax(0, 1fr); gap: 14px; align-items: center; }
.robot-detail-head { height: clamp(90px, 11cqw, 170px); min-width: 0; display: grid; place-items: center; background: rgba(33,143,160,.12); border-bottom: 2px solid var(--teal); }
.robot-detail-head img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.robot-detail-head-fallback { width: 64px; height: 64px; object-fit: contain; }
.robot-detail-attributes { display: grid; gap: 9px; margin: 0; min-width: 0; }
.robot-detail-attribute { display: grid; grid-template-columns: 26px auto minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; font-size: 17px; }
.robot-detail-attribute-icon { width: 26px; height: 26px; object-fit: contain; }
.robot-detail-attribute dt { font-weight: 800; }
.robot-detail-attribute dd { margin: 0; padding: 3px 6px; min-width: 0; text-align: right; background: rgba(16,61,76,.12); font-weight: 900; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.robot-detail-route { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--teal); }
.robot-detail-route > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; }
.robot-detail-route h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.robot-detail-route header span { font-size: 12px; line-height: 1.4; }
.robot-detail-destination { display: flex; align-items: center; gap: 12px; padding: 6px 0 0; }
.robot-detail-location-art { width: 34%; height: clamp(72px, 7cqw, 105px); object-fit: contain; flex: 0 0 34%; }
.robot-detail-destination > div { min-width: 0; }
.robot-detail-destination strong { font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.robot-panel.robot-detail .robot-detail-destination p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.robot-detail-upgrade { display: grid; gap: 5px; border-top: 1px dashed var(--teal); padding-top: 8px; min-width: 0; }
.robot-detail-cost { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 12px; font-size: 13px; line-height: 1.4; }
.robot-detail-cost > span { min-width: 0; overflow-wrap: anywhere; }
.robot-detail-cost .exact-count { white-space: normal; overflow-wrap: anywhere; }
.robot-panel.robot-detail .robot-detail-upgrade-note { font-size: 12px; line-height: 1.5; margin: 8px 0 0; }
.stage[data-screen="robots"] .robot-detail-upgrade-button {
  position: relative; isolation: isolate; min-width: 0; width: 80%; justify-self: center;
  min-height: 48px; padding: 8px 14px; background: none; border: 0; font-size: 22px; line-height: 1.25;
}
.robot-detail-upgrade-button::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border: solid transparent; border-width: 14.4px 22.8px; border-image-source: var(--ui-button-primary); border-image-slice: 60 95 60 95 fill; border-image-width: 1; border-image-repeat: stretch; }
/* Transaction errors must be immediately legible, including when the host
   throttles opacity transitions. Keep the existing message/timer ownership. */
.app-shell:has(.stage[data-screen="robots"]) > .status-rail .toast { transition: none; }
@media (orientation: landscape) and (min-width: 640px) and (max-height: 760px),
       (orientation: landscape) and (min-width: 640px) and (max-width: 1280px) {
  .stage[data-screen="robots"] .robot-panel.robot-detail { right: 3%; top: 17%; width: 44%; height: 70%; max-height: 70%; border-width: 17.25px 12px; padding: 3px 6px; gap: 4px; }
  .robot-detail-heading h2 { font-size: 16px; margin: 0; }
  .robot-detail-heading > small { font-size: 11px; }
  .robot-detail-body { padding: 2px 4px 4px 2px; }
  .robot-detail-identity { gap: 4px; margin-bottom: 4px; }
  .robot-detail-identity h3 { font-size: 14px; }
  .robot-detail-identity h3 small { margin-left: 6px; font-size: 12px; }
  .robot-detail-identity .robot-state { font-size: 12px; padding: 3px 5px; }
  .robot-detail-overview { grid-template-columns: minmax(0, 32%) minmax(0, 1fr); gap: 6px; }
  .robot-detail-head { height: 70px; }
  .robot-detail-attributes { gap: 4px; }
  .robot-detail-attribute { grid-template-columns: 18px auto minmax(0, 1fr); gap: 4px; font-size: 12px; }
  .robot-detail-attribute-icon { width: 18px; height: 18px; }
  .robot-detail-attribute dd { padding: 1px 4px; }
  .robot-detail-route { margin-top: 7px; padding-top: 6px; }
  .robot-detail-route h3 { font-size: 14px; }
  .robot-detail-route header span { font-size: 11px; }
  .robot-detail-destination { gap: 6px; }
  .robot-detail-location-art { height: 66px; }
  .robot-detail-destination strong { font-size: 14px; }
  .robot-panel.robot-detail .robot-detail-destination p { font-size: 12px; }
  .robot-detail-upgrade { grid-template-columns: minmax(0, 1fr) minmax(82px, 36%); align-items: center; gap: 6px; padding-top: 4px; }
  .robot-detail-cost { flex-direction: column; font-size: 12px; gap: 2px; }
  .stage[data-screen="robots"] .robot-detail-upgrade-button { min-height: 40px; width: 100%; padding: 6px 10px; font-size: 16px; }
  .stage[data-screen="robots"] > .screen-runtime > .action-dock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (orientation: landscape) and (min-width: 640px) and (max-width: 700px) {
  .stage[data-screen="robots"] .robot-panel.robot-detail { top: 16%; height: 72%; max-height: 72%; }
  .robot-detail-head { height: 60px; }
  .robot-detail-attributes { gap: 3px; }
  .robot-detail-attribute { line-height: 1.25; }
}
@media (orientation: landscape) and (min-width: 1001px) and (max-width: 1280px) and (min-height: 700px) {
  /* Width alone must not force the phone-scale typography into a tall window. */
  .robot-detail-heading h2 { font-size: 23px; }
  .robot-detail-identity h3 { font-size: 19px; }
  .robot-detail-identity { margin-bottom: 8px; }
  .robot-detail-overview { gap: 12px; }
  .robot-detail-head { height: 140px; }
  .robot-detail-attributes { gap: 8px; }
  .robot-detail-attribute { grid-template-columns: 24px auto minmax(0, 1fr); font-size: 17px; gap: 8px; }
  .robot-detail-attribute-icon { width: 24px; height: 24px; }
  .robot-detail-route h3, .robot-detail-destination strong { font-size: 18px; }
  .robot-detail-location-art { height: 100px; }
  .robot-detail-cost { font-size: 14px; }
  .stage[data-screen="robots"] .robot-detail-upgrade-button { min-height: 48px; font-size: 20px; }
}
