/* Shared reading standard for product interfaces. Article formatting is separate. */
:root {
  --reading-text: #153b34;
  --reading-muted: #405b54;
  --reading-focus: #936600;
  --ui-font-scale: 1;
  font-size:calc(112.5% * var(--ui-font-scale)) !important;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
:root[data-interface-font-size="standard"] {--ui-font-scale: 0.888888889;}
:root[data-interface-font-size="extra"] {--ui-font-scale: 1.111111111;}
body {
  font-family: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  font-size:1rem !important;
  line-height: 1.75 !important;
  --muted: var(--reading-muted);
}
:where(p, li, dt, dd, label, summary, legend, td, th) {line-height: 1.8;}
:where(p, li, dd) {overflow-wrap: anywhere;}
:where(button, input, select, textarea) {font-family: inherit;}
:where(button, select, input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea) {
  min-height: 44px;
  line-height: 1.5;
}
:where(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--reading-focus);
  outline-offset: 4px;
}
:where(input[type=checkbox], input[type=radio]) {width: 20px; height: 20px; flex-shrink: 0;}
:where(button, input, select, textarea):disabled {opacity: 1; color: #52645e;}
::placeholder {color: #52645e; opacity: 1;}
.reading-details {margin: 16px 0; max-width: 76ch;}
.reading-details > summary {cursor: pointer; min-height: 44px; padding: 8px 0; color: #075f56; font-weight: 600;}
.reading-details[open] > summary {margin-bottom: 12px;}
.reading-details p {margin: 0 0 16px; line-height: 1.8;}
.reading-points {padding-left: 24px; margin: 16px 0;}
.reading-points li {margin: 8px 0;}
.memory-shell {max-width: 1440px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px;}
.memory-shell > * {grid-column: 1 / -1; min-width: 0;}
.memory-shell > .memory-storage, .memory-shell > .memory-schedule {grid-column: auto;}
.memory-shell .memory-settings {margin: 0; padding: 26px;}
.memory-shell h2 {font-size:calc(24px * var(--ui-font-scale, 1)); line-height: 1.4; margin-bottom: 18px;}
.memory-shell h3 {font-size:calc(20px * var(--ui-font-scale, 1));}
.memory-shell .memory-intro {font-size:calc(18px * var(--ui-font-scale, 1)); line-height: 1.8; margin: 0 0 20px; max-width: 72ch;}
.memory-shell .memory-note {font-size:calc(17px * var(--ui-font-scale, 1)); line-height: 1.8;}
.memory-shell .memory-word-privacy {background: #eff6f1; color: #153b34; font-size:calc(18px * var(--ui-font-scale, 1)); line-height: 1.8; max-width: 76ch; padding: 16px 20px; margin: 18px 0;}
.memory-shell .memory-quota {margin-top: 22px; gap: 20px;}
.memory-shell .memory-schedule-controls {gap: 16px; align-items: end;}
.memory-shell .memory-schedule-controls label {gap: 10px;}
.monitor-controls {display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; margin-top: 24px; align-items: start;}
.monitor-controls > fieldset {margin: 0; padding: 22px;}
.monitor-auto-add p, .monitor-policy p {line-height: 1.8; margin: 14px 0;}
.monitor-auto-add label {gap: 12px; align-items: flex-start;}
.memory-shell .monitor-credit-summary {padding: 22px 0; margin: 24px 0 12px;}
.memory-shell .monitor-credit-summary h3 {font-size:calc(24px * var(--ui-font-scale, 1));}
.memory-shell .monitor-credit-summary details {margin-top: 14px;}
.memory-shell .monitor-credit-summary p {max-width: 76ch;}
.memory-shell .cloud-monitor-row {padding: 22px 0;}
.memory-shell .memory-list, .memory-shell .memory-pager {margin: 0;}
.panel {font-size:calc(17px * var(--ui-font-scale, 1)) !important;}
.panel button, .panel input, .panel select, .panel summary {font-size:calc(16px * var(--ui-font-scale, 1));}
.panel .panel-header {gap: 16px;}
.panel .panel-bottom-links {flex-wrap: wrap; gap: 8px 16px;}
.panel :is(.panel-target, .panel-quota-note, .capture-preview-note) {font-size:calc(16px * var(--ui-font-scale, 1)); line-height: 1.7;}
.panel .template-actions {gap: 8px;}
.help-content {font-size:calc(17px * var(--ui-font-scale, 1)); line-height: 1.8; max-width: min(520px,calc(100vw - 32px));}
.auth-flow {font-size:calc(18px * var(--ui-font-scale, 1));}
.auth-flow input {font-size:calc(18px * var(--ui-font-scale, 1)); min-height: 48px;}
.auth-flow button {min-height: 44px;}
.unit-ui table {line-height: 1.75;}
.unit-table-wrap {overflow-x: auto;}
.unit-ui th, .unit-ui td {padding: 14px;}
@media (max-width: 1000px) {
  .memory-shell {grid-template-columns: minmax(0,1fr);}
  .memory-shell > .memory-storage, .memory-shell > .memory-schedule {grid-column: 1;}
}
@media (max-width: 760px) {
  .monitor-controls {grid-template-columns: minmax(0,1fr);}
  .memory-shell {padding: 20px 16px 32px; gap: 20px;}
  .memory-shell .memory-settings {padding: 22px 18px;}
  .memory-shell h2 {font-size:calc(22px * var(--ui-font-scale, 1));}
  .memory-shell .memory-schedule-controls {align-items: flex-start;}
  .memory-shell .memory-word-privacy {padding: 14px 16px;}
  .monitor-controls > fieldset {padding: 18px 16px;}
  .demo-columns {grid-template-columns: minmax(0,1fr); gap: 18px;}
  .source-paper, .target-paper {padding: 18px;}
  .source-paper p:nth-last-child(2), .section-heading > p {display: block;}
  .flow-arrow {transform: rotate(90deg); min-height: 32px;}
  .target-body {height: auto; min-height: 160px; max-height: none;}
  .demo-caption {flex-wrap: wrap; gap: 8px;}
  .demo-bottom {flex-wrap: wrap;}
  .site-header, .nav {height: auto; min-height: 76px; flex-wrap: wrap; gap: 16px;}
}

/* Keep legacy component selectors on the shared reading standard. */
body :is(button:not(.help-trigger), select, input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea) {min-height: 44px;}
body :is(button, input, select, textarea):disabled {opacity: 1 !important; color: #52645e !important;}
fieldset:disabled {opacity: 1;}
/* Question marks stay compact; the expanded explanation uses the reading size. */
button.help-trigger {width: 20px !important; height: 20px !important; min-height: 20px !important; min-width: 20px !important; padding: 0 !important; font: 600 12px/1 system-ui !important; color: #405b54;}
.panel .panel-preview-entry > span:not(.help-wrap) {flex: 1 1 0; min-width: 0;}
.panel .panel-preview-entry > .help-wrap {flex: 0 0 20px; margin-left: 0;}
.help-content {font-size:calc(17px * var(--ui-font-scale, 1)) !important; line-height: 1.8 !important;}

/* Expanded template fields grow with their content at every reading size. */
.workspace .template-settings .mapping-table :is(th, td) {height: auto;}
.template-settings .settings-binding-actions {flex-wrap: wrap; min-width: 0;}
.template-settings .settings-binding-actions > button {white-space: nowrap; flex-shrink: 0;}
.template-settings .field-rule-options {flex-wrap: wrap;}
.template-settings .field-rule-options .choice-group {min-width: 0; max-width: 100%;}
html:has(body.template-settings-page) {scroll-padding-top: 96px; scroll-padding-bottom: calc(var(--settings-footer-height,88px) + 24px);}
.template-settings .settings-content :is(input,textarea,select,button,summary) {scroll-margin-block: 16px;}
@media (max-width: 850px) {
  .template-settings .settings-binding-actions {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%;}
  .template-settings .settings-binding-actions .choose-page-button {width: auto;}
}
@media (max-width: 600px) {
  .template-settings .settings-binding-actions {grid-template-columns: minmax(0,1fr);}
}

/* The same lightweight preference is available on signed-out and signed-in pages. */
.reading-size-footer {display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding: 16px 24px; width: 100%; max-width: 1440px; margin: 0 auto; box-sizing: border-box;}
body .reading-size-control {position: relative; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-width: 0; max-width: 100%; border: 0; background: transparent; border-radius: 0; padding: 0; margin: 0; color: #405b54; font-size: calc(16px * var(--ui-font-scale, 1)); line-height: 1.5; white-space: nowrap;}
.reading-size-choices {display: inline-flex; gap: 2px; align-items: center;}
body .reading-size-choices label {position: relative; display: inline-flex; justify-content: center; align-items: center; box-sizing: border-box; min-width: 28px; min-height: 28px; padding: 2px 6px; margin: 0; border: 1px solid #c4d5cc; border-radius: 4px; color: #153b34; background: #fff; font: inherit; line-height: 1.25; cursor: pointer;}
body .reading-size-choices label:has(:checked) {background: #eff6f1; border-color: #087b65; color: #075f56; font-weight: 700;}
.reading-size-choices label:has(:focus-visible) {outline: 3px solid var(--reading-focus); outline-offset: 3px;}
body .reading-size-choices input, body .reading-size-control .reading-size-sr-only {position: absolute; left: 0; top: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;}
.panel .panel-bottom-links {align-items: center;}
.panel .reading-size-control {flex-basis: 100%; justify-content: flex-end;}
.memory-footer, .template-settings .workspace-footer .data-notice, .site-footer .footer-links {flex-wrap: wrap;}
.memory-footer {display: flex; align-items: center; gap: 16px;}
.memory-footer > .reading-size-control {margin-left: auto;}
.word-preview, .style-preview-content {--ui-font-scale: 1;}

/* Main information follows the preference; supporting copy keeps its own role. */
body :is(
  .reading-description, .hint, .muted, .small-text, .choice-description,
  .account-note, .account-membership-note, .panel-quota-note, .panel-target,
  .target-name, .capture-preview-note, .capture-caption, .capture-setup-hint,
  .workflow-access-hint, .help-content, .help-list, .help-steps,
  .memory-intro, .memory-note, .memory-word-privacy, .reading-points,
  .reading-details, .monitor-auto-add p, .monitor-policy p,
  .monitor-credit-summary p, .section-heading > p, .page-intro,
  .settings-subtitle, .settings-section-description, .field-hint,
  .review-meta, .review-note, .history-entry-meta,
  .benefit-note, .price-note, .audience, .included-note,
  .savings-basis, .savings-disclaimer, .auth-flow p,
  .panel-preview-entry > span:not(.help-wrap),
  .screenshot-default-toggle, .workflow-toggle, .workflow-display-entry,
  .panel-bottom-links, .reading-size-footer, .reading-size-control,
  .site-footer, .memory-footer, .data-notice
):not(:where(.word-preview *, .style-preview-content *)) {
  --ui-font-scale: 1;
  font-size: 16px !important;
  line-height: 1.6;
}
/* Explicit local sizes inside these descriptions use the same fixed scale. */
body :is(.reading-description, .reading-points, .reading-details, .help-content,
  .panel-bottom-links, .site-footer, .memory-footer, .data-notice) {
  --ui-font-scale: 1;
}
body:not(.account-page) > .site-header ~ main :is(p, li, small, figcaption):not(
  :where(.price, .price *, .source-paper *, .target-paper *, .savings-estimates *)
) {
  --ui-font-scale: 1;
  font-size: 16px !important;
  line-height: 1.7;
}
