* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f4f6;
  color: #111827;
  font-family: "Yu Gothic", "Meiryo", sans-serif;
}

a {
  color: #1d4ed8;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
}

.brand {
  font-size: 13px;
  opacity: .75;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 14px;
}

.nav a {
  color: #ffffff;
  font-size: 14px;
}

.page {
  margin: 0 auto;
  max-width: 1180px;
  padding: 20px;
}

.panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px;
}

.form {
  display: grid;
  gap: 12px;
  max-width: 440px;
}

.label {
  color: #374151;
  display: grid;
  font-size: 13px;
  gap: 6px;
}

.input {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 16px;
  padding: 10px;
}

.button {
  background: #1d4ed8;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 14px;
}

.button.secondary {
  background: #4b5563;
}

.error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #991b1b;
  padding: 10px;
}

.toolbar {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.table {
  border-collapse: collapse;
  width: 100%;
}

.table th,
.table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: #4b5563;
  font-size: 13px;
}

.meta-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.meta-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.meta-label {
  color: #6b7280;
  font-size: 12px;
}

.meta-value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
}

.pair-list {
  display: grid;
  gap: 18px;
}

.pair {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.pair-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.photo-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.photo-box {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
}

.photo-box img {
  background: #e5e7eb;
  border-radius: 6px;
  display: block;
  max-height: 460px;
  object-fit: contain;
  width: 100%;
}

.photo-label {
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.missing {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #f3f4f6;
  border-radius: 6px;
  color: #6b7280;
  display: flex;
  justify-content: center;
}

@media print {
  .topbar,
  .toolbar,
  .nav {
    display: none;
  }

  body {
    background: #ffffff;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  .pair {
    break-inside: avoid;
  }
}

@media (max-width: 760px) {
  .meta-grid,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
