/* Phase 4e: completed passages debug page (read-only). */

.passage-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.passage-controls .field {
  min-width: 160px;
}

.passage-controls .check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  white-space: nowrap;
}

.passage-layout {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.passage-table-wrap {
  overflow-x: auto;
}

.passage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.passage-table th,
.passage-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.passage-table .passage-head th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.passage-row {
  cursor: pointer;
}

.passage-row:hover {
  background: var(--surface-2);
}

.passage-preview {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  background: var(--bg);
  border-radius: 8px;
}

.passage-help {
  font-size: 12px;
  line-height: 1.5;
}

.passage-frame {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

.passage-frame__img {
  display: block;
  width: 100%;
  height: auto;
}

.passage-frame__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.passage-frame--fallback {
  border: none;
  background: transparent;
}

.passage-frame__caption {
  margin: 6px 0 10px;
  font-size: 12px;
  font-style: italic;
}

.passage-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  border-radius: 4px;
  font-size: 13px;
}

/* --- gate zone editor (Phase 5a) --- */

.passage-zone__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.passage-zone__body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: start;
}

.passage-zone__frame {
  max-width: 520px;
}

.passage-zone__path {
  stroke: #f1c40f;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  opacity: 0.9;
}

.passage-zone__note {
  font-style: italic;
  font-size: 12px;
}

.passage-zone__json {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  resize: vertical;
}

.passage-zone__json-actions {
  margin-top: 8px;
}

.passage-zone__error {
  margin-top: 8px;
  color: var(--red);
  font-size: 13px;
  min-height: 1em;
}

@media (max-width: 900px) {
  .passage-zone__body {
    grid-template-columns: minmax(0, 1fr);
  }
}

.passage-detail__label {
  margin: 6px 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 0 0 12px;
  font-size: 13px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  font-family: var(--font-mono);
}

.passage-pre {
  max-height: 220px;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .passage-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
