.top-page { overflow: auto; }
.top-panel-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "viewer reception" "actions reception";
  gap: 12px 24px;
  height: 100vh;
  height: 100svh;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
}
.top-panel-shell > .viewer-panel { grid-area: viewer; }
.top-panel-shell > .top-entry-actions { grid-area: actions; }
.top-panel-shell > .reception-panel { grid-area: reception; }
.viewer-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  padding-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 24px 70px rgba(169, 56, 103, 0.22);
  backdrop-filter: blur(18px);
  touch-action: pan-y;
  user-select: none;
}
.viewer-header {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}
.viewer-header > .viewer-toolbar { grid-column: 2; }
.top-sound-notice {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 6px 12px;
  color: #a93867;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.76);
  border: 2px solid rgba(237, 134, 169, 0.28);
  border-radius: 999px;
}
.top-sound-notice svg { flex: 0 0 20px; color: #df6895; }
.viewer-toolbar {
  justify-self: center;
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(237, 134, 169, 0.22);
  border-radius: 999px;
  box-shadow: 0 12px 26px rgba(169, 56, 103, 0.14);
}
.view-button {
  min-width: 64px;
  min-height: 38px;
  padding: 8px 14px;
  color: #a93867;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 900;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.view-button:hover, .view-button[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(180deg, #f29bbb, #ed86a9);
}
.viewer-toolbar .view-gyro-button {
  flex: 0 0 88px;
  white-space: nowrap;
  touch-action: manipulation;
}
.view-button:focus-visible, .viewer-panel:focus-visible {
  outline: 2px solid #a93867;
  outline-offset: 2px;
}
.viewer-stage { position: relative; min-height: 0; overflow: hidden; cursor: grab; touch-action: pan-y; }
.is-dragging .viewer-stage { cursor: grabbing; }
.inventory-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.viewer-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.is-3d-ready .viewer-fallback { visibility: hidden; }
.viewer-loading {
  position: absolute;
  left: 50%; top: 50%;
  padding: 10px 18px;
  color: #a93867;
  font-weight: 900;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(237, 134, 169, 0.26);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.drag-hint {
  position: relative;
  z-index: 5;
  justify-self: center;
  width: min(86%, 520px);
  margin: 0 0 8px;
  padding: 6px 10px;
  color: #a93867;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(237, 134, 169, 0.2);
  border-radius: 999px;
}
.top-panel-shell > .top-gacha-button {
  position: static;
  width: 100%;
  justify-self: center;
  translate: none;
}
@media (max-width: 899px) {
  .top-panel-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas: "viewer" "actions" "reception";
    align-content: start;
    height: auto;
    min-height: 100svh;
    width: min(90%, 560px);
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .top-panel-shell > .viewer-panel {
    height: min(calc(min(117vw, 728px) + 100px), calc(100svh - 156px));
    min-height: 200px;
  }
  .top-panel-shell > .top-gacha-button { flex-shrink: 0; }
  .top-panel-shell > .reception-panel { margin-top: 12px; }
}
@media (max-width: 599px) {
  .viewer-header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding-inline: 10px;
  }
  .viewer-header > .viewer-toolbar { grid-column: 1; gap: 4px; padding: 4px; }
  .viewer-header .view-button { min-width: 44px; min-height: 38px; padding: 6px 8px; }
  .top-sound-notice { grid-column: 2; gap: 5px; padding: 6px 8px; font-size: 0.75rem; }
  .top-sound-notice svg { flex-basis: 18px; width: 18px; height: 18px; }
}
@media (max-width: 430px) {
  .viewer-panel { border-radius: 18px; }
  .view-button { min-width: 56px; min-height: 36px; padding-inline: 12px; }
  .drag-hint { border-radius: 14px; }
}
@media (max-height: 500px) {
  .drag-hint { display: none; }
  .viewer-panel { grid-template-rows: auto minmax(0, 1fr); }
}
