/* Hearth root tokens (253.1, Tom 15 Nov 17:04 "self-fixing root layout rules"; Lumi's brief).
   The one place for sizes the root rules and the shared components use: spacing, radius, type, tap size, the least widths
   of grid cells, and the few layout values the GM screen takes from them. A theme never sets any of these (themes are
   colour and texture values only: ui/theme-tokens.css, ui/theme-test.css), so every theme lays out the same.
   tools/lint-tokens.mjs keeps new hard-coded px sizes and hex colours out of the app (a ratchet: the count only goes down). */
:root {
  /* the status bar's height where the app has to keep clear of it itself (0 in the Android app: fix 13) */
  --safe-t: var(--hearth-safe-top, env(safe-area-inset-top, 0px));
  /* spacing */
  --sp-hair: 1px;                      /* a hairline border */
  --sp-half: 2px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  /* radius */
  --rad-1: 8px;
  --rad-2: 12px;
  --rad-3: 16px;
  --rad-4: 22px;
  --rad-pill: 999px;
  /* type: fluid between a phone and a laptop, never smaller than 11px */
  --fs-xs: clamp(11px, 0.66rem + 0.12vw, 12px);
  --fs-sm: clamp(12px, 0.72rem + 0.15vw, 13.5px);
  --fs-md: clamp(14px, 0.84rem + 0.2vw, 16px);
  --fs-lg: clamp(16px, 0.94rem + 0.3vw, 19px);
  --fs-xl: clamp(19px, 1.1rem + 0.5vw, 26px);
  --lh-tight: 1.15;
  --lh-body: 1.35;
  /* tap: every control's touch area is at least --tap; what you see can stay at --tap-visual (the signed 44 dp) */
  --tap: 48px;
  --tap-visual: 44px;
  /* icons and menus */
  --icon-sm: 18px;
  --icon-md: 22px;
  --tip-hold: 380;                     /* ms a finger rests on a toolbar button before its name shows */
  --menu-w-min: 200px;
  --menu-w-max: 320px;
  --menu-h-max: 520px;
  --menu-pad: 6px;
  --shadow-pop: 0 12px 30px;
  /* the least width of a grid cell before the grid drops a column (rule 5) */
  --cell-tile: 4.5rem;                 /* map builder palette tiles: 72 px at the normal size; rem grows with the font size */
  --cell-card: max(260px, 16.25rem);   /* creator cards with a line of text (features, spells) */
  --cell-skill: max(150px, 9.5rem);    /* creator skill tiles */
  --cell-portrait: 96px;               /* portrait pickers */
  --cell-default: 160px;
  /* cards (253.1 fix-back rule 3) */
  --card-text-min: 8rem;               /* the least width of a card's title / meta column; the step where the actions go under it is 26rem (ui/root-rules.css) */
  --card-lead: 4rem;                   /* room for a card's lead icon and its gap beside the text, when the text has the line to itself */
  --tile-h: calc(44px + 2.3em);        /* a tile with an icon and a two-line name (2.3em = two lines at line-height 1.15) */
  /* the keyboard (rule 1): set by ui/root-rules.js while a keyboard covers part of the window */
  --kb-h: 0px;
  /* the GM screen (253.1 part C, Tom 16 Nov 01:22) */
  --gm-toolbar-h: 44px;                /* the one slim tools row along the top ... */
  --gm-toolbar-h-laptop: 40px;         /* ... on a laptop */
  --gm-init-h: 52px;                   /* the slim initiative row (Rnd, faces, End turn) */
  --gm-band-share: 0.5;                /* GM, upright (phones, tablets, Folds): the section under the map is this share of the app's height: 50/50 (Tom 16 Nov) */
  --gm-map-rows-min: 4;                /* the map never shows fewer rows than this */
  --gm-pane-min: 380px;                /* the GM side panel beside the map: clamp(min, a quarter or a third of the width, max) ... */
  --gm-pane-min-laptop: 360px;         /* ... its least width on a laptop */
  --gm-pane-max: 560px;
  --atmo-night-dim: 1;                 /* Night on every map (GM, players, projector): how much of the night's tint shows; 1 = the full night, 0 = as bright as day */
  --l-band-scale: 1.45;                /* the player's Fold-open L: the bottom band, times the 252 of 14 Nov */
  --gm-row: 44px;                      /* one row of the GM monster card */
  --gm-tool-inset: 6px;                /* a tools button is this much shorter than its row */
  --gm-tool-padx: 10px;
  --gm-tool-gap: 3px;
  --gm-div-h: 32px;                    /* the dividers between tool groups */
  --gm-card-padx: 10px;                /* the Fold-upright monster card's side padding and column gap */
  --gm-save-gap: 5px;
  /* the page walkthrough's coachmark (Addendum 13, BR-088; ui/coachmark.js). Sizes only: its colours are the theme's */
  --cm-card-w: 360px;                  /* the card; a phone uses the screen less two edges */
  --cm-card-w-side: 280px;             /* the card when it sits beside its target (Fold) */
  --cm-edge: 12px;                     /* the card always keeps this far inside the screen */
  --cm-gap: 16px;                      /* between the spotlight and the card */
  --cm-pad: 6px;                       /* the spotlight is the target plus this on each side */
  --cm-rad-max: 16px;                  /* the spotlight's corner follows the target, up to this */
  --cm-caret: 16px;
  --cm-ring: 2px;                      /* the ring round the spotlight, its halo and its glow (no pulsing) */
  --cm-halo: 5px;
  --cm-glow: 26px;
  --cm-dot: 8px;                       /* the step dots; the current one is a bar */
  --cm-dot-on: 24px;
  --cm-label: 11.5px;                  /* "Home · 2 of 4" */
  --cm-title: 20px;
  --cm-body: 15px;                     /* times the app's Text size */
  --cm-max-h: 70vh;                    /* past this the card scrolls inside itself */
}
