/* Copilot blueprint test comparison (Decision 348, doc 110): the full-screen panel that shows the original and the test copy side by side,
   shuffled and unnamed until Reveal. Built by blueprint-trial-compare.js. Everything is scoped to .trial-compare, so no other screen changes.
   Tokens only; line-height 1.5 or more so Thai is safe; the app is light only. */
dialog.trial-compare {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
}

dialog.trial-compare[open] {
  display: flex;
  flex-direction: column;
}

dialog.trial-compare::backdrop {
  background: rgba(28, 25, 23, 0.4);
}

.trial-compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.trial-compare-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.trial-compare-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.25rem 2rem;
}

.trial-compare-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100rem;
  margin: 0 auto;
}

.trial-status {
  margin: 0 0 0.5rem;
  line-height: 1.5;
}

.trial-notes,
.trial-reveal,
.trial-revealed {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
}

.trial-notes h3,
.trial-revealed h3 {
  margin: 0 0 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

.trial-notes ul,
.trial-revealed ul {
  margin: 0;
  padding-left: 1.125rem;
  line-height: 1.5;
}

.trial-reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.trial-reveal p {
  margin: 0;
  line-height: 1.5;
}

.trial-error {
  margin: 0;
  color: var(--red);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.trial-rows {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.trial-row {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
}

.trial-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.625rem;
}

.trial-row-head h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

.trial-row-code {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.trial-row-name {
  overflow-wrap: anywhere;
}

.trial-sides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.trial-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trial-side-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.625rem;
}

.trial-side-head h4 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
}

.trial-side-name,
.trial-research,
.trial-missing {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.trial-side-status {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* A generated page is untrusted markup: it only ever lives in this sandboxed frame. */
.trial-frame {
  display: block;
  width: 100%;
  height: 22.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.375rem;
  background: #fff;
  resize: vertical;
  overflow: auto;
}

.trial-outputs {
  display: grid;
  gap: 0.25rem;
  margin: 0;
}

.trial-outputs dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.trial-outputs dd {
  margin: 0 0 0.375rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.trial-compare :focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .trial-sides {
    grid-template-columns: 1fr;
  }

  .trial-compare-head,
  .trial-compare-main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .trial-frame {
    height: 17.5rem;
  }
}

/* The panel takes focus back from a page preview (so Esc works); that focus needs no outline. */
.trial-compare:focus { outline: none; }
