/* Typeset pass. Loaded last. The system UI stack set by the graphite theme stays
   the authoritative face: this is a dense Operate-mode tool and a webfont would
   add load time without adding meaning. What changes is how the roles are used:
   a 12px floor, tracking no tighter than -0.04em, tabular numerals on readouts,
   and prose with a real measure. */

html.graphite63{
  /* Role scale (purpose, not value). */
  --type-micro:12px;   /* metadata, chip labels, hints */
  --type-control:13px; /* buttons, selects, summaries */
  --type-body:14px;    /* panel copy */
  --type-title-room:clamp(18px,1.65vw,25px);
  --type-title-page:clamp(30px,2.8vw,44px);
  --track-display:-.04em;

  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  font-optical-sizing:auto;
  font-kerning:normal;
}

/* Floor: nothing readable below 12px. Replaces the 11px chips and hints. */
html.graphite63 :is(
  #palette-comparisons47 span,
  #gallery-inks49,
  #detail #canvas-tools45 #undo45,
  .stage-foot49 #gesture-help45,
  .studio-library49>.shelf49>summary,
  #detail .finish-toolbar .actions button,
  .format-note57,
  .rail59 .rail-label59,
  .vary-panel59 .history-actions48 button,
  .gallery-count59,
  .gallery-toolbar59 .data59,
  #detail .format-caption57,
  #detail .props-head59 .history-detail48 button,
  #detail #editor-prop59 .pin48,
  #detail #editor-formats63 :is(.focus-canvas59,.format-center57),
  #palette-panel .pal-previews48 span,
  dialog#export-menu49 #batch-grid50 small,
  dialog#motion-room50 .motion-size57
){font-size:var(--type-micro)}

/* Display tracking: never tighter than -0.04em; headings balance their lines. */
html.graphite63 :is(h1,h2,.brand49,.rail59 .brand49,.detail-title49 #name,.post-head50 h2,#palette-panel h2,.gallery-heading59 :is(h1,h2),.studio-heading49 h1,#detail .finish-toolbar #name){
  letter-spacing:var(--track-display);
}
html.graphite63 :is(h1,h2,h3,#name,legend){text-wrap:balance}

/* Titles share one scale across rooms. */
html.graphite63.studio59 #detail .finish-toolbar #name{font-size:var(--type-title-room)}
html.graphite63.studio59 #gallery-head63 h1{font-size:var(--type-title-page)}

/* Prose: a measure and even rag. Light-on-dark gets extra leading. */
html.graphite63 :is(p,[role=status],.help,.hint,.note){
  max-width:68ch;
  line-height:1.5;
  text-wrap:pretty;
}
html.graphite63 :is(#gesture-help45,.format-note57){max-width:none}

/* Readouts: figures keep their width while values change. */
html.graphite63 :is(output,progress+*,input[type=number],#gallery-work-count48,#gallery-ink-scope63,.gallery-count59,.motion-size57,[id$=-value45],[id$=-number45]){
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1;
}

/* Labels over inputs: a firmer weight than the value they describe. */
html.graphite63 :is(legend,.setting48>label>span:first-child){font-weight:600}

/* Native text fields. */
@media(pointer:coarse){
  /* iOS zooms into fields under 16px. */
  html.graphite63 :is(input:not([type=range]):not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px}
}
