html,
body.h5-page {
  min-width: 0;
  min-height: 0;
}

body.h5-page {
  overflow-x: hidden;
  overflow-y: auto;
  background: #02070a;
}

.h5-page .h5-shell {
  width: 100%;
  max-width: 520px;
  height: auto;
  min-width: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding-bottom: calc(108px + env(safe-area-inset-bottom));
  overflow: visible;
  background:
    radial-gradient(circle at 50% -8%, rgba(36, 136, 151, 0.14), transparent 34%),
    linear-gradient(180deg, #061117, #03090d);
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.55);
}

.h5-header {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: 60px;
  display: flex;
  align-items: center;
  padding: env(safe-area-inset-top) 124px 0 52px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 17, 23, 0.96);
  backdrop-filter: blur(16px);
}

.h5-back {
  position: absolute;
  left: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(77, 224, 231, 0.4);
  border-radius: 50%;
  color: var(--cyan-soft);
  background: rgba(18, 56, 65, 0.7);
  font-size: 18px;
  text-decoration: none;
}

.h5-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}

.h5-brand img {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fff;
}

.h5-brand > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.h5-brand small,
.h5-brand strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.h5-brand small {
  color: var(--cyan);
  font: 800 8px/1 "Consolas", monospace;
  letter-spacing: 0.14em;
}

.h5-brand strong {
  font-size: 13px;
  font-weight: 650;
}

.h5-clock {
  display: none;
}

.h5-page .example-language-switcher {
  top: calc(11px + env(safe-area-inset-top));
  right: max(8px, calc((100vw - 520px) / 2 + 8px));
  padding: 3px;
}

.h5-page .example-language-switcher svg {
  width: 14px;
  height: 14px;
}

.h5-page .example-language-switcher button {
  min-width: 31px;
  padding: 5px 6px;
  font-size: 10px;
}

.h5-main {
  min-height: 0;
  display: grid;
  gap: 8px;
  padding: 8px;
}

.h5-page .h5-scene {
  order: 0;
  width: 100%;
  height: clamp(220px, 58svh, 560px);
  min-height: 220px;
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  border-color: rgba(77, 224, 231, 0.28);
}

.h5-page .scene-toolbar {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 28px 28px;
  gap: 4px 7px;
  padding: 6px 7px;
}

.h5-page .view-tabs {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.h5-page .view-tabs button {
  flex: 1;
  min-width: 0;
  padding: 0 7px;
}

.h5-page .scene-tools {
  grid-column: 1 / -1;
  grid-row: 2;
}

.h5-page .scene-tools button {
  flex: 1;
  justify-content: center;
}

.h5-page .scene-tools button span {
  display: inline;
}

.desktop-entry {
  grid-column: 2;
  grid-row: 1;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid rgba(77, 224, 231, 0.32);
  border-radius: 2px;
  color: var(--cyan-soft);
  background: rgba(77, 224, 231, 0.07);
  font-size: 9px;
  text-decoration: none;
}

.h5-page .scene-stage {
  min-height: 0;
}

.h5-page .scene-hint {
  display: none;
}

.h5-page .scene-caption {
  left: 8px;
  right: 8px;
  bottom: 8px;
  min-height: 36px;
  padding-right: 8px;
  padding-left: 9px;
}

.h5-page .scene-caption em {
  display: none;
}

.h5-page .scene-corner.top-left {
  top: 9px;
  left: 9px;
}

.h5-page .scene-corner.bottom-right {
  right: 9px;
  bottom: 50px;
}

.h5-page .model-label > i {
  width: 15px;
}

.h5-page .model-label > span {
  min-width: 72px;
  padding: 5px 6px;
}

.h5-page .model-label b,
.h5-page .model-label small {
  font-size: 7px;
}

.h5-page .model-label[data-label-object="VacuumPump"] {
  display: none;
}

.h5-cycle-panel {
  display: block;
}

.h5-cycle-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px 11px 8px;
}

.h5-cycle-head .phase-code {
  width: 44px;
  height: 44px;
}

.h5-cycle-copy {
  min-width: 0;
}

.h5-cycle-copy small {
  color: var(--dim);
  font-size: 8px;
}

.h5-cycle-copy strong,
.h5-cycle-copy p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.h5-cycle-copy strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.h5-cycle-copy p {
  margin: 4px 0 0;
  color: #6b848c;
  font-size: 8px;
}

.h5-page .h5-cycle-panel .cycle-progress {
  padding: 0 11px 10px;
}

.h5-parameter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(105, 163, 173, 0.11);
}

