/* ============================================================================
   scale.css — the panel's one type and size scale. Loaded last, so every
   component (kit and Filament pieces) reads its sizes from here.

   Values are CSS px; the shell is zoomed by --zoom (.96), so on screen
   13.5 → 13, 15.5 → 15, 37.5 → 36.

     role            css    on screen   weight
     chip / badge    11.5   11          700
     caption / help  12.5   12          400
     label / head    13     12.5        500   (field label, table head, tab, button)
     body / value    13.5   13          400   (table cell, info value, menu item 500)
     card title      15.5   15          700
     topbar title    16.5   16          700
     page title      21     20          700
     control height  37.5   36                (input, select, button, search)
     menu item       37.5   36
   ============================================================================ */

:root {
  --sc-chip: 11.5px;
  --sc-caption: 12.5px;
  --sc-label: 13px;
  --sc-body: 13.5px;
  --sc-card: 15.5px;
  --sc-topbar: 16.5px;
  --sc-page: 21px;
  --sc-ctl: 37.5px;
  --sc-nav: 37.5px;

  /* the kit's own tokens, retuned onto the scale */
  --fs-caption: var(--sc-caption);
  --fs-body: var(--sc-body);
  --fs-field: var(--sc-body);
  --fs-tip: var(--sc-caption);
  --fs-h5: var(--sc-card);
  --fs-h4: var(--sc-topbar);
  --sidebar-w: 248px;
}

/* ── Topbar ─────────────────────────────────────────────────────────── */
.topbar .title { font-size: var(--sc-topbar); }
.tb-search { height: var(--sc-ctl); }
.tb-search input { font-size: var(--sc-body); }
.tb-search kbd { font-size: var(--sc-chip); }

/* ── Sidebar ────────────────────────────────────────────────────────── */
.pk-id-logo img { width: 46px; }
.pk-id-word { font-size: 28px; }
.usermenu.pk-id { gap: 10px; padding: 12px 12px 10px; }
.acc-sum .lbl { font-size: var(--sc-body); }
.nav-item { min-height: var(--sc-nav); }
.nav-item .lbl { font-size: var(--sc-body); font-weight: 500; }
.nav-item.is-active .lbl { font-weight: 700; }
.sidebar .chip { font-size: var(--sc-chip); }
.pk-id-who b { font-size: var(--sc-body); }
.pk-id-who small, .side-foot { font-size: var(--sc-caption); }

/* ── Page header and cards ──────────────────────────────────────────── */
.fi-header-heading { font-size: var(--sc-page); }
.fi-header-subheading { font-size: var(--sc-label); }
.fi-section-header-heading { font-size: var(--sc-card); font-weight: 700; }
.fi-section-header-description { font-size: var(--sc-caption); }

/* ── Record view (infolists) and tabs ───────────────────────────────── */
.fi-in-entry-label, .fi-in-entry-wrp-label { font-size: var(--sc-label); font-weight: 500; }
.fi-in-text-item, .fi-in-text-item * { font-size: var(--sc-body); }
.fi-tabs-item-label, .fi-tabs-item { font-size: var(--sc-label); }

/* ── Chips, badges, tags (the floor: nothing smaller) ───────────────── */
.fi-badge, .fi-badge *, .tag, .chip { font-size: var(--sc-chip); }

/* ── Tables ─────────────────────────────────────────────────────────── */
.ad-grid .g-head > th, .ad-grid .g-cap { font-size: var(--sc-label); font-weight: 600; }
.ad-grid tbody td { font-size: var(--sc-body); }
.ad-grid .g-search { height: var(--sc-ctl); }
.ad-grid .g-search input, .ad-grid .g-txt input, .ad-grid .g-sel select { font-size: var(--sc-body); }
.ad-grid .g-size, .ad-grid .g-page, .ad-grid .g-fbuild, .ad-grid .g-fclear, .ad-grid .g-pager, .ad-grid .g-foot { font-size: var(--sc-label); }

/* ── Forms ──────────────────────────────────────────────────────────── */
.m-tf.is-shrink > label { transform: translate(var(--tx), -7px) scale(.85); }   /* 13.5 × .85 ≈ 11.5 */
.fi-fo-field-label-content, .fi-fo-field-wrp-label, .m-fcl { font-size: var(--sc-label); font-weight: 500; }
.help, .fi-fo-field-wrp-helper-text, .fi-fo-field-wrp-hint { font-size: var(--sc-caption); }
.m-tf .box > input, .m-tf .box > .select { padding-block: calc((var(--sc-ctl) - 1.1876em) / 2); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.m-btn:not(.small) { min-height: var(--sc-ctl); }

/* the outline notch is sized by the legend; it must match the shrunk label */
.m-tf fieldset > legend { font-size: .85em; }
.ad-grid .g-info { font-size: var(--sc-label); }
.pop-user .sub { font-size: var(--sc-caption); }

/* Every table: headers and values centred, the first column included. */
.ad-grid .g-head > th, .ad-grid tbody td:not(.g-detail > td) { text-align: center; }
.ad-grid .g-head > th.g-cmd { text-align: center; }

/* Grid pages scroll as a page: the table grows to its rows and the pager
   follows them, instead of a fixed-height box that scrolls inside itself. */
.grid-page { height: auto !important; }
.grid-page .ad-grid { height: auto; }
.grid-page .ad-grid .g-body { flex: 0 0 auto; overflow-y: visible; overflow-x: auto; }
.ad-grid .g-head > th { padding-block: 10px; }
/* MyoFit's wordmark is an image (its own brand colours), sized to the Talkino text it stands in for */
.pk-id-logo img.pk-id-wordmark { width: auto; height: 20px; }
