/* Compact stacked B/A viewer; scoped to this LP section. */
.ba-section.ba-layout-card {
  padding: 22px 0 18px;
  border-radius: 22px;
  background: linear-gradient(155deg, #efecf9, #fbf7fb);
  color: #715180;
  color-scheme: only light;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
.ba-section.ba-layout-card * { box-sizing: border-box; font-family: inherit; }
.ba-section.ba-layout-card .ba-card-heading {
  width: min(calc(100% - 32px), 368px);
  margin: 0 auto;
  padding: 0;
  text-align: center;
}
.ba-section.ba-layout-card .ba-card-heading h2 {
  margin: 0;
  color: #40334a;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .04em;
}
.ba-section.ba-layout-card .ba-content {
  width: min(calc(100% - 32px), 368px);
  max-width: 368px;
  margin: 20px auto 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}
.ba-section.ba-layout-card .ba-category-label {
  margin: 0 0 10px;
  color: #65576f;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}
.ba-section.ba-layout-card [data-ba-parts] {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: none;
  margin: 0 0 22px;
  padding: 0;
  overflow: visible;
}
.ba-section.ba-layout-card .ba-part-tab {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 9px 5px;
  color: #65576f;
  border: 1px solid #d8cfe3;
  border-radius: 12px;
  background: rgba(255, 255, 255, .84);
  box-shadow: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .035em;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.ba-section.ba-layout-card .ba-part-tab:hover:not(:disabled):not(.is-active):not([aria-pressed="true"]) {
  border-color: #b2a2c4;
  background: #fff;
}
.ba-section.ba-layout-card .ba-part-tab.is-active,
.ba-section.ba-layout-card .ba-part-tab[aria-pressed="true"] {
  color: #51465f;
  border-color: #bdb1d3;
  background: linear-gradient(110deg, #e7f1fc, #f6e3ef);
  box-shadow: 0 3px 8px rgba(92, 61, 116, .06);
  font-weight: 700;
}
.ba-section.ba-layout-card .ba-data-status {
  margin: 0 auto;
  padding: 0;
  color: #65576f;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}
.ba-section.ba-layout-card .ba-data-status:not(:has([data-ba-status]:empty)) { margin-bottom: 12px; }
.ba-section.ba-layout-card .ba-data-retry {
  margin: 8px 0 4px 8px;
  padding: 6px 12px;
  color: #65576f;
  border: 1px solid #a988c9;
  border-radius: 999px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.ba-section.ba-layout-card .ba-case-card {
  position: relative;
  margin: 0;
  padding: 12px;
  border: 1px solid #e4d8eb;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 5px 18px #79548a0b;
}
.ba-section.ba-layout-card .ba-photo-reveal-v29,
.ba-section.ba-layout-card .ba-photo-area {
  position: relative;
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.ba-section.ba-layout-card .ba-photo-area { outline: 0; touch-action: pan-y; user-select: none; }
.ba-section.ba-layout-card .ba-photo-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: calc(100% + 16px);
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  margin: 0 -8px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.ba-section.ba-layout-card .ba-case-panel {
  grid-area: 1 / 1;
  position: relative;
  inset: auto;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 8px 4px;
  border: 0;
  background: #fff;
  opacity: 1;
  transition: transform 260ms cubic-bezier(.2, .7, .25, 1);
}
.ba-section.ba-layout-card .ba-slot-current { z-index: 2; transform: translateX(0); }
.ba-section.ba-layout-card .ba-slot-prev { z-index: 1; transform: translateX(-100%); }
.ba-section.ba-layout-card .ba-slot-next { z-index: 1; transform: translateX(100%); }
.ba-section.ba-layout-card .ba-photo-stage.is-moving-next .ba-slot-current { transform: translateX(-100%); }
.ba-section.ba-layout-card .ba-photo-stage.is-moving-prev .ba-slot-current { transform: translateX(100%); }
.ba-section.ba-layout-card .ba-photo-stage.is-moving-next .ba-slot-next,
.ba-section.ba-layout-card .ba-photo-stage.is-moving-prev .ba-slot-prev { transform: translateX(0); }
.ba-section.ba-layout-card .ba-photo-stage.is-resetting .ba-case-panel { transition: none; }
.ba-section.ba-layout-card .ba-case-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 3px 36px;
  padding: 0;
  color: #715180;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.ba-section.ba-layout-card .ba-case-meta strong { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.ba-section.ba-layout-card [data-ba-panel-count] {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
  white-space: nowrap;
}
.ba-section.ba-layout-card .ba-deck {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 289px);
  margin: 0 auto;
  padding: 0 10px 22px 0;
  border: 0;
  background: transparent;
  isolation: isolate;
}
.ba-section.ba-layout-card [data-ba-current-toggle] { cursor: pointer; }
.ba-section.ba-layout-card .ba-sheet {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  transform: translate(10px, 0);
  transition: none;
}
.ba-section.ba-layout-card .ba-sheet--before { --ba-phase-color: #ee9dbd; }
.ba-section.ba-layout-card .ba-sheet--after { --ba-phase-color: #73bce2; }
.ba-section.ba-layout-card .ba-sheet-label {
  position: absolute;
  z-index: 2;
  top: -35px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(108px, calc(40% - 5px));
  height: 36px;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 12px 12px 0 0;
  background: var(--ba-phase-color);
  color: #222;
  font-size: clamp(11px, 3.6vw, 14px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: .03em;
  white-space: nowrap;
}
.ba-section.ba-layout-card .ba-sheet--before .ba-sheet-label { left: 12%; }
.ba-section.ba-layout-card .ba-sheet--after .ba-sheet-label { right: 8%; }
.ba-section.ba-layout-card .ba-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 3px solid var(--ba-phase-color);
  outline: 1px solid var(--ba-phase-color);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 1px 2px 4px #71518010;
}
.ba-section.ba-layout-card .ba-photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: contain;
  pointer-events: none;
}
.ba-section.ba-layout-card .ba-photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #715180;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
.ba-section.ba-layout-card .ba-photo.is-loaded .ba-photo-placeholder { display: none; }
.ba-section.ba-layout-card .ba-photo.is-error img { visibility: hidden; }
.ba-section.ba-layout-card .ba-deck[data-phase="before"] .ba-sheet--before,
.ba-section.ba-layout-card .ba-deck[data-phase="after"] .ba-sheet--after { z-index: 3; transform: translate(0, 22px); }
.ba-section.ba-layout-card .ba-deck[data-phase="before"] .ba-sheet--before .ba-photo,
.ba-section.ba-layout-card .ba-deck[data-phase="after"] .ba-sheet--after .ba-photo { box-shadow: 4px -2px 8px #4c305629; }
.ba-section.ba-layout-card .ba-card-action { margin: 7px 0 0; }
.ba-section.ba-layout-card .ba-action-wrap { position: relative; display: flex; min-width: 0; overflow: visible; }
.ba-section.ba-layout-card .ba-action-wrap--next { flex: 1; }
.ba-section.ba-layout-card .ba-action-button {
  display: block;
  width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 8px;
  border: 1px solid #795687;
  border-radius: 11px;
  background: linear-gradient(100deg, #755185, #805b88);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.2em;
  box-shadow: 0 4px 8px #79548a16;
  white-space: nowrap;
  cursor: pointer;
}
.ba-section.ba-layout-card .ba-action-button .ba-action-emphasis { font-size: 1.08em; font-weight: 800; }
.ba-section.ba-layout-card .ba-action-button:active { background: #704b80; box-shadow: none; }
.ba-section.ba-layout-card .ba-action-button:disabled { opacity: 1; cursor: default; }
.ba-section.ba-layout-card .ba-pagination { display: flex; gap: 12px; margin: 10px 0 0; padding: 0 0 18px; border: 0; }
.ba-section.ba-layout-card .ba-page-button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid #be96d4;
  border-radius: 10px;
  background: #ece1f2;
  color: #715180;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  cursor: pointer;
}
.ba-section.ba-layout-card .ba-page-button:disabled { opacity: .4; cursor: default; }
.ba-section.ba-layout-card .ba-case-details {
  width: 100%;
  margin: 18px auto 0;
  padding: 13px 16px;
  color: #65576f;
  border: 1px solid #e4d8eb;
  border-radius: 12px;
  background: rgba(255, 255, 255, .7);
  font-size: 13px;
  line-height: 1.7;
  text-align: left;
}
.ba-section.ba-layout-card .ba-case-details > div { display: grid; grid-template-columns: 4em minmax(0, 1fr); gap: 10px; }
.ba-section.ba-layout-card .ba-case-details > div:not([hidden]) + div { margin-top: 6px; }
.ba-section.ba-layout-card .ba-case-details dt { font-weight: 700; }
.ba-section.ba-layout-card .ba-case-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.ba-section.ba-layout-card .ba-embed-note {
  margin: 18px auto 0;
  padding: 0 2px;
  color: #786583;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.8;
  text-align: left;
}
.ba-section.ba-layout-card .ba-embed-note a { text-decoration: underline; }
.ba-section.ba-layout-card .ba-guide-hand {
  position: absolute;
  z-index: 7;
  display: block;
  width: 40px;
  height: 43px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 43px;
  text-align: center;
  pointer-events: none;
  user-select: none;
}
.ba-section.ba-layout-card .ba-guide-glyph { display: block; }
.ba-section.ba-layout-card .ba-guide-hand--after {
  right: -1px;
  bottom: -18px;
  width: 44px;
  height: 47px;
  font-size: 42px;
  line-height: 47px;
  animation: ba-guide-point-up 1.35s ease-in-out infinite;
}
.ba-section.ba-layout-card .ba-guide-hand--after .ba-guide-glyph { transform: rotate(-20deg); }
.ba-section.ba-layout-card .ba-guide-hand--upper {
  top: -34px;
  right: 5px;
  animation: ba-guide-point-lower-left 1.35s ease-in-out infinite;
}
.ba-section.ba-layout-card .ba-guide-hand--upper .ba-guide-glyph { transform: rotate(-135deg); }
.ba-section.ba-layout-card .ba-guide-hand--lower {
  bottom: -29px;
  left: -8px;
  animation: ba-guide-point-upper-right 1.35s ease-in-out infinite;
}
.ba-section.ba-layout-card .ba-guide-hand--lower .ba-guide-glyph { transform: rotate(45deg); }
.ba-section.ba-layout-card .ba-guide-hand.is-leaving .ba-guide-glyph { transform: none; }
.ba-section.ba-layout-card .ba-guide-hand--after.is-leaving { animation: ba-guide-confirm .65s ease-out forwards; }
.ba-section.ba-layout-card .ba-guide-hand--upper.is-leaving { animation: ba-guide-exit-right .75s ease-out forwards; }
.ba-section.ba-layout-card .ba-guide-hand--lower.is-leaving { animation: ba-guide-exit-down .75s ease-out forwards; }
.ba-section.ba-layout-card .ba-part-tab:focus-visible,
.ba-section.ba-layout-card .ba-data-retry:focus-visible,
.ba-section.ba-layout-card .ba-action-button:focus-visible,
.ba-section.ba-layout-card .ba-page-button:focus-visible { outline: 3px solid #9975b2; outline-offset: 3px; }
.ba-section.ba-layout-card .ba-part-tab:focus-visible { outline-offset: -4px; }
.ba-section.ba-layout-card [data-ba-current-toggle]:focus-visible,
.ba-section.ba-layout-card .ba-photo-area:focus-visible { outline: 3px solid #9975b2; outline-offset: -4px; border-radius: 8px; }
.ba-section.ba-layout-card.is-ba-single-state [data-ba-current-toggle] { cursor: default; }
.ba-section.ba-layout-card [hidden],
.ba-section.ba-layout-card.is-ba-empty .ba-case-card,
.ba-section.ba-layout-card.is-ba-empty .ba-pagination,
.ba-section.ba-layout-card.is-ba-empty .ba-case-details { display: none !important; }
@keyframes ba-guide-point-up {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-3px, -6px); }
}
@keyframes ba-guide-point-lower-left {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-5px, 5px); }
}
@keyframes ba-guide-point-upper-right {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(5px, -5px); }
}
@keyframes ba-guide-confirm {
  0%, 45% { opacity: 1; transform: scale(1); }
  65% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 0; transform: scale(.92); }
}
@keyframes ba-guide-exit-right {
  0%, 30% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(44px); }
}
@keyframes ba-guide-exit-down {
  0%, 30% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(44px); }
}
@keyframes ba-guide-fade {
  0%, 45% { opacity: 1; }
  100% { opacity: 0; }
}
@media (max-width: 360px) {
  .ba-section.ba-layout-card { padding: 18px 0 14px; }
  .ba-section.ba-layout-card .ba-card-heading,
  .ba-section.ba-layout-card .ba-content { width: calc(100% - 24px); }
  .ba-section.ba-layout-card .ba-case-card { padding: 10px; }
  .ba-section.ba-layout-card .ba-action-button { font-size: 15px; }
  .ba-section.ba-layout-card .ba-part-tab { font-size: 13px; }
}
@media (max-width: 700px) {
  .ba-section.ba-layout-card .ba-deck {
    width: min(100%, max(164px, calc(var(--ba-photo-height, clamp(80px, calc(100svh - 330px), 372px)) * .75 + 10px)));
    margin: 0 auto;
  }
  .ba-section.ba-layout-card .ba-photo {
    height: var(--ba-photo-height, clamp(80px, calc(100svh - 330px), 372px));
    aspect-ratio: auto;
  }
  .ba-section.ba-layout-card .ba-guide-hand { width: 34px; height: 38px; font-size: 34px; line-height: 38px; }
  .ba-section.ba-layout-card .ba-guide-hand--after { top: -10px; right: -3px; bottom: auto; }
  .ba-section.ba-layout-card .ba-guide-hand--upper { top: -22px; right: 2px; }
  .ba-section.ba-layout-card .ba-guide-hand--lower { bottom: -16px; left: -4px; }
  .ba-section.ba-layout-card.is-ba-tight .ba-case-card { padding: 8px; }
  .ba-section.ba-layout-card.is-ba-tight .ba-case-meta { margin-bottom: 22px; font-size: 12px; line-height: 1.4; }
  .ba-section.ba-layout-card.is-ba-tight .ba-sheet-label {
    top: -19px;
    height: 20px;
    border-radius: 6px 6px 0 0;
    font-size: 11px;
  }
  .ba-section.ba-layout-card.is-ba-tight .ba-action-button { height: 44px; min-height: 44px; }
  .ba-section.ba-layout-card.is-ba-tight .ba-pagination { margin-top: 8px; padding-bottom: 14px; }
  .ba-section.ba-layout-card.is-ba-tight .ba-guide-hand--upper { display: none; }
  .ba-section.ba-layout-card.is-ba-tight .ba-guide-hand--lower { bottom: -10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ba-section.ba-layout-card .ba-guide-hand { animation: none; }
  .ba-section.ba-layout-card .ba-guide-hand.is-leaving {
    animation-name: ba-guide-fade;
    animation-duration: .18s;
    animation-timing-function: ease-out;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
  }
  .ba-section.ba-layout-card .ba-part-tab,
  .ba-section.ba-layout-card .ba-case-panel { transition: none; }
}

/* Standalone theme shell. Existing non-viewer templates keep style.css. */
.ba-page {
  padding: 20px 0 max(150px, calc(110px + env(safe-area-inset-bottom)));
  background: linear-gradient(155deg, #efecf9, #fbf7fb);
}
.ba-page .ba-shell {
  width: min(700px, 100%);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.ba-page .ba-header {
  padding: 20px 16px;
  border: 0;
  background: transparent;
}
.ba-page .ba-header::after { display: none; }
.ba-page .ba-section.ba-layout-card { padding-top: 0; background: transparent; }
.ba-section.ba-layout-card .ba-case-panel { box-shadow: none; }
.ba-section.ba-layout-card .ba-content { padding: 0; }
.ba-section.ba-layout-card .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ba-section.ba-layout-card [hidden] { display: none !important; }
