/* Qualitative comparison — from Comparision.html; lightbox/back-to-top global */

.comparison-embed-page * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.comparison-embed-page {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 20px;
  border-radius: 16px;
  position: relative;
  z-index: 1;
}

.comparison-embed-page .toc {
  background: #16213e;
  border-radius: 10px;
  padding: 15px 20px;
  margin-bottom: 30px;
}

.comparison-embed-page .toc h2 {
  color: #a8d8ea;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.comparison-embed-page .toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.comparison-embed-page .toc-links a {
  background: #0f3460;
  color: #a8d8ea;
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85em;
  transition: background 0.2s;
}

.comparison-embed-page .toc-links a:hover {
  background: #533483;
}

.comparison-embed-page .group-section {
  margin-bottom: 40px;
}

.comparison-embed-page .group-title {
  font-size: 1.4em;
  color: #f5a623;
  background: #16213e;
  padding: 10px 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  border-left: 4px solid #f5a623;
}

.comparison-embed-page .subject-section {
  background: #16213e;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #0f3460;
}

.comparison-embed-page .subject-title {
  font-size: 1.05em;
  color: #7ec8e3;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #0f3460;
}

.comparison-embed-page .grid-container {
  overflow-x: auto;
}

/* Explicit table display so thead rows stay column-aligned (no @scope quirks) */
.comparison-embed-page table {
  display: table;
  border-collapse: collapse;
  min-width: 100%;
  width: max-content;
  table-layout: auto;
}

.comparison-embed-page thead {
  display: table-header-group;
}

.comparison-embed-page tbody {
  display: table-row-group;
}

.comparison-embed-page tr {
  display: table-row;
}

.comparison-embed-page th,
.comparison-embed-page td {
  display: table-cell;
}

.comparison-embed-page th {
  background: #0f3460;
  color: #a8d8ea;
  padding: 8px 10px;
  font-size: 1.05em;
  font-weight: 600;
  text-align: center;
  min-width: 180px;
  max-width: 220px;
  word-break: break-word;
  white-space: normal;
  border: 1px solid #1a1a4e;
}

.comparison-embed-page th.model-header {
  background: #533483;
  color: #f5a623;
  font-size: 1.05em;
  font-weight: bold;
  min-width: 120px;
  white-space: nowrap;
}

.comparison-embed-page th.identity-cell {
  background: #0f3460;
  color: #a8d8ea;
  font-size: 1.15em;
  font-weight: 700;
  text-align: center;
  padding: 10px 12px;
  white-space: normal;
}

.comparison-embed-page .prompt-kind {
  display: block;
  font-size: 0.78em;
  font-weight: 800;
  color: #f5a623;
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}

.comparison-embed-page .prompt-kind-right {
  display: block;
  font-size: 0.85em;
  font-weight: 900;
  color: #f5a623;
  text-align: right;
  padding: 6px 8px;
  letter-spacing: 0.2px;
}

.comparison-embed-page .prompt-text {
  display: block;
  font-size: 1em;
  font-weight: 650;
  color: #a8d8ea;
}

.comparison-embed-page th.identity-spacer {
  background: #0f3460;
  border: 1px solid #1a1a4e;
  width: 120px;
}

.comparison-embed-page th.identity-sep {
  background: #16213e;
  padding: 0;
  border-left: 1px solid #1a1a4e;
  border-right: 1px solid #1a1a4e;
}

.comparison-embed-page .identity-rule {
  height: 0;
  border-top: 3px solid #f5a623;
  opacity: 0.95;
  margin: 0;
}

.comparison-embed-page td {
  padding: 10px;
  border: 1px solid #0f3460;
  text-align: center;
  vertical-align: middle;
}

.comparison-embed-page td.model-label {
  background: #533483;
  color: #f5a623;
  font-weight: bold;
  font-size: 1em;
  min-width: 120px;
  white-space: nowrap;
}

.comparison-embed-page td.prompt-cell {
  background: #533483;
  color: #a8d8ea;
  font-weight: 800;
  font-size: 0.95em;
  min-width: 260px;
  max-width: 420px;
  white-space: normal;
  word-break: break-word;
  text-align: left;
  padding: 8px 10px;
}

.comparison-embed-page .group-start-col {
  border-left: 4px solid #f5a623 !important;
}

.comparison-embed-page th.baseline-model-header {
  background: #4a4a4a !important;
  color: #d0d0d0 !important;
  white-space: nowrap;
}

.comparison-embed-page td.baseline-model-cell {
  background: #2e2e2e !important;
}

.comparison-embed-page td img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
  margin: auto;
}

.comparison-embed-page td img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(168, 216, 234, 0.4);
}

.comparison-embed-page td.missing {
  color: #555;
  font-size: 0.8em;
  width: 180px;
  height: 180px;
}

.comparison-embed-page td.selected-cell {
  background: #8b0000 !important;
  box-shadow: 0 0 0 2px #ffcccc inset;
}

.comparison-embed-page td.selected-yellow {
  background: #ffe600 !important;
  box-shadow: 0 0 0 2px #fff3a0 inset;
}

.comparison-embed-page td.selected-orange {
  background: #b35a00 !important;
  box-shadow: 0 0 0 2px #ffd580 inset;
}

.comparison-embed-page .legend {
  background: #16213e;
  border: 2px solid #f5a623;
  border-radius: 12px;
  padding: 18px 28px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comparison-embed-page .legend-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.1em;
}

.comparison-embed-page .legend-swatch {
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.comparison-embed-page .legend-red {
  background: #8b0000;
  box-shadow: 0 0 0 2px #ffcccc inset;
}

.comparison-embed-page .legend-yellow {
  background: #ffe600;
  box-shadow: 0 0 0 2px #fff3a0 inset;
}

.comparison-embed-page .legend-orange {
  background: #ffa500;
  box-shadow: 0 0 0 2px #ffcc80 inset;
}

.comparison-embed-page .legend-label {
  color: #e0e0e0;
}

.comparison-embed-page .legend-label strong {
  color: #f5a623;
  font-size: 1.05em;
}

/* Lightbox / back-to-top: fixed to viewport (IDs match Comparision.html) */
#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10050;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#lightbox.active {
  display: flex;
}

#lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

#lightbox-caption {
  color: #fff;
  margin-top: 10px;
  font-size: 0.9em;
  text-align: center;
  max-width: 80vw;
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 2em;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10040;
  background: #0f3460;
  color: #a8d8ea;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 1.2em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: background 0.2s;
}

.back-to-top:hover {
  background: #533483;
}
