/* Shared outer-site surfaces. App demos and media viewers are deliberately unmarked. */
@font-face {
  font-family: 'Site Surface Light';
  src: url('./site-surface-light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
[data-site-surface] {
  --surface-paper: #fff;
  --surface-ink: #151515;
  --surface-muted: #737373;
  --surface-rule: #dedede;
  --surface-pad: 28px;
  --surface-title: 28px;
  --surface-font: 'Site Surface Light', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  box-sizing: border-box;
  background: var(--surface-paper) !important;
  color: var(--surface-ink) !important;
  border: 1px solid var(--surface-rule) !important;
  border-radius: 3px !important;
  font-family: var(--surface-font) !important;
  font-weight: 300 !important;
  font-size: 14px;
  line-height: 1.75;
  text-align: left;
  overscroll-behavior: contain;
  box-shadow: none !important;
  color-scheme: light;
}
[data-site-surface]::backdrop { background: rgb(0 0 0 / .3); backdrop-filter: none; }
[data-site-surface] :is(button, input, textarea, select) { font-family: var(--surface-font) !important; font-weight: 300 !important; }
[data-site-surface] :is(h2,h3,h4,dt,strong,b):not(.tip-workbench *) { color: var(--surface-ink); font-weight: 300 !important; }
[data-site-surface] h2,
[data-site-surface].package-tip > h3,
[data-site-surface] .tip-benefits-title > h3 {
  font-size: var(--surface-title) !important;
  line-height: 1.3 !important;
  letter-spacing: -.025em;
  margin: 0;
}
[data-site-surface] :is(p,dd):not(.tip-workbench *) { font-size: 14px; line-height: 1.75; }
[data-site-surface] :is(p,dd,small,.sheet-intro,.contact-context,.contact-topic):not(.tip-workbench *) { color: var(--surface-muted); }
[data-site-surface] :is(h3,h4,dt):not(.tip-workbench *) { font-size: 14px; line-height: 1.65; }
[data-site-surface] :is(button,a,input,textarea,select):focus-visible { outline: 1px solid var(--surface-ink); outline-offset: 4px; }
[data-site-surface] :is(button,a) { -webkit-tap-highlight-color: transparent; }

/* Explicit scope and important token rules bridge the legacy page styles. */
[data-site-surface='contact'],
[data-site-surface='detail'],
[data-site-surface='service'] {
  width: min(560px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  padding: var(--surface-pad) !important;
  margin: auto !important;
  inset: 0 !important;
  overflow: auto;
}
[data-site-surface='contact'] { width: min(520px, calc(100vw - 32px)) !important; }
[data-site-surface='info'] {
  width: min(440px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  padding: var(--surface-pad) !important;
  overflow: auto;
  box-shadow: 0 8px 32px rgb(0 0 0 / .07) !important;
}
[data-site-surface='info']::backdrop,
[data-site-surface='utility']::backdrop { background: transparent; }
[data-site-surface] > :is(header,.dialog-heading,.sheet-header,.project-dialog-head),
[data-site-surface] > form > :is(.dialog-heading,.dialog-header) {
  display: flex;
  min-height: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  margin: 0 0 24px;
  border: 0;
  background: var(--surface-paper);
}
[data-site-surface] :is(.dialog-close,.sheet-close,.close-button,.close-dialog,.icon-button,.product-tip-close,#close-consult,#close-project,#close-wallet-risk,#close-wallet-security,#close-benefit,#home-call-close,.voice-call-close) {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px !important;
  height: 44px !important;
  min-height: 44px;
  padding: 10px;
  margin: -7px -10px -7px 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
  color: var(--surface-muted) !important;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
[data-site-surface] :is(.icon-button,.sheet-close) svg { width: 22px; height: 22px; }
[data-site-surface] :is(.dialog-close,.sheet-close,.close-button,.close-dialog,.icon-button,.product-tip-close):hover { color: var(--surface-ink) !important; }
[data-site-surface] :is(.product-tip-launch,.wallet-risk-coach-link,.dialog-action,.copy-brief,.chat-form>button,.consult-button,.project-actions>button,.contact-form button[type='submit'],#contact-form button[type='submit'],#consult-form button[type='submit']) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 48px;
  height: auto;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--surface-rule);
  border-radius: 0;
  background: transparent;
  color: var(--surface-ink);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  box-shadow: none;
}
[data-site-surface] :is(.product-tip-launch,.dialog-action,.copy-brief,.consult-button,.chat-form>button,#contact-form button[type='submit']):hover { border-color: var(--surface-ink); background: transparent; }
[data-site-surface] :is(button:disabled) { opacity: .45; cursor: not-allowed; }
[data-site-surface] :is(textarea,input:not([type='checkbox']):not([type='radio'])) {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--surface-rule);
  border-radius: 3px !important;
  background: var(--surface-paper);
  color: var(--surface-ink);
  padding: 12px;
  font-size: 16px;
  line-height: 1.6;
  box-shadow: none;
}
[data-site-surface='contact'] textarea { min-height: 130px; resize: vertical; }
[data-site-surface] label { font-size: 12px; color: var(--surface-muted); }
[data-site-surface] :is(.feedback,[role='status'],.contact-note) { font-size: 12px; line-height: 1.65; }

/* Contact content shares the same rhythm, including the former chat-sheet layout. */
[data-site-surface='contact'] :is(.sheet-intro,.contact-topic,.contact-context) { font-size: 14px; margin: 0 0 20px; line-height: 1.75; }
[data-site-surface='contact'] :is(.chat-content,.chat-form) { padding: 0; min-height: 0; }
[data-site-surface='contact'] .chat-content { display: block; margin: 0 0 22px; }
[data-site-surface='contact'] .chat-context { font-size: 14px; line-height: 1.75; margin: 0 0 8px; }
[data-site-surface='contact'] .chat-status { margin: 14px 0 0; }
[data-site-surface='service'] :is(.service-content,.service-bottom) { padding: 0; }
[data-site-surface='service'] .service-bottom { margin-top: 24px; flex-wrap: wrap; }
[data-site-surface='service'] .pill-button { border-radius: 0; background: transparent; color: var(--surface-ink); border: 0; border-top: 1px solid var(--surface-rule); padding: 14px 0 0; min-height: 48px; }
[data-site-surface='contact'] .chat-form { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; border: 0; }
[data-site-surface='contact'] .chat-form>button { margin-top: 12px; }
[data-site-surface='contact'] .chat-form>button svg { width: 22px; height: 22px; }
[data-site-surface='contact'] #contact-form>label { display: block; margin-bottom: 8px; }
[data-site-surface='contact'] #contact-form .feedback { margin: 12px 0 22px; }

/* Product descriptions keep their brand icon and section hierarchy. */
#product-tip[data-site-surface] > header { align-items: center; gap: 12px; margin-bottom: 20px; }
#product-tip[data-site-surface] header>img { width: 40px; height: 40px; border-radius: 9px; }
#product-tip[data-site-surface] header small { font-size: 11px; margin-bottom: 3px; color: var(--surface-muted); }
#product-tip[data-site-surface] .product-tip-close { align-self: flex-start; }
#product-tip[data-site-surface] .product-tip-intro { margin: 0 0 22px; }
#product-tip[data-site-surface] dl>div { padding: 16px 0; border-bottom: 1px solid var(--surface-rule); }
#product-tip[data-site-surface] dl>div:first-child { padding-top: 0; }
#product-tip[data-site-surface] dt { margin: 0 0 5px; }
#product-tip[data-site-surface] dd { margin: 0; }
#product-tip[data-site-surface] footer { margin-top: 24px; }
#product-tip[data-site-surface] footer>p { margin: 0 0 18px; font-size: 11px; color: var(--surface-muted); }
#product-tip[data-site-surface] .product-tip-launch { padding-top: 14px; }
@media(max-height:700px) {
  #product-tip[data-site-surface] > header {
    position: sticky;
    top: calc(-1 * var(--surface-pad));
    z-index: 2;
    margin: calc(-1 * var(--surface-pad)) calc(-1 * var(--surface-pad)) 20px;
    padding: var(--surface-pad);
    border-bottom: 1px solid var(--surface-rule);
  }
}

/* Package explanations and their small diagrams. */
.package-tip[data-site-surface] > .package-tip-heading {
  position: sticky;
  top: calc(-1 * var(--surface-pad));
  z-index: 3;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: calc(-1 * var(--surface-pad)) calc(-1 * var(--surface-pad)) 20px;
  padding: var(--surface-pad) !important;
  background: #fff;
  border-bottom: 1px solid var(--surface-rule);
}
.package-tip-heading > :is(h3,.tip-benefits-title) { flex: 1; min-width: 0; }
.package-tip[data-site-surface] .package-tip-heading h3 { font-size: var(--surface-title) !important; margin: 0; }
.package-tip-heading .tip-benefits-title { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
.package-tip-heading .tip-benefits-title > span { white-space: nowrap; font-size: 14px; }
.package-tip[data-site-surface] .package-tip-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: -7px -10px -7px 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--surface-muted);
  font-size: 24px;
  cursor: pointer;
}
.package-tip-workbench[data-site-surface] { width: min(760px, calc(100vw - 32px)) !important; max-width: calc(100vw - 32px) !important; }
.package-tip[data-site-surface] .tip-workbench { font: 14px/1.65 var(--font); }
.package-tip[data-site-surface] > p { margin: 16px 0 20px; }
.package-tip[data-site-surface] h4 { margin-top: 20px; color: var(--surface-muted); font-size: 12px; }
.package-tip[data-site-surface] :is(.tip-role-list>div,.tip-benefits-fees>div,.tip-maintenance-list>li) { border-color: var(--surface-rule); }
.package-tip[data-site-surface] :is(.tip-account-flow>div,.tip-maintenance) { border-radius: 3px; background: #f7f7f7; }
.package-tip[data-site-surface] .tip-role-list dd { font-size: 13px; }
#benefit-panel[data-site-surface] header { align-items: flex-start; }
#benefit-panel[data-site-surface] h3 { font-size: 12px; color: var(--surface-muted); margin-top: 20px; }
#benefit-panel[data-site-surface] .benefit-list li { font-size: 14px; padding-block: 4px; }
#benefit-dialog[data-site-surface] > header, #tier-dialog[data-site-surface] > header { margin-bottom: 14px; }
#benefit-dialog[data-site-surface] > h2, #tier-dialog[data-site-surface] > h2 { margin: 0 0 24px; }
#benefit-dialog[data-site-surface] .benefit-content { font-size: 14px; line-height: 1.75; font-weight: 300; }
#benefit-dialog[data-site-surface] .benefit-tabs button { font-size: 12px; border-color: var(--surface-rule); }
#benefit-dialog[data-site-surface] .benefit-tabs [aria-selected='true'] { border-color: var(--surface-ink); color: var(--surface-ink); }

/* Long payment descriptions scroll inside one light frame. */
[data-site-surface] :is(.wallet-risk-dialog-head,.dialog-head) { position: static; padding: 0; margin: 0 0 24px; border: 0; }
[data-site-surface] :is(.wallet-risk-dialog-content,.dialog-content) { padding: 0; }
[data-site-surface='detail'] > :is(.wallet-risk-dialog-head,.dialog-head,.project-dialog-head) {
  position: sticky;
  top: calc(-1 * var(--surface-pad));
  z-index: 2;
  margin: calc(-1 * var(--surface-pad)) calc(-1 * var(--surface-pad)) 24px;
  padding: var(--surface-pad);
  border-bottom: 1px solid var(--surface-rule);
}
[data-site-surface] :is(.wallet-risk-dialog-content,.dialog-content) h3 { font-size: 14px; font-weight: 300; }
[data-site-surface] :is(.wallet-risk-dialog-content,.dialog-content) p { font-size: 14px; line-height: 1.75; }
[data-site-surface] :is(.eyebrow,.wallet-risk-eyebrow,.dialog-eyebrow) { font-size: 11px; color: var(--surface-muted); letter-spacing: .02em; }
#project-builder[data-site-surface] fieldset { border: 0; padding: 0; margin: 24px 0; }
#project-builder[data-site-surface] legend { font-size: 12px; color: var(--surface-muted); margin-bottom: 8px; }
#project-builder[data-site-surface] fieldset>label { background: transparent; border: 0; border-bottom: 1px solid var(--surface-rule); border-radius: 0; padding: 14px 0; color: var(--surface-ink); font-size: 14px; }
#project-builder[data-site-surface] fieldset small { color: var(--surface-muted); font-size: 12px; font-weight: 300; }
#project-builder[data-site-surface] input[type='checkbox'] { accent-color: var(--surface-ink); }
#project-builder[data-site-surface] .project-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; }
#project-builder[data-site-surface] .brand-field { font-size: 12px; }

/* Compact call and companion controls retain their functional geometry. */
#remote-detail-dialog[data-site-surface] { transform: none; }
#remote-detail-dialog[data-site-surface] .remote-state-switcher button.is-active { background: #f3f3f3; color: var(--surface-ink); box-shadow: inset 0 -1px var(--surface-ink); }
#remote-detail-dialog[data-site-surface] .remote-loader { border-color: #ddd; border-top-color: #333; }
#remote-detail-dialog[data-site-surface] .remote-dialog-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  position: sticky;
  top: calc(-1 * var(--surface-pad));
  z-index: 2;
  background: #fff;
  margin: calc(-1 * var(--surface-pad)) calc(-1 * var(--surface-pad)) 20px;
  padding: var(--surface-pad);
  border-bottom: 1px solid var(--surface-rule);
}
#remote-detail-dialog[data-site-surface] #remote-dialog-close { flex: 0 0 44px; width: 44px; height: 44px; margin: -7px -10px 0 0; background: transparent; }
#remote-detail-dialog[data-site-surface] .remote-session-preview { background: #f7f7f7; color: var(--surface-ink); border: 1px solid var(--surface-rule); border-radius: 0; }
#remote-detail-dialog[data-site-surface] .remote-session-heading { color: var(--surface-muted); }
#remote-detail-dialog[data-site-surface] .remote-session-preview h3 { font-size: 18px; }
#remote-detail-dialog[data-site-surface] .remote-dialog-signals li { font-size: 12px; font-weight: 300; }
[data-site-surface='utility'] { box-shadow: 0 8px 32px rgb(0 0 0 / .07) !important; }
[data-site-surface='utility'] h2 { font-size: 18px !important; }
[data-site-surface='utility'] .voice-call-heading { justify-content: space-between; }
[data-site-surface='utility'] :is(.home-call-start,.voice-call-button,.button,.companion-writing,.companion-send) { border-radius: 3px; font-weight: 300; }
[data-site-surface='utility'] .companion-writing { border-color: var(--surface-rule); background: var(--surface-paper); }
[data-site-surface='utility'] textarea { border: 0; padding: 0; font-size: 16px; }
[data-site-surface='utility'] .companion-form { background: var(--surface-paper); border-color: var(--surface-rule); border-radius: 3px; }
[data-site-surface='utility'][data-mode='composer'] { backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-site-surface='utility'][data-mode='composer'] .companion-form { border: 0; }
[data-site-surface='utility'] .companion-form:focus-within { box-shadow: none; border-color: var(--surface-ink); }
[data-site-surface='utility'][data-state='idle'] .home-call-start,
[data-site-surface='utility'] .voice-call[data-state='idle'] .button { background: transparent; color: var(--surface-ink); border: 0; border-top: 1px solid var(--surface-rule); border-radius: 0; }
[data-site-surface='utility'] .companion-toolbar { background: var(--surface-paper); }

/* Keep layout and accessible text intact while individual glyphs appear. */
.surface-readable { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
.surface-word { display: inline-block; max-width: 100%; white-space: normal; }
.surface-glyph { display: inline-block; position: relative; }
.surface-glyph[data-phase] { color: transparent !important; }
.surface-glyph[data-phase='scramble']::after { content: attr(data-glyph); position: absolute; inset: 0; color: var(--surface-glyph-ink); text-align: center; overflow: hidden; }
@media(max-width:700px) {
  [data-site-surface] { --surface-pad: 20px; --surface-title: 24px; }
  [data-site-surface] > :is(header,.dialog-heading,.sheet-header,.project-dialog-head) { margin-bottom: 20px; }
  [data-site-surface='info'] { padding: var(--surface-pad) !important; }
}
@media(prefers-reduced-motion:reduce) {
  [data-site-surface], [data-site-surface]::backdrop { animation: none !important; transition: none !important; }
  .surface-glyph[data-phase] { color: var(--surface-glyph-ink) !important; }
  .surface-glyph::after { display: none; }
}