.h5-parameter-grid article,
.h5-parameter-grid article:nth-child(2n),
.h5-parameter-grid article:nth-last-child(-n + 2) {
  height: 58px;
  border-right: 1px solid rgba(105, 163, 173, 0.11);
  border-bottom: 1px solid rgba(105, 163, 173, 0.11);
}

.h5-parameter-grid article:nth-child(3n) {
  border-right: 0;
}

.h5-parameter-grid article:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.h5-parameter-grid strong {
  font-size: 13px;
}

.h5-section-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(8, 22, 29, 0.9);
}

.h5-section-tabs button {
  height: 34px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #6f8992;
  background: transparent;
  font-size: 10px;
}

.h5-section-tabs button.active {
  border-color: rgba(77, 224, 231, 0.36);
  color: var(--cyan-soft);
  background: rgba(77, 224, 231, 0.09);
}

.h5-pane {
  display: grid;
  gap: 8px;
}

.h5-pane[hidden] {
  display: none !important;
}

.h5-page .cell-map {
  padding-top: 12px;
}

.h5-page .h5-phase-panel {
  display: block;
}

.h5-page .h5-phase-panel .phase-list {
  min-height: 0;
  display: flex;
  grid-template-rows: none;
  gap: 0;
  padding: 5px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.h5-page .h5-phase-panel .phase-list li {
  flex: 0 0 168px;
  height: 56px;
  scroll-snap-align: start;
}

.h5-page .h5-phase-panel .phase-list li::before,
.h5-page .h5-phase-panel .phase-list li::after {
  display: none;
}

.h5-page .h5-phase-panel .phase-list li.complete button > i {
  font-size: 10px;
}

.h5-page .h5-phase-panel .phase-list li.complete button > i::after {
  content: none;
}

.h5-page .h5-phase-panel .phase-list button {
  grid-template-columns: 31px minmax(0, 1fr);
  border-right: 1px solid rgba(92, 148, 157, 0.12);
}

.h5-page .h5-phase-panel .phase-list button > em {
  display: none;
}

.h5-quality-panel {
  min-height: 250px;
}

.h5-page .h5-quality-panel .quality-chart {
  min-height: 160px;
}

.h5-diagnosis-panel {
  min-height: 240px;
}

.h5-page .h5-diagnosis-panel .event-log {
  max-height: none;
  padding: 6px 0;
}

.h5-page .h5-diagnosis-panel .event-log li {
  min-height: 43px;
  grid-template-columns: 66px minmax(0, 1fr);
  padding: 5px 12px;
  font-size: 10px;
}

.h5-control-deck {
  position: fixed;
  right: auto;
  bottom: 0;
  left: 50%;
  z-index: 70;
  width: min(100%, 520px);
  min-height: 104px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
}

.h5-control-deck .cycle-summary {
  position: absolute;
  top: 13px;
  left: 12px;
  z-index: 5;
  display: block;
}

.h5-control-deck .cycle-summary span,
.h5-control-deck .cycle-summary small {
  display: none;
}

.h5-control-deck .cycle-summary strong {
  color: var(--cyan-soft);
  font-size: 10px;
}

.h5-control-deck .timeline-wrap {
  grid-column: 1;
  grid-row: 1;
  padding: 15px 0 2px 48px;
}

.h5-control-deck .timeline-labels {
  left: 48px;
}

.h5-control-deck .timeline-marks {
  left: 52px;
}

.h5-control-deck .transport-controls {
  grid-column: 1;
  grid-row: 2;
  justify-content: center;
  gap: 6px;
}

.h5-control-deck .play-button {
  min-width: 132px;
}

.h5-control-deck .loop-switch b {
  display: none;
}

@media (min-width: 521px) {
  .h5-header {
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 370px) {
  .h5-header {
    padding-right: 112px;
  }

  .h5-brand small {
    font-size: 7px;
  }

  .h5-brand strong {
    font-size: 12px;
  }

  .h5-page .scene-tools button span {
    display: none;
  }

  .h5-parameter-grid strong {
    font-size: 12px;
  }

  .h5-control-deck .speed-control button {
    min-width: 29px;
  }
}

@media (max-width: 350px) {
  .h5-control-deck .transport-controls {
    gap: 4px;
  }

  .h5-control-deck .play-button {
    min-width: 46px;
    padding-inline: 12px;
  }

  .h5-control-deck .play-button span {
    display: none;
  }
}

@media (max-height: 560px) {
  .h5-page .h5-scene {
    height: calc(100svh - 176px);
    min-height: 160px;
  }
}
