/*
 * View styles — fixtures.
 * Scoped under .v-fixtures. Shared primitives come from /ui/components.css.
 * The record/replay switch is a pair of radios; :has() swaps the hint and the
 * mode badge without any script.
 */

.v-fixtures .view-main {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

/* --------------------------------------------------------------- header */

.v-fixtures .page-header {
  margin-bottom: 0;
}

.v-fixtures .page-header__main {
  flex-basis: 480px;
}

.v-fixtures .page-header__meta {
  margin-bottom: 6px;
}

.v-fixtures .page-header__sub {
  max-width: 720px;
  color: var(--text-1);
  line-height: 1.55;
}

.v-fixtures .page-header__actions .btn {
  font-size: var(--fz-sm);
  font-weight: var(--fw-medium);
}

/* --------------------------------------------------------- panel chrome */

.v-fixtures .fx-panel {
  border-radius: var(--r-2);
}

.v-fixtures .fx-panel .card__head {
  flex-wrap: nowrap;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line-0);
}

.v-fixtures .fx-panel .card__title {
  font-size: 0.9375rem;
}

.v-fixtures .fx-mono {
  font-family: var(--font-mono);
}

.v-fixtures .fx-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 3px var(--sp-2);
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: var(--fz-2xs);
  line-height: 1.4;
  white-space: nowrap;
}

.v-fixtures .fx-badge--replay {
  background: var(--signal-soft);
  color: var(--signal-hover);
}

.v-fixtures .fx-badge--record {
  background: var(--bad-soft);
  color: var(--bad);
}

.v-fixtures .fx-badge--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

/* ------------------------------------------------------------ mode bar */

.v-fixtures .fx-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-0);
  border-radius: var(--r-2);
  background: var(--paper-2);
}

.v-fixtures .fx-mode__label {
  float: left;
  padding: 0;
  color: var(--text-0);
  font-size: var(--fz-sm);
  font-weight: var(--fw-medium);
}

.v-fixtures .fx-mode__group {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  background: var(--paper-1);
}

.v-fixtures .fx-mode__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.v-fixtures .fx-mode__btn {
  padding: 6px var(--sp-3);
  border-radius: 3px;
  background: transparent;
  color: var(--text-1);
  font-size: var(--fz-xs);
  cursor: pointer;
}

.v-fixtures .fx-mode__btn:hover {
  color: var(--text-0);
}

.v-fixtures .fx-mode__input:checked + .fx-mode__btn {
  background: var(--ink-0);
  color: var(--bone-0);
}

.v-fixtures .fx-mode__input:focus-visible + .fx-mode__btn {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.v-fixtures .fx-mode__hint {
  flex: 1 1 280px;
  min-width: 0;
  color: var(--text-1);
  font-size: var(--fz-xs);
}

.v-fixtures .fx-when-record {
  display: none;
}

.v-fixtures:has(#fx-mode-record:checked) .fx-when-record {
  display: inline;
}

.v-fixtures:has(#fx-mode-record:checked) .fx-when-replay {
  display: none;
}

/* ---------------------------------------------------------------- table */

.v-fixtures .fx-table {
  min-width: 700px;
  font-size: var(--fz-sm);
}

.v-fixtures .fx-table thead th {
  padding: 10px var(--sp-3);
  border-bottom: 0;
  background: var(--paper-2);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: var(--fz-xs);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
}

.v-fixtures .fx-table th:first-child,
.v-fixtures .fx-table td:first-child {
  padding-left: var(--sp-5);
}

.v-fixtures .fx-table th:last-child,
.v-fixtures .fx-table td:last-child {
  padding-right: var(--sp-5);
  text-align: right;
}

.v-fixtures .fx-table tbody td {
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-top: 1px solid var(--line-0);
  border-bottom: 0;
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: var(--fz-xs);
  font-variant-numeric: tabular-nums;
}

.v-fixtures .fx-table tbody td.cell-num {
  font-size: var(--fz-sm);
}

.v-fixtures .fx-table .fx-method {
  font-weight: var(--fw-semibold);
}

.v-fixtures .fx-table .fx-host {
  color: var(--text-1);
}

.v-fixtures .fx-table tbody tr.is-selected {
  background: #f4f7ff;
  box-shadow: inset 3px 0 0 var(--signal);
}

.v-fixtures .fx-foot {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--line-0);
  color: var(--text-2);
  font-size: var(--fz-xs);
}

