* {
  box-sizing: border-box;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  margin: 0;
  color: #222;
  background: #fbfcfe;
}
.container {
  max-width: 920px;
  margin: 32px auto;
  padding: 0 20px;
}
h1 {
  font-size: 28px;
  margin: 0 0 8px;
}
.hero .sub {
  color: #4a5568;
  margin: 0 0 12px;
}
.steps {
  margin: 8px 0 20px;
  padding-left: 18px;
  color: #556;
}
.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 760px) {
  .grid.two {
    grid-template-columns: 1fr;
  }
}
.card {
  background: #fff;
  border: 1px solid #e6ecf5;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 6px 14px rgba(20, 40, 90, 0.04);
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.label-wrap {
  position: relative;
  display: grid;
  gap: 6px;
}
.inputs {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.field {
  display: grid;
  gap: 6px;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.actions.inline {
  margin-top: 8px;
}
.actions button {
  padding: 10px 14px;
  border: 1px solid #c5d0e6;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
}
.btn-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
}
.actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.actions .primary {
  background: linear-gradient(180deg, #4f8dfc, #3a6fe7);
  color: #fff;
  border: 1px solid #2f63da;
}
.info {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.info:hover {
  background: #eef2ff;
  border-color: #94a3b8;
}
.tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: block;
  min-width: 260px;
  max-width: 340px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.32);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.label-wrap:hover .tooltip {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.tooltip::after {
  content: "";
  position: absolute;
  top: -6px;
  right: 12px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #111827 transparent;
}
.code {
  background: #0b1021;
  color: #e6edf3;
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
  min-height: 120px;
}
.sec {
  font-size: 16px;
  margin: 16px 0 8px;
}
.help {
  color: #5a6270;
  font-size: 13px;
  margin: 4px 0 12px;
}
.hint {
  color: #667085;
  font-size: 12px;
}
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  background: #eef;
  color: #225;
  border-radius: 10px;
  margin-left: 4px;
}
.api {
  margin-top: 20px;
}
.warn {
  color: #7a4;
}
.error {
  color: #c62828;
  font-size: 13px;
  margin: 8px 0;
}
.result {
  margin-top: 12px;
}
.drop {
  border: 1px dashed #c5d0e6;
  padding: 14px;
  border-radius: 10px;
}
.drop .drop-hint {
  font-size: 12px;
  color: #667085;
}
.drop.dragover {
  background: #f6faff;
  border-color: #58a;
}
.thumb {
  margin-top: 10px;
  max-width: 100%;
  border: 1px solid #eee;
  border-radius: 10px;
}

/* ファイル未選択時はクリアボタンを非表示 */
#clearSourceBtn:disabled,
#clearRefBtn:disabled {
  display: none;
}
.compare .mini {
  font-size: 13px;
  color: #667085;
  margin: 0 0 6px;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-top-color: #58a;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.note .note-banner {
  margin-top: 20px;
  background: #f2fbf6;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
  padding: 12px;
  border-radius: 10px;
}
