/* フロントエンド専用（ショートコード内のみ） */
.va-analyzer,
.va-analyzer * {
  box-sizing: border-box;
}

.va-analyzer {
  --va-bg: #000000;
  --va-surface: #0d0d0d;
  --va-surface-2: #161616;
  --va-surface-3: #1f1f1f;
  --va-border: #2e2e2e;
  --va-border-light: #444444;
  --va-text: #ffffff;
  --va-text-muted: #c8c8c8;
  --va-text-soft: #9a9a9a;
  --va-accent: #ffffff;
  --va-radius: 6px;
  --va-gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 4px 16px;
  color: var(--va-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.va-analyzer__hero {
  text-align: left;
  margin-bottom: 12px;
  padding: 0 4px;
}

.va-analyzer__title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--va-text);
}

.va-analyzer__lead {
  margin: 0;
  font-size: 0.88rem;
  color: var(--va-text-muted);
}

.va-analyzer__card {
  background: var(--va-surface);
  border: 1px solid var(--va-border);
  border-radius: var(--va-radius);
  padding: 10px 8px;
  margin-bottom: var(--va-gap);
}

.va-analyzer__alert {
  padding: 10px 8px;
  border-radius: var(--va-radius);
  margin-bottom: var(--va-gap);
  font-size: 0.92rem;
  background: var(--va-surface);
  border: 1px solid var(--va-border-light);
}

.va-analyzer__alert--error {
  color: var(--va-text-muted);
}

.va-analyzer__alert--info {
  color: var(--va-text-muted);
}

.va-analyzer__form { text-align: left; padding: 0 2px; }

.va-analyzer__label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}


.va-analyzer__file {
  width: 100%;
  padding: 10px 8px;
  background: var(--va-surface-2);
  border: 1px dashed var(--va-border-light);
  border-radius: var(--va-radius);
  color: var(--va-text);
  font-size: 0.85rem;
}

.va-analyzer__hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--va-text-soft);
}

.va-analyzer__btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: var(--va-accent);
  color: #000000;
  border: 1px solid var(--va-accent);
  border-radius: var(--va-radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.va-analyzer__btn:hover {
  background: #e8e8e8;
  border-color: #e8e8e8;
}

.va-analyzer__btn--ghost {
  background: var(--va-surface-2);
  color: var(--va-text);
  border: 1px solid var(--va-border-light);
}

.va-analyzer__btn--ghost:hover {
  border-color: var(--va-accent);
}

.va-analyzer__loading {
  display: none;
  padding: 16px 8px;
  margin-bottom: var(--va-gap);
  background: var(--va-surface);
  border: 1px solid var(--va-border);
  border-radius: var(--va-radius);
}

.va-analyzer__history-title {
  color: var(--va-text);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 0 4px;
}

.va-analyzer__loading.is-active { display: block; }

.va-analyzer__loading-text {
  color: var(--va-text);
}

.va-analyzer__progress {
  height: 4px;
  background: var(--va-surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.va-analyzer__progress-bar {
  height: 100%;
  width: 0%;
  background: var(--va-accent);
  transition: width 0.3s ease;
}

.va-analyzer__details {
  border: 1px solid var(--va-border);
  border-radius: var(--va-radius);
  margin-bottom: 8px;
  background: var(--va-surface);
}

.va-analyzer__details summary {
  padding: 10px 8px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--va-text);
  cursor: pointer;
  list-style: none;
}

.va-analyzer__details summary::-webkit-details-marker { display: none; }

.va-analyzer__details-body {
  padding: 0 8px 10px;
  border-top: 1px solid var(--va-border);
  color: var(--va-text-muted);
  font-size: 0.85rem;
}

.va-analyzer__note {
  margin-top: 12px;
  padding: 8px;
  font-size: 0.78rem;
  color: var(--va-text-soft);
  background: var(--va-surface);
  border: 1px solid var(--va-border);
  border-radius: var(--va-radius);
}

.va-analyzer__tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.va-analyzer__tab {
  flex: 1;
  padding: 10px;
  background: var(--va-surface);
  border: 1px solid var(--va-border);
  border-radius: var(--va-radius);
  color: var(--va-text-muted);
  font-weight: 600;
  cursor: pointer;
}

.va-analyzer__tab.is-active {
  background: var(--va-accent);
  color: #000000;
  border-color: var(--va-accent);
}

/* ダッシュボード */
.va-dashboard {
  background: var(--va-surface);
  border: 1px solid var(--va-border);
  border-radius: var(--va-radius);
  padding: 10px 8px;
  margin-bottom: 8px;
}

.va-dashboard__eval {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.va-dashboard__eval .va-dashboard__value {
  font-size: 1.15rem;
  color: var(--va-text);
}

.va-dashboard__label {
  display: block;
  font-size: 0.72rem;
  color: var(--va-text-soft);
  letter-spacing: 0.04em;
}

.va-dashboard__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.va-dashboard__stat {
  background: var(--va-surface-2);
  border: 1px solid var(--va-border);
  border-radius: 4px;
  padding: 6px 4px;
  text-align: center;
}

.va-dashboard__stat strong {
  display: block;
  font-size: 1.05rem;
  color: var(--va-text);
  margin-top: 2px;
}

.va-dashboard__summary {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: var(--va-text-muted);
}

.va-dashboard__needs ul {
  margin: 4px 0 0;
  padding-left: 16px;
  font-size: 0.85rem;
  color: var(--va-text-muted);
}

/* 確認レイアウト */
.va-review__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 768px) {
  .va-review__layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.va-review__media,
.va-review__findings {
  background: var(--va-surface);
  border: 1px solid var(--va-border);
  border-radius: var(--va-radius);
  padding: 8px 6px;
  min-width: 0;
}

.va-review__media-label,
.va-review__findings-title {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--va-text-soft);
}

.va-review__media-inner {
  position: relative;
}

.va-review__video,
.va-history__video {
  display: block;
  width: 100%;
  min-height: 200px;
  max-height: 50vh;
  background: #000000;
  border-radius: 4px;
  object-fit: contain;
}

.va-review__image-wrap {
  position: relative;
  width: 100%;
  background: #000000;
  border-radius: 4px;
  overflow: hidden;
}

.va-review__image-wrap.is-focused {
  outline: 2px solid var(--va-accent);
}

.va-review__image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 120px;
  max-height: 45vh;
  object-fit: contain;
  cursor: zoom-in;
}

/* 動画サムネ・再生ボタン */
.va-video-wrap {
  position: relative;
  width: 100%;
  min-height: 200px;
  background: #111111;
  border-radius: 4px;
  overflow: hidden;
}

.va-video-wrap .va-review__video,
.va-video-wrap .va-history__video {
  position: relative;
  z-index: 1;
  min-height: 200px;
}

.va-video-wrap__play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.25);
}

