/* Detail-only readability fixes for the official light preview.
 * The source theme stays unchanged. Foreground and background roles are paired
 * explicitly for newer registry, token and faucet components.
 */
:root[data-theme="light"] body:is([data-page="model-detail"], [data-page="asset-detail"]) .registry-fields :is(th, td) {
  border-color: var(--tc-border);
  background: var(--tc-surface);
}
:root[data-theme="light"] body:is([data-page="model-detail"], [data-page="asset-detail"]) .registry-fields th {
  color: var(--tc-text-strong);
}
:root[data-theme="light"] body:is([data-page="model-detail"], [data-page="asset-detail"]) .registry-fields th small {
  color: var(--tc-text-muted);
}
:root[data-theme="light"] body:is([data-page="model-detail"], [data-page="asset-detail"]) .registry-fields td {
  color: var(--tc-text);
}
:root[data-theme="light"] body:is([data-page="model-detail"], [data-page="asset-detail"]) .registry-fields tr:is(:nth-child(even), :hover) td {
  background: var(--tc-surface);
}

/* The family badge used the divider colour as its fill, reducing contrast. */
:root[data-theme="light"] body[data-page="asset-detail"] .registry-breadcrumb small {
  color: var(--tc-text);
  background: var(--tc-bg-quiet);
}

/* Address links in the transaction summary need the same identifiable link
 * colour as the sender/recipient route and underlying input/output records. */
:root[data-theme="light"] body[data-page="tx-detail"] .token-action-parties a {
  color: var(--tc-link);
}
:root[data-theme="light"] body[data-page="tx-detail"] .token-action-parties a:hover {
  color: var(--tc-link-hover);
}

/* Browser defaults otherwise control the input foreground, and the legacy
 * faucet button uses an unrelated green rather than the official button pair. */
:root[data-theme="light"] body[data-page="faucet"] #faucet-address {
  color: var(--tc-text-strong);
  border-color: var(--tc-border-strong);
  background: var(--tc-surface);
}
:root[data-theme="light"] body[data-page="faucet"] #faucet-form button {
  color: var(--tc-button-text);
  background: var(--tc-button-bg);
}
:root[data-theme="light"] body[data-page="faucet"] #faucet-form button:hover {
  background: var(--tc-text);
}
:root[data-theme="light"] body[data-page="faucet"] #faucet-form button:disabled {
  color: var(--tc-text-muted);
  border: 1px solid var(--tc-border-strong);
  background: var(--tc-bg-quiet);
  opacity: 1;
}

/* Keep supporting copy readable at the official minimum label size; these
 * components predate the theme and still had 9–10 px hard-coded captions. */
:root[data-theme="light"] body[data-page="block-detail"] .near-pin-meter small {
  font-size: var(--tc-size-label-min);
}
:root[data-theme="light"] body:is([data-page="model-detail"], [data-page="asset-detail"]) :is(
  .registry-fields th small,
  .registry-specs .fact-card > small,
  .registry-detail-toggle small,
  .registry-record-meta,
  .registry-breadcrumb small,
  .registry-supply-stats small,
  .registry-supply-track > div:last-child,
  .registry-family-root small,
  .registry-family-children small,
  .registry-document-status small,
  .registry-document-source,
  .registry-document-commitments,
  .registry-document-full dl,
  .registry-chart-caption,
  .registry-chart-axis,
  .registry-unit-details,
  .registry-rule-tag
) {
  font-size: var(--tc-size-label-min);
}
:root[data-theme="light"] body:is([data-page="asset-detail"], [data-page="tx-detail"], [data-page="address-detail"]) .token-protocol {
  font-size: var(--tc-size-label-min);
}
:root[data-theme="light"] body[data-page="address-detail"] :is(
  .token-history-time,
  .token-history-direction,
  .token-history-direction-description,
  .token-history-party-label,
  .token-history-party-count,
  .token-history-detail-error,
  .token-history-count,
  .token-history-cell-label
) {
  font-size: var(--tc-size-label-min);
}
:root[data-theme="light"] body:is([data-page="model-detail"], [data-page="asset-detail"]) :is(
  .registry-history-empty small,
  .registry-history-key,
  .registry-history-inspector
) {
  font-size: var(--tc-size-label-min);
}
:root[data-theme="light"] body[data-page="address-detail"] :is(
  .registry-chart-select > span,
  .registry-address-assets .registry-tree-name small,
  .registry-address-assets .token-label-copy small,
  .registry-address-assets .token-id
) {
  font-size: var(--tc-size-label-min);
}
:root[data-theme="light"] body[data-page="tx-detail"] .token-movement-table th {
  font-size: var(--tc-size-label-min);
}
@media (max-width: 600px) {
  :root[data-theme="light"] body[data-page="tx-detail"] .token-party-address {
    font-size: var(--tc-size-label-min);
  }
}

/* Registry catalog cards use the same official roles as their detail pages. */
:root[data-theme="light"] body[data-page="assets"] .registry-family-guide {
  border-color: var(--tc-border);
  background: var(--tc-bg-quiet);
}
:root[data-theme="light"] body[data-page="assets"] .registry-family-guide p {
  color: var(--tc-text);
}
:root[data-theme="light"] body[data-page="assets"] .registry-example-tree > span {
  color: var(--tc-text-strong);
  border-color: var(--tc-border-strong);
  background: var(--tc-surface);
}
:root[data-theme="light"] body[data-page="assets"] :is(
  .registry-example-tree > i,
  .registry-card-children,
  .registry-card-children li::before
) {
  border-color: var(--tc-border-strong);
}
:root[data-theme="light"] body[data-page="assets"] .registry-family-card-root {
  border-color: var(--tc-border);
  background: var(--tc-bg-quiet);
}
:root[data-theme="light"] body[data-page="assets"] .registry-family-card-root a {
  color: var(--tc-link);
}
:root[data-theme="light"] body[data-page="assets"] .registry-family-card-root a:hover {
  color: var(--tc-link-hover);
}
:root[data-theme="light"] body[data-page="models"] .registry-model-contribution strong {
  color: var(--tc-text-strong);
}
:root[data-theme="light"] body:is([data-page="models"], [data-page="assets"]) :is(
  .registry-model-revision,
  .registry-chart-select > span,
  .registry-history-empty small,
  .registry-history-key,
  .registry-history-inspector,
  .registry-chart-axis,
  .registry-search,
  .registry-example-tree small,
  .registry-family-card-root > div > span,
  .registry-family-card strong small,
  .registry-card-children li > div > small,
  .registry-family-card footer
) {
  font-size: var(--tc-size-label-min);
}
:root[data-theme="light"] body[data-page="assets"] .registry-family-more {
  font-size: var(--tc-size-label-min);
}
