/* Labeled controls use compact rectangles. Only fixed-size icon actions are circles. */
:root {
  --button-paper:#f2f7f1;
  --button-ink:#203d32;
  --button-edge:#a8c1b3;
  --button-dark:#164a38;
  --button-dark-edge:#164a38;
  --button-off:#e9eee9;
  --button-off-ink:#53685c;
  --button-off-edge:#becdc3;
  --skin-focus:#214e38;
}

:root[data-z-pane="a"] {
  --button-paper:#21463a;
  --button-ink:#edf7f0;
  --button-edge:#648877;
  --button-dark:#216047;
  --button-dark-edge:#7eae96;
  --button-off:#2c493f;
  --button-off-ink:#c7d7cc;
  --button-off-edge:#617c6d;
  --skin-focus:#cae9d3;
}

html[data-z-font] body :where(
  button,summary,input[type="button"],input[type="submit"],input[type="reset"],input[type="image"],
  a[href],[role="button"],[role="tab"],.history-open,.entry-choice,.checkbox-label
):not(:where(svg *,.drawer-shade,.jade-core,.agent-node,.workbook :is(#auth-switch,.type-preview-footer > a,.tone))),
html[data-z-pane]:not([data-z-pane='b'])[data-z-font] body .record-layout button.tone[aria-pressed="true"],
html[data-z-pane][data-z-font] body #memory-dialog .checkbox-label {
  --control-fill:var(--button-paper);
  --control-ink:var(--button-ink);
  --control-edge:var(--button-edge);
  color:var(--control-ink)!important;
  background:var(--control-paint,var(--control-fill))!important;
  border:1px solid var(--control-edge)!important;
  border-image:none!important;
  border-radius:var(--control-round,10px)!important;
  box-shadow:none!important;
  -webkit-tap-highlight-color:transparent;
}

html[data-z-font] body.workbook .rail-brand > .brand {
  --control-edge:transparent;
}

html[data-z-font] body :is(
  .primary,#record,#play-reference,#analyze,#auth-submit,#guest-start,#language-continue,
  #chat-send,#new-chat,#export,#science-generate,#generate-corrected,#view-principle-video,
  #memory-retry-recording,.ev-receipt button,[data-view="analysis"] .page-actions [data-go="tutor"],
  a[download][href],.history-open,.at-toggle,.choices a.open
) {
  --control-fill:var(--button-dark);
  --control-ink:#fff;
  --control-edge:var(--button-dark-edge);
}

html[data-z-font] body :is(
  .mobile-dock a[aria-current="page"],.studio-nav[aria-current="page"],[role="tab"][aria-selected="true"],
  [aria-pressed="true"],details[open] > summary,#help[aria-expanded="true"],.at-more[aria-expanded="true"],
  :is(.entry-choice,.checkbox-label):has(input:checked)
):not(:where(.jade-core,.agent-node)),
html[data-z-pane][data-z-font] body #memory-dialog .checkbox-label:has(input:checked) {
  --control-fill:#deeee3;
  --control-ink:#183b2d;
  --control-edge:#739e85;
}

html[data-z-pane]:not([data-z-pane='b'])[data-z-font] body .record-layout button.tone[aria-pressed="true"],
html[data-z-font] body #memory-trend-values button[aria-pressed="true"] {
  --control-fill:var(--button-dark);
  --control-ink:#fff;
  --control-edge:var(--button-dark-edge);
}

html[data-z-font] body :is(
  button:disabled,input:where([type="button"],[type="submit"],[type="reset"],[type="image"]):disabled,
  a[aria-disabled="true"]
):not(:where(.jade-core,.agent-node)) {
  --control-fill:var(--button-off)!important;
  --control-ink:var(--button-off-ink)!important;
  --control-edge:var(--button-off-edge)!important;
  opacity:1;
}

html[data-z-font] body :where(
  button,summary,a[href],[role="button"],[role="tab"],.entry-choice,.checkbox-label
):not(:where(.drawer-shade,.jade-core,.agent-node))
  :where(span,b,small,strong,em,svg):not(:where(.history-open,.history-item>.ws-icon:first-child,.student-list button>.ws-icon:first-child)),
html[data-z-pane][data-z-font] body .studio-nav[data-route]::before,
html[data-z-pane][data-z-font] body #language-dialog .entry-choice :where(strong,span),
html[data-z-pane][data-z-font] body .record-layout button.tone:disabled :where(span,b,small,em,svg) {
  color:inherit!important;
}

html[data-z-font] body :where(
  button,summary,a[href],input,[role="button"],[role="tab"],.entry-choice,.checkbox-label
):not(:where(.drawer-shade,.jade-core,.agent-node,:disabled,[aria-disabled="true"])):is(:hover,:active) {
  --control-paint:color-mix(in srgb,var(--control-fill),#102e24 8%);
}

html[data-z-font] body :where(a,button,input,summary,[role="button"],[role="tab"]):not(:where(svg *,.drawer-shade,.jade-core,.agent-node)):focus-visible,
html[data-z-font] body :is(.entry-choice,.checkbox-label):has(:focus-visible) {
  outline:2px solid var(--skin-focus);
  outline-offset:3px;
}

html[data-z-font] body :is(
  .at-toggle,.at-more,.shell-icon-button,.dialog-close,.entry-close,#entry-toggle-password,#chat-send,.ac-previous,.ac-next
) {
  --control-round:50%;
  inline-size:44px!important;
  block-size:44px!important;
  min-inline-size:44px!important;
  min-block-size:44px!important;
  padding:0!important;
  aspect-ratio:1;
  flex:none;
  align-items:center;
  justify-content:center;
}

html[data-z-font] body a[href]:has(>img) {padding:5px;}
html[data-z-font] body a[href]>img {border-radius:8px;}

html[data-z-font] body a[href]:not(:where(
  .brand,.palm-mobile-brand,.studio-nav,.mobile-dock a,.a-back,.book-return,.palm-return,
  [data-go],[download],.choices a.open,:has(>img),.workbook .type-preview-footer > a
)) {
  --control-round:8px;
  display:inline-block;
  max-width:100%;
  padding:.18em .7em;
  line-height:1.4;
  text-decoration:none;
  box-decoration-break:clone;
  overflow-wrap:anywhere;
}

html[data-z-font] body :is(
  nav[aria-label="预览导航"] > a,.type-preview-footer > a,.font-link > a,.comparison-link > a,.source-note > a
):not(:where(.workbook .type-preview-footer > a)) {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:5px 12px;
  text-decoration:none;
}

html[data-z-font] body .checkbox-label {padding:6px 12px;}

@media (max-width:500px) {
  html[data-z-font]:not([data-z-pane]) header nav[aria-label="预览导航"] {gap:5px;}
  html[data-z-font]:not([data-z-pane]) header nav[aria-label="预览导航"] > a {
    padding-inline:8px;
    white-space:nowrap;
  }
}

@media (forced-colors:active) {
  :root {--skin-focus:Highlight;}
}