.va-video-wrap__play::after {
  content: "";
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 58% center;
  background-size: 28px 28px;
}

.va-video-wrap.is-playing .va-video-wrap__play,
.va-video-wrap.has-poster:not(.va-video-wrap--loading) .va-video-wrap__play {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* 画像拡大モーダル */
body.va-zoom-modal-open {
  overflow: hidden;
}

.va-zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.va-zoom-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  cursor: pointer;
}

.va-zoom-modal__img {
  position: relative;
  z-index: 1;
  max-width: 96vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  touch-action: pinch-zoom;
}

.va-zoom-modal__close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.va-review__marker {
  position: absolute;
  width: 28%;
  height: 28%;
  border: 2px solid var(--va-accent);
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
  border-radius: 4px;
}

.va-region--top-left { top: 8%; left: 8%; }
.va-region--top-right { top: 8%; right: 8%; }
.va-region--bottom-left { bottom: 8%; left: 8%; }
.va-region--bottom-right { bottom: 8%; right: 8%; }
.va-region--center { top: 36%; left: 36%; width: 28%; height: 28%; }
.va-region--top { top: 6%; left: 30%; }
.va-region--bottom { bottom: 6%; left: 30%; }
.va-region--left { top: 36%; left: 6%; }
.va-region--right { top: 36%; right: 6%; }

.va-review__hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--va-text-soft);
}

.va-review__zoom-btn {
  margin-top: 6px;
  padding: 8px;
  font-size: 0.85rem;
}

/* 指摘カード */
.va-findings__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 55vh;
  overflow-y: auto;
}

.va-finding {
  border: 1px solid var(--va-border);
  border-radius: 4px;
  padding: 8px 6px;
  background: var(--va-surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.va-finding:hover,
.va-finding.is-active {
  border-color: var(--va-accent);
  background: var(--va-surface-3);
}

.va-finding__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.va-finding__time {
  padding: 2px 8px;
  background: var(--va-surface);
  border: 1px solid var(--va-accent);
  border-radius: 4px;
  color: var(--va-text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.va-finding__time--static {
  border-color: var(--va-border-light);
  color: var(--va-text-muted);
  cursor: default;
}

.va-finding__severity {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--va-surface);
  border: 1px solid var(--va-border-light);
  color: var(--va-text-muted);
}

.va-finding__severity--major {
  border-color: var(--va-accent);
  color: var(--va-text);
}

.va-finding__severity--mid {
  color: var(--va-text-muted);
}

.va-finding__severity--minor {
  color: var(--va-text-soft);
}

.va-finding__what {
  margin: 0;
  font-size: 0.9rem;
  color: var(--va-text);
  line-height: 1.5;
}

.va-finding__detail {
  margin-top: 6px;
  font-size: 0.82rem;
}

.va-finding__detail summary {
  color: var(--va-text-soft);
  cursor: pointer;
  list-style: none;
}

.va-finding__detail-body {
  margin-top: 4px;
  color: var(--va-text-muted);
}

.va-finding__dl {
  display: block;
  font-size: 0.72rem;
  color: var(--va-text-soft);
  margin-bottom: 2px;
}

.va-findings__empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--va-text-soft);
}

/* 履歴 */
.va-analyzer__history { margin-top: 16px; padding: 0 2px; }

.va-analyzer__history-title {
  color: var(--va-text);
}

.va-analyzer__history-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 520px) {
  .va-analyzer__history-grid { grid-template-columns: repeat(2, 1fr); }
}

.va-analyzer__history-item {
  position: relative;
  background: var(--va-surface);
  border: 1px solid var(--va-border);
  border-radius: var(--va-radius);
  overflow: hidden;
}

.va-history__image-wrap {
  position: relative;
  width: 100%;
  min-height: 180px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.va-history__image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 120px;
  max-height: 280px;
  object-fit: contain;
}

.va-history__video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 180px;
  background: #000000;
  overflow: hidden;
}

.va-history__video-wrap .va-history__video {
  width: 100%;
  height: 100%;
  min-height: 180px;
  max-height: none;
}

.va-history__empty {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 120px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--va-text-soft);
  font-size: 0.75rem;
}

.va-analyzer__history-meta {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  font-size: 0.78rem;
  color: var(--va-text-muted);
}

.va-analyzer__badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--va-surface-2);
  border: 1px solid var(--va-border-light);
  color: var(--va-text-muted);
}

.va-analyzer__badge--warn,
.va-analyzer__badge--alert {
  border-color: var(--va-border-light);
  color: var(--va-text-muted);
}

.va-analyzer__save-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--va-border);
}

.va-analyzer__plain-text {
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 380px) {
  .va-dashboard__grid { grid-template-columns: repeat(2, 1fr); }
}
