:root {
  font-family: "Helvetica Neue", system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif;
  color: #111827;
  background-color: #f9fafb;
  line-height: 1.5;
  font-weight: 400;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.header-logo img {
  max-height: 60px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 16px;
}
body {
  margin: 0;
  min-height: 100vh;
}

h2 {
  font-size: 16px;
  margin: 0;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.app__header h1 {
  margin: 0;
  font-size: 24px;
}

.ghost-button {
  border: 1px solid #d1d5db;
  background: transparent;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: background-color 0.2s ease;
}

.ghost-button.is-primary {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

.ghost-button.is-retry {
  border-color: #f59e0b;
  color: #b45309;
  background: #fffbeb;
}

.ghost-button.is-retry:hover {
  background: #fef3c7;
}

.ghost-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ghost-button:hover {
  background-color: #f3f4f6;
}

.factcheck-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.factcheck-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
}

.factcheck-tabs__tab {
  padding: 10px 24px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.factcheck-tabs__tab::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background-color 0.2s ease;
}

.factcheck-tabs__tab:hover {
  color: #374151;
}

.factcheck-tabs__tab.is-active {
  color: #2563eb;
  background-color: #eff6ff;
  border-radius: 8px 8px 0 0;
}

.factcheck-tabs__tab.is-active::after {
  background: #2563eb;
}

.factcheck-tabs__content {
  display: none;
}

.factcheck-tabs__content.is-active {
  display: block;
}

.panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  width: 100%;
}

.upload-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drop-zone {
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  background: #f8fafc;
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.drop-zone.dragover {
  border-color: #2563eb;
  background-color: #dbeafe;
}

.drop-zone__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone__label {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.drop-zone__hint {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.drive-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0 16px;
}

.drive-input__group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.drive-input__field {
  padding: 16px;
  width: 80%;
}

#factcheckDriveButton {
  width: 20%;
  font-weight: 600;
}

.factcheck__manual {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.8;
}

.status-line {
  font-size: 14px;
  color: #6b7280;
}

.status-line[data-status-type="info"] {
  color: #2563eb;
}

.status-line[data-status-type="success"] {
  color: #059669;
}

.status-line[data-status-type="error"] {
  color: #dc2626;
}

.disclaimer-panel {
  background: #fffbeb;
  border: 1px solid #f59e0b;
}

.disclaimer-panel h2 {
  font-size: 16px;
  color: #92400e;
}

.disclaimer-panel__list {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 14px;
  color: #78350f;
  line-height: 1.8;
}

.results-panel {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 8px;
}

.results-panel.is-split {
  grid-template-columns: 19% 40% 40%;
}

.results-panel__left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.results-panel__left > .results-panel__viewer,
.results-panel__left > .results-panel__vtr {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.results-panel__vtr[hidden] {
  display: none;
}

.results-panel.is-split .results-panel__left .viewer__body {
  flex: 1;
  min-height: 180px;
  max-height: 45vh;
}

.results-panel__sidebar {
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-item.is-risk {
  border-color: #fca5a5;
  background-color: #fef2f2;
}

.file-item.is-risk .file-item__meta {
  color: #b91c1c;
}

.file-item.is-warning {
  border-color: #fcd34d;
  background-color: #fffbeb;
}

.file-item.is-warning .file-item__meta {
  color: #b45309;
}

.file-item.is-pending {
  border-color: #d1d5db;
  opacity: 0.65;
}

.file-item.is-processing {
  border-color: #93c5fd;
  background-color: #f0f7ff;
}

.file-item.is-processing .file-item__meta {
  color: #2563eb;
}

.file-item.is-failed {
  border-color: #fca5a5;
  background-color: #fef2f2;
}

.file-item.is-failed .file-item__meta {
  color: #dc2626;
}

.viewer-url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
}

.viewer-url-label {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.viewer-url-text {
  flex: 1;
  min-width: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #334155;
  cursor: text;
}

.viewer-url-text:focus {
  outline: 2px solid #93c5fd;
  outline-offset: -1px;
}

.viewer-url-copy,
.viewer-url-open {
  flex: none;
  padding: 5px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.viewer-url-copy:hover,
.viewer-url-open:hover {
  background: #f1f5f9;
}

.viewer-url-open {
  color: #2563eb;
  border-color: #93c5fd;
}

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 75vh;
  overflow-y: auto;
  padding-right: 6px;
}

.empty-state {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 8px;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 999px;
  font-size: 12px;
  margin-right: 8px;
}

.file-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.file-item__title {
  font-weight: 600;
  color: #1f2937;
}

.file-item__meta {
  font-size: 12px;
  color: #6b7280;
}

.file-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.file-item.is-active {
  border-color: #999;
  background-color: #EEE;
}

.file-item.is-active.is-risk {
  border-color: #ef4444;
  background-color: #fee2e2;
}

.file-item.is-active.is-warning {
  border-color: #f59e0b;
  background-color: #fef3c7;
}

.results-panel__viewer {
  display: flex;
  flex-direction: column;
}

.viewer__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer__header h2 {
  margin: 0;
  font-size: 16px;
}

.video-link-button {
  margin-left: auto;
  padding: 6px 20px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.video-link-button:hover {
  background: #dbeafe;
}

.video-link-dropdown {
  margin-left: auto;
  position: relative;
}

.video-link-dropdown__toggle {
  margin-left: 0;
  cursor: pointer;
}

.video-link-dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  z-index: 10;
  padding: 4px 0;
}

.video-link-dropdown.is-open .video-link-dropdown__menu {
  display: block;
}

.video-link-dropdown__item {
  display: block;
  padding: 8px 14px;
  font-size: 12px;
  color: #1e40af;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-link-dropdown__item:hover {
  background: #eff6ff;
}

.viewer__meta {
  font-size: 12px;
  color: #9ca3af;
}

.results-panel.is-split .viewer__meta {
  display: none;
}

.viewer__body {
  flex: 1;
  min-height: 360px;
  max-height: 95vh;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background-color: #0f172a;
  color: #f8fafc;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  margin: 4px 0;
}

.viewer__body--material {
  background-color: #0f172a;
}

.results-panel__material[hidden] {
  display: none;
}

.results-panel.is-split .results-panel__material {
  display: flex;
  flex-direction: column;
}

@media (max-width: 960px) {
  .results-panel {
    grid-template-columns: 1fr;
  }

  .results-panel.is-split {
    grid-template-columns: 1fr;
  }

  .results-panel__sidebar {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
  }

  .results-panel__left .viewer__body {
    max-height: 60vh;
  }
}


/* ==========================================================================
   画像コンプラチェック（Phase 1）
   ========================================================================== */

.image-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0 0;
}

.image-preview-list:empty,
.image-preview-list[hidden] {
  display: none;
}

.image-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.image-preview__index {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 999px;
}

.image-preview img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  background: #cbd5e1;
}

.image-preview__meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.image-preview__name {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview__remove {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.image-preview__remove:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.image-check-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* --- 結果パネル --- */

.visual-check-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.visual-check__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.visual-check__header-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.visual-check__risk-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
}

.visual-check__risk-badge[data-risk="medium"] {
  background: #fef3c7;
  color: #92400e;
}

.visual-check__risk-badge[data-risk="high"] {
  background: #fee2e2;
  color: #b91c1c;
}

.visual-check__model {
  font-size: 11px;
  color: #94a3b8;
}

.visual-check__summary {
  margin: 0;
  padding: 12px 14px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  color: #334155;
  line-height: 1.7;
}

.visual-check__items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.visual-check-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.visual-check-card[data-severity="high"] {
  border-color: #fca5a5;
  background: #fef2f2;
}

.visual-check-card[data-severity="medium"] {
  border-color: #fcd34d;
  background: #fffbeb;
}

.visual-check-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #cbd5e1;
}

.visual-check-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.visual-check-card__index {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 8px;
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
}

.visual-check-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.visual-check-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.visual-check-card__category {
  padding: 3px 10px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
}

.visual-check-card__severity {
  padding: 3px 10px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
}

.visual-check-card__severity[data-severity="high"] {
  background: #fee2e2;
  color: #b91c1c;
}

.visual-check-card__severity[data-severity="medium"] {
  background: #fef3c7;
  color: #92400e;
}

.visual-check-card__filename {
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-check-card__desc {
  margin: 4px 0 0;
  font-size: 14px;
  color: #1f2937;
  line-height: 1.6;
}

.visual-check-card__meta {
  margin: 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
}

.visual-check-card__meta b {
  color: #0f172a;
}

/* --- 正常判定画像（折りたたみ） --- */

.visual-check__normal {
  margin-top: 4px;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.visual-check__normal > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  padding: 4px 0;
  user-select: none;
}

.visual-check__normal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.visual-check__normal-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.visual-check__normal-cell img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  background: #cbd5e1;
}

.visual-check__normal-cell span {
  font-size: 11px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .visual-check-card {
    grid-template-columns: 1fr;
  }
}

