/* Felt lettering shares the card's light direction. These are unblurred,
   subpixel edge cues, not extra weight, an outline or a new type scale.
   Reading, exact values and writing keep their original crisp ink. */
body.workspace-hand-enabled {
  --felt-type-raised: 0 .45px 0 rgb(0 0 0 / .20),
    0 -.2px 0 rgb(255 255 255 / .10);
  --felt-type-pressed: 0 -.3px 0 rgb(0 0 0 / .15),
    0 .3px 0 rgb(255 255 255 / .12);
  --felt-type-small: 0 .25px 0 rgb(0 0 0 / .14);
}

/* Real card names and section names sit slightly above the matte felt.
   The shared rule covers compact and full bodies without changing metrics. */
body.workspace-hand-enabled :is(.app-window, .workspace-hand-card-surface,
  .modal-content, .fb-modal-panel, .workspace-hand) :is(
  h1, h2, h3, h4, h5, h6, .window-title,
  .workspace-hand-card-heading, .workspace-hand-surface-title,
  .workspace-hand-title-full, .workspace-hand-preview__heading,
  .rm-title-main, .rm-inspector-title, .fb-title-main,
  .topic-title, .room-story-section-title, .sched-title,
  .rs-toolbar-title, .project-room-attribute-heading,
  .reference-panel-heading, .note-document-label, .task-ledger-label
) {
  text-shadow: var(--felt-type-raised);
}

/* At hand-code and label sizes a single contact cue stays sharp. */
body.workspace-hand-enabled :is(.workspace-hand-title-short,
  .workspace-hand-card-kind, .workspace-hand-preview__state,
  .workspace-hand-preview__metric-label, .workspace-hand-search,
  .workspace-hand-toggle) {
  text-shadow: var(--felt-type-small);
}

/* Fixed labels are pressed into the material around their actual controls.
   Data cells and the user's text are deliberately outside this selector. */
body.workspace-hand-enabled :is(.app-window, .modal-content, .fb-modal-panel)
  :is(label, th, dt, .detail-label, .equipment-detail-label,
    .fb-field-label, .sim-label, .rm-metric-label, .sched-h-label) {
  text-shadow: var(--felt-type-pressed);
}

/* Labels on a raised action move into the pressed state with that action.
   Glyph-only header controls get their depth from the operable piece itself. */
body.workspace-hand-enabled :is(.app-window, .modal-content, .fb-modal-panel,
  .workspace-hand, .context-menu, .rm-header-popover, .rm-cell-popover,
  .un-tb-more-menu) :is(button, [role="button"], [role="menuitem"], summary) {
  text-shadow: var(--felt-type-small);
}
body.workspace-hand-enabled :is(.app-window, .modal-content, .fb-modal-panel,
  .workspace-hand, .context-menu, .rm-header-popover, .rm-cell-popover,
  .un-tb-more-menu) :is(button, [role="button"], [role="menuitem"])
  :is(.btn-label, .action-label) {
  text-shadow: inherit;
}
body.workspace-hand-enabled :is(.app-window, .modal-content, .fb-modal-panel,
  .workspace-hand) :is(button:active, button[aria-pressed="true"],
    button[aria-selected="true"], summary[aria-expanded="true"]) {
  text-shadow: var(--felt-type-pressed);
}
body.workspace-hand-enabled :is(.app-window, .modal-content, .fb-modal-panel)
  details[open] > summary {
  text-shadow: var(--felt-type-pressed);
}

/* These remain real, selectable working text. A field's cut and a control's
   raised face already explain their position, so glyph relief adds no value.
   Source drawings and actual export previews keep their own representation. */
body.workspace-hand-enabled :is(.app-window, .modal-content, .fb-modal-panel,
  .workspace-hand) :is(input, textarea, select, [contenteditable="true"],
    .note-block-text, .note-block-heading, .user-note-body-ce,
    .task-title-text, .task-title-ce, .milestone-title-btn,
    .detail-value, .tree-label, td, .window-controls .win-btn,
    .fb-swatch-mfr, .fb-swatch-product, .fb-swatch-meta,
    .fb-spec-code, .fb-preview-code, svg text, .rs-page, .rs-sheet) {
  text-shadow: none;
}
body.workspace-hand-enabled :is(.rs-page, .rs-sheet, [contenteditable="true"])
  :is(h1, h2, h3, h4, h5, h6, label, th, button, summary) {
  text-shadow: none;
}

/* Lettering relief never supplies focus, state or contrast. Native high
   contrast and printed output use unembellished ink throughout. */
/* A card's selectable wrapper is a button, so its lettering cue can otherwise
   inherit into every line of the widget. Data/prose and the small identity code
   stay crisp; the full card title retains its restrained material lettering. */
body.workspace-hand-enabled :is(.workspace-hand-card-preview, .workspace-hand-card-preview *, .workspace-hand-code) {
  text-shadow: none;
}
@media (forced-colors: active), print {
  body.workspace-hand-enabled {
    --felt-type-raised: none;
    --felt-type-pressed: none;
    --felt-type-small: none;
  }
}