/* --------------------------------------------------------- editor + misses */

.v-fixtures .fx-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--sp-6);
}

.v-fixtures .fx-editor {
  flex: 3 1 460px;
  min-width: 0;
}

.v-fixtures .fx-editor .card__body {
  padding: var(--sp-5);
}

.v-fixtures .fx-field {
  display: block;
  margin-bottom: 6px;
  color: var(--text-0);
  font-size: var(--fz-sm);
  font-weight: var(--fw-medium);
}

.v-fixtures .fx-body {
  display: block;
  width: 100%;
  padding: var(--sp-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: var(--paper-2);
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  line-height: 1.6;
  resize: vertical;
}

.v-fixtures .fx-body:focus {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.v-fixtures .fx-hint {
  margin-top: 10px;
  color: var(--text-2);
  font-size: var(--fz-xs);
}

.v-fixtures .fx-counters {
  display: flex;
  gap: 28px;
  margin-top: 14px;
}

.v-fixtures .fx-counter {
  display: flex;
  flex-direction: column;
}

.v-fixtures .fx-counter__value {
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: var(--fz-2xl);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.v-fixtures .fx-counter__label {
  color: var(--text-2);
  font-size: var(--fz-xs);
}

.v-fixtures .fx-misses-card {
  flex: 2 1 300px;
  min-width: 0;
  border-color: #ecdcb8;
  background: #fbf6ec;
}

.v-fixtures .fx-misses-card .card__head {
  border-bottom-color: #ecdcb8;
}

.v-fixtures .fx-misses {
  margin: 0;
  padding: 6px var(--sp-5);
  list-style: none;
}

.v-fixtures .fx-misses li {
  padding: 10px 0;
  border-bottom: 1px solid #ecdcb8;
}

.v-fixtures .fx-misses li:last-child {
  border-bottom: 0;
}

.v-fixtures .fx-misses__req {
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  overflow-wrap: anywhere;
}

.v-fixtures .fx-misses__where {
  margin-top: 2px;
  color: var(--text-2);
  font-size: var(--fz-xs);
}

.v-fixtures .fx-misses__foot {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid #ecdcb8;
  color: var(--text-1);
  font-size: var(--fz-xs);
}

/* ----------------------------------------------------------- responsive */

@media (max-width: 720px) {
  .v-fixtures .view-main,
  .v-fixtures .fx-grid {
    gap: var(--sp-4);
  }

  .v-fixtures .fx-panel .card__head {
    padding: var(--sp-4);
  }

  .v-fixtures .fx-editor .card__body {
    padding: var(--sp-4);
  }

  .v-fixtures .fx-mode__group {
    width: 100%;
  }

  .v-fixtures .fx-mode__btn {
    flex: 1 1 0;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}

/* Hosted Fixtures lab (built by console-live.js in signed-in mode) */
.v-fixtures .lab-layout { display: flex; flex-direction: column; gap: var(--sp-4); }
.v-fixtures .lab-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.v-fixtures .lab-form-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--sp-3); }
.v-fixtures .lab-form__actions { display: flex; gap: var(--sp-2); }
.v-fixtures .lab-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.v-fixtures .lab-card { border: 1px solid var(--line-0); border-radius: var(--radius-2); padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.v-fixtures .lab-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.v-fixtures .lab-evidence { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-start; }
.v-fixtures .lab-video { width: min(100%, 520px); border: 1px solid var(--line-0); background: var(--ink-0); }
.v-fixtures .lab-evidence__links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
