.ap-intro {
  --intro-accent: #7eb8d8;
  --ink: #142331;
  --muted: #637383;
  --line: #d8e2e8;
  --ok: #16856d;
  --warn: #b56a28;
  --miss: #b42318;
  border-radius: 16px;
  background: #111e2e;
  color: #f0f5fc;
  overflow: hidden;
  font-family: "Noto Sans JP", "Hiragino Sans", sans-serif;
}
.ap-intro * { box-sizing: border-box; }
.ap-intro-top {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #ffffff13;
  font-size: 11px;
  color: #b7c9dc;
}
.ap-intro-top span:first-child { color: #fff; font-weight: 600; }
.ap-viewport {
  height: 424px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #263b53, #101c2b 80%);
}
.ap-stage {
  width: 2200px;
  height: 350px;
  position: absolute;
  transform-origin: 0 0;
  will-change: transform;
}
.ap-device {
  position: absolute;
  top: 8px;
  height: 334px;
  width: 520px;
  background: #f5f8fa;
  color: var(--ink);
  overflow: hidden;
  border: 2px solid #50647c;
  border-radius: 12px;
  box-shadow: 0 16px 28px #0005;
  transition: opacity .85s ease, filter .85s ease, box-shadow .85s ease, border-color .85s ease;
}
.ap-device.ap-active {
  border-color: var(--intro-accent);
  box-shadow: 0 0 0 2px #7eb8d824, 0 0 28px #7eb8d820;
  opacity: 1;
  filter: none;
}
.ap-device.ap-idle {
  opacity: 0;
  filter: saturate(.3);
  box-shadow: none;
  pointer-events: none;
}
.ap-match { left: 24px; }
.ap-hold { left: 568px; }
.ap-approval { left: 1112px; }
.ap-standard { left: 1656px; }
.ap-device-bar {
  height: 28px;
  background: #19527d;
  color: #f4fbf8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
}
.ap-device-bar span { font-size: 9px; color: #c5dcea; font-weight: 400; }
.ap-body {
  background: #f5f8fa;
  height: 306px;
  overflow: hidden;
  position: relative;
}
.ap-scale {
  transform: scale(0.48);
  transform-origin: top left;
  width: 1080px;
  height: 640px;
  padding: 16px;
  pointer-events: none;
}
.ap-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  min-height: 560px;
}
.ap-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted);
}
.ap-scale h3 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.4;
  word-break: keep-all;
}
.ap-pair {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ap-pair section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fbfdfe;
}
.ap-drawing {
  height: 140px;
  margin: 8px 0 14px;
  background: #f0f5f7;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.ap-drawing span {
  width: 160px;
  height: 78px;
  border: 3px solid #7892a3;
  border-radius: 8px;
}
.ap-pair dl { margin: 0; display: grid; gap: 6px; }
.ap-pair dt { color: var(--muted); font-size: 12px; }
.ap-pair dd { margin: 0; font-weight: 700; }
.ap-pair dl div { display: flex; justify-content: space-between; gap: 8px; }
.ap-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ap-rows li, .ap-result li {
  display: grid;
  grid-template-columns: 7em 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f8fa;
  font-size: 14px;
}
.ap-rows em, .ap-result li, table em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.is-ok { color: var(--ok); }
.is-warn { color: var(--warn); background: #fff1e4; }
.is-miss { color: var(--miss); background: #fdecea; }
.ap-result { margin-top: 16px; }
.ap-result p {
  margin: 0 0 8px;
  font-weight: 700;
  word-break: keep-all;
}
.ap-result ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ap-result li { grid-template-columns: 1fr; }
.ap-hold-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.ap-hold-head strong {
  font-size: 18px;
  white-space: nowrap;
}
.ap-hold-head b { font-size: 28px; }
.ap-scale table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.ap-scale th, .ap-scale td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}
.ap-scale th { color: var(--muted); font-size: 12px; font-weight: 600; }
.ap-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 16px;
}
.ap-meta div { background: #f5f8fa; border-radius: 8px; padding: 10px 12px; }
.ap-meta dt { color: var(--muted); font-size: 12px; }
.ap-meta dd { margin: 4px 0 0; font-weight: 700; }
.ap-checks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.ap-checks li {
  padding: 10px 12px;
  border-radius: 8px;
  background: #e5f4ef;
  color: var(--ok);
  font-weight: 600;
}
.ap-files { margin: 0; color: var(--muted); font-size: 13px; }
.ap-versions {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}
.ap-versions section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  min-height: 200px;
}
.ap-versions .is-next { border-color: #adc8db; background: #e5f0f7; }
.ap-versions p { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.ap-versions b { display: block; font-size: 28px; margin-bottom: 8px; }
.ap-versions span, .ap-versions small { display: block; }
.ap-arrow { font-size: 28px; color: #19527d; }

.ap-hud {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 88px;
  padding: 18px 20px;
  background: linear-gradient(transparent, #101c2b 30%);
}
.ap-hud p {
  margin: 12px auto 0;
  max-width: 580px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
}
.ap-dots { display: flex; gap: 5px; justify-content: center; }
.ap-dots span { width: 18px; height: 3px; background: #ffffff30; border-radius: 2px; }
.ap-dots .ap-current { background: var(--intro-accent); }
.ap-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 18px;
  border-top: 1px solid #ffffff14;
}
.ap-controls p { font-size: 10px; color: #b7c9dc; margin: 0; }
.ap-controls > div { display: flex; gap: 8px; }
.ap-controls button {
  border: 1px solid #63788f;
  color: #e9f2fc;
  background: transparent;
  border-radius: 6px;
  font-size: 11px;
  min-height: 34px;
  padding: 6px 10px;
  cursor: pointer;
}
.ap-controls button:focus-visible { outline: 3px solid #7eb8d8; outline-offset: 4px; }

html.ap-embed-intro,
html.ap-embed-intro body,
body.ap-embed-intro {
  margin: 0;
  background: #111e2e;
  min-height: 100dvh;
  overflow: hidden;
}
html.ap-embed-intro body.landing > :not(#ap-intro-root) { display: none !important; }
body.ap-embed-intro .ap-intro,
html.ap-embed-intro .ap-intro {
  border-radius: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
html.ap-embed-intro .ap-viewport {
  flex: 1;
  min-height: 360px;
}

/* 操作画面だけ（?embed=intro&view=stage） */
html.ap-embed-stage-root,
html.ap-embed-stage-root body,
html.ap-embed-stage,
html.ap-embed-stage body,
body.ap-embed-stage,
.ap-intro-stage {
  margin: 0;
  min-height: 0 !important;
  background: #fff !important;
  overflow: visible;
}
.ap-intro-stage {
  border-radius: 0;
  box-shadow: none;
  color: #1c2740;
  display: block;
}
.ap-intro-stage .ap-viewport {
  height: 360px;
  min-height: 360px;
  flex: none;
  background: #fff;
}
.ap-motion {
  margin: 12px auto 0;
  max-width: 580px;
  padding: 0 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
  color: #26418e;
}

@media (prefers-reduced-motion: reduce) {
  .ap-intro *, .ap-intro *::before, .ap-intro *::after {
    transition: none !important;
    animation: none !important;
  }
}
@media (max-width: 600px) {
  .ap-intro-top { padding: 13px 12px; font-size: 9px; }
  .ap-hud { padding: 14px 12px; }
  .ap-hud p { font-size: 12px; }
  .ap-controls { padding: 8px 12px; }
}
