.token-help-shell {
  width: min(1120px, calc(100vw - 32px));
}

.token-help-header code,
.delivery-strip code,
.help-section code,
.security-band code {
  font-family: "Cascadia Code", "Consolas", monospace;
  overflow-wrap: anywhere;
}

.delivery-strip {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.delivery-strip dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

.delivery-strip dt {
  color: var(--muted);
  font-size: 13px;
}

.delivery-strip dd {
  margin: 6px 0 0;
}

.help-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.token-status-form {
  display: grid;
  grid-template-columns: auto minmax(240px, 560px) auto;
  align-items: center;
  gap: 12px;
}

.token-status-form label {
  color: var(--muted);
  font-size: 13px;
}

.token-status-form input {
  min-width: 0;
  font-family: "Cascadia Code", "Consolas", monospace;
}

.token-status-result {
  margin-top: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.token-status-result[hidden] {
  display: none;
}

.token-status-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.token-status-summary span,
.token-status-summary strong {
  display: block;
}

.token-status-summary span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.token-resource-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.token-resource-list li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f9f8;
}

.token-status-error {
  color: #8b2b2b;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading .eyebrow {
  margin-bottom: 8px;
}

.request-config {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(220px, 1fr) minmax(0, 1.8fr);
  gap: 12px;
  margin-bottom: 14px;
}

.request-config label {
  display: grid;
  gap: 7px;
}

.request-config label span {
  color: var(--muted);
  font-size: 13px;
}

.request-config input,
.request-config select {
  min-width: 0;
  padding: 11px 12px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 13px;
}

.endpoint-note {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.language-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #eef2f0;
}

.language-tab {
  flex: 0 0 auto;
  min-width: 78px;
  border: 0;
  border-radius: 4px;
  padding: 9px 12px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.language-tab.active {
  color: var(--accent-deep);
  background: #ffffff;
  font-weight: 700;
}

.code-surface {
  min-height: 360px;
  max-height: 560px;
  margin: 0;
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  color: #20332a;
  background: #f8faf9;
  font: 13px/1.7 "Cascadia Code", "Consolas", monospace;
  white-space: pre;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}

.rule-grid > div {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.rule-grid p,
.security-band p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.help-table-wrap {
  border-radius: 6px;
  background: #ffffff;
}

.help-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.help-table th,
.help-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.help-table th {
  color: var(--muted);
  font-size: 13px;
  background: #f7f9f8;
  white-space: nowrap;
}

.help-table tr:last-child td {
  border-bottom: 0;
}

.error-table td:first-child {
  width: 72px;
  font-weight: 700;
}

.contract-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 24px;
  margin-bottom: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contract-summary p {
  margin: 0;
  padding: 15px 0;
  line-height: 1.6;
}

.api-contract-section > h3 {
  margin: 28px 0 8px;
  font-size: 1.05rem;
}

.endpoint-doc {
  padding: 34px 0 6px;
  border-top: 2px solid var(--line);
}

.format-table,
.parameter-table,
.response-field-table {
  min-width: 860px;
}

.endpoint-doc-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.endpoint-doc-heading h3,
.endpoint-doc-heading .eyebrow {
  margin: 0;
}

.endpoint-doc-heading .eyebrow {
  margin-bottom: 7px;
}

.endpoint-doc > p {
  color: var(--muted);
  line-height: 1.7;
}

.endpoint-doc h4 {
  margin: 24px 0 10px;
  font-size: 0.96rem;
}

.response-type {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.endpoint-signature,
.response-example {
  margin: 14px 0 0;
  padding: 15px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #20332a;
  background: #f8faf9;
  font: 13px/1.65 "Cascadia Code", "Consolas", monospace;
  white-space: pre;
}

.endpoint-error-note {
  margin-top: 30px;
  padding: 18px 0;
  border-top: 2px solid #b77817;
}

.endpoint-error-note p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.security-band {
  margin-top: 28px;
  padding: 18px 0;
  border-top: 2px solid #b77817;
}

.copy-status {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 6px;
  color: #fff;
  background: #25613f;
  box-shadow: 0 10px 30px rgb(20 44 31 / 24%);
}

.copy-status.error {
  background: #8b2b2b;
}

.copy-status[hidden] {
  display: none;
}

.resource-doc-panel[hidden] {
  display: none;
}

.resource-description {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.resource-endpoint-table code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 720px) {
  .copy-status {
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-width: none;
  }

  .token-help-shell {
    width: min(100vw - 20px, 1120px);
  }

  .token-help-header {
    display: grid;
  }

  .delivery-strip dl,
  .request-config,
  .rule-grid,
  .contract-summary,
  .token-status-form,
  .token-status-summary {
    grid-template-columns: 1fr;
  }

  .delivery-strip dl {
    gap: 14px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .endpoint-doc-heading {
    display: grid;
  }

  .code-surface {
    min-height: 420px;
    padding: 14px;
    font-size: 12px;
  }
}
