/* Mobile-first, independent of the host App's rem/DPR adaptation scripts. */
:root { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: #222;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.agreement-page {
  width: 100%;
  max-width: 60rem;
  min-width: 0;
  margin: 0 auto;
  padding: 20px 16px 40px;
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  /* break-word is the fallback for older WebViews without anywhere. */
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}
.legal-content { min-width: 0; font-size: .9375rem; line-height: 1.9; }
.legal-content h2 { margin: 1.5rem 0 .75rem; font-size: 1.0625rem; line-height: 1.7; font-weight: 700; }
.legal-content p { margin: 0 0 1em; white-space: pre-wrap; white-space: break-spaces; }
.merchant-entry:first-child h2 { margin-top: 0; }
.legal-content strong { font-weight: 700; }
a { color: #225eaf; word-break: break-word; text-underline-offset: 3px; }
.legal-content a, .legal-content a:visited { color: #225eaf; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus, [tabindex]:focus { outline: 2px solid #225eaf; outline-offset: 3px; }
/* Pointer/touch focus stays unboxed; preserve keyboard focus and older-browser fallback. */
@supports selector(:focus-visible) {
  a:focus:not(:focus-visible), [tabindex]:focus:not(:focus-visible) { outline: none; }
}
.skip-link { position: absolute; top: 0; left: 16px; max-width: calc(100% - 32px); padding: 10px 16px; background: #fff; transform: translateY(-110%); }
.skip-link:focus { transform: none; }
.table-container { min-width: 0; width: 100%; margin: 1rem 0 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; line-height: 1.8; }
/* Narrow screens: keep each row together and show every field vertically.
   Explicit table roles + headers preserve associations when display is block. */
table, tbody, tbody tr, td { display: block; }
tbody tr { margin: 0 0 1rem; border: 1px solid #ddd; border-radius: 4px; }
th, td { min-width: 0; padding: .75rem; text-align: left; vertical-align: top; }
td + td { border-top: 1px solid #eee; }
.field-label { display: block; margin-bottom: .25rem; color: #555; font-size: .8125rem; font-weight: 600; white-space: pre-wrap; white-space: break-spaces; }
.legal-content th p, .legal-content td p { margin: 0; }
.sr-only, thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* SDK descriptions remain readable field groups, not an extra-wide table. */
.sdk-entry { min-width: 0; margin: 0 0 1.5rem; padding-top: 1rem; border-top: 1px solid #ddd; }
.legal-content .sdk-entry h3 { margin: 0 0 .5rem; font-size: 1rem; line-height: 1.7; }
.sdk-fields { margin: 0; }
.sdk-fields dt { padding: .75rem 0 .25rem; border-top: 1px solid #eee; color: #555; font-weight: 600; }
.sdk-fields dd { margin: 0; padding: 0 0 .75rem; min-width: 0; }
.legal-content .sdk-fields dd p { margin: 0; }
.legal-content ul { padding-left: 1.5em; }
@media (min-width: 600px) {
  .agreement-page {
    padding: 28px 24px 56px;
    padding-right: calc(24px + env(safe-area-inset-right, 0px));
    padding-left: calc(24px + env(safe-area-inset-left, 0px));
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
}
/* Only use columns when there is room. No forced wide table or horizontal swipe. */
@media (min-width: 64em), print {
  table { display: table; table-layout: fixed; }
  thead { display: table-header-group; position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
  tbody { display: table-row-group; }
  tbody tr { display: table-row; }
  th, td { display: table-cell; padding: .625rem; border: 1px solid #ddd; }
  th { background: #f7f7f7; font-weight: 600; }
  .field-label { display: none; }
}
@media print {
  .agreement-page { padding: 0; max-width: none; }
  .skip-link { display: none; }
  table { font-size: 9px; }
  th, td { padding: 4px; }
}
