/* The reference: a group per resource, drawn from the contract. */
.reference {
  display: flex;
  flex-direction: column;
  gap: 44px;
}
.reference:empty {
  display: none;
}
.ref-group {
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.ref-group .op + .op {
  padding-top: 34px;
  border-top: 1px solid var(--hair);
}
.ref-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 44px;
  border-top: 1px solid var(--hair);
}
.ref-head p {
  color: var(--ink-3);
}
#webhook-events {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin-top: 14px;
}
#webhook-events .op + .op {
  padding-top: 26px;
  border-top: 1px solid var(--hair);
}

/* Every endpoint on one screen, by its path. */
.ref-index {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hair);
}
.ref-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--hair);
  font: 400 15px/1.6 var(--lat);
  color: var(--ink-3);
  text-decoration: none;
}
.ref-row .verb {
  justify-self: start;
}
.ref-row code {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.ref-row:hover code {
  color: var(--brand-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* An endpoint: its words on the left, its code in the right rail. */
.op {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--code-col));
  gap: var(--gutter);
  align-items: start;
}
.op-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.op-text > p {
  color: var(--ink-3);
}
.op h3 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
}
.op-code {
  position: sticky;
  top: calc(var(--bar) + 22px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.path {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 8px;
  border-radius: 12px;
  background: var(--mist);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.path code {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.path .try {
  height: 32px;
  background: var(--brand);
  color: #fff;
}
.path .try:hover {
  background: var(--brand-600);
}
.path .try .i {
  color: #fff;
}
.path .verb,
.ref-row .verb {
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
}
.path .verb-get,
.ref-row .verb-get {
  background: var(--success-100);
  color: var(--success);
}
.path .verb-post,
.path .verb-put,
.ref-row .verb-post,
.ref-row .verb-put {
  background: var(--brand-100);
  color: var(--brand-700);
}
.path .verb-delete,
.ref-row .verb-delete {
  background: var(--danger-100);
  color: var(--danger);
}

/* Fields: the type as it travels, and "required" in words. */
h4 {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 800;
}
.fields {
  border-top: 1px solid var(--hair);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
}
.field dt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.field dt code {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.field dt span {
  font: 400 12px/1.5 var(--mono);
  color: var(--ink-2);
}
.field dt .note {
  font-family: var(--lat);
  font-size: 12.5px;
}
.field dt .must {
  font: 700 12px/1.5 var(--lat);
  color: var(--danger);
}
.field dd {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-3);
}
.answers {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hair);
}
.answers li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-3);
}
.status {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--chip);
  color: var(--ink-3);
  font: 500 12.5px/1.6 var(--mono);
}
.status.is-ok {
  background: var(--success-100);
  color: var(--success);
}

/* The console */
dialog.console {
  width: min(960px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    0 0 0 1px rgba(20, 34, 45, 0.07),
    0 24px 60px -12px rgba(20, 34, 45, 0.4);
}
dialog.console::backdrop {
  background: rgba(20, 34, 45, 0.46);
}
.console-in {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}
.console-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 16px;
}
.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--brand-100);
  color: var(--brand-700);
}
.tile .i {
  width: 19px;
  height: 19px;
}
.console-head h3 {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
}
.console-head h3 .mono {
  margin-inline-start: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}
.console-head p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}
.console-head .icon-button {
  margin-inline-start: auto;
}
.console-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--hair);
}
.pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px 22px 20px;
}
.pane + .pane {
  border-inline-start: 1px solid var(--hair);
  background: var(--mist);
}
.pane-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.pane-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pane-fields:empty {
  display: none;
}
.label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}
.label .free {
  font-weight: 500;
  color: var(--quiet);
}
.input,
.area {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--edge);
  font: 500 13.5px/1.6 var(--mono);
  color: var(--ink);
}
.input {
  height: 44px;
  padding: 0 14px;
}
.area {
  min-height: 232px;
  padding: 12px 14px;
  resize: vertical;
}
.input:hover,
.area:hover {
  box-shadow: inset 0 0 0 1px var(--faint);
}
.input:focus,
.area:focus {
  outline: none;
  box-shadow:
    inset 0 0 0 1.5px var(--brand),
    0 0 0 4px var(--brand-100);
}
.console-error {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--danger-700);
}
.answer-empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 20px;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--hair);
  font-size: 14px;
  color: var(--ink-2);
  text-align: center;
}
.answer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.answer-line b {
  color: var(--success);
  font-weight: 700;
}
.answer-line .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.answer-line.is-error b {
  color: var(--danger-700);
}
.answer-line.is-error .dot {
  background: var(--danger);
}
#answer-code pre {
  max-height: 420px;
  overflow-y: auto;
}
.console-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--hair);
}
.console-foot p {
  flex: 1;
  min-width: 220px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}
.send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 15.5px;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 18px -8px rgba(0, 45, 47, 0.6);
  transition:
    background-color 160ms ease-out,
    transform 160ms ease-out;
}
.send:hover {
  background: var(--brand-600);
}
.send:active {
  transform: scale(0.97);
}
.send:disabled {
  opacity: 0.7;
  cursor: progress;
}

@media (max-width: 1239px) {
  .op {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .op-code {
    position: static;
  }
}
@media (max-width: 1099px) {
  .console-panes {
    grid-template-columns: minmax(0, 1fr);
  }
  .pane + .pane {
    border-inline-start: 0;
    border-top: 1px solid var(--hair);
  }
  .area {
    min-height: 180px;
  }
}
@media (max-width: 639px) {
  .ref-row {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 2px 14px;
  }
  .ref-row span:last-child {
    grid-column: 2;
  }
}
