/* Element defaults, design spec 4.3, 4.4, 4.7 and 5.3, with the shape, depth and motion of design D «Sportello»
   (research/design-d-spec.md 4 to 6). Roles come from theme.css, the grammar from tokens.css, the typefaces from
   fonts.css; every margin, padding and gap is one of the eight spacing steps of spec 4.3. Components live in
   components.css, the shell in shell.css; nothing here styles an element by its place inside main (spec 4.10). The
   body text is 16px (no shell pages, kiosk, spec 4.4); shell.css sets 14px inside the shell.
   Mukta draws its lowercase smaller than the system sans the product was read in while it shipped no typeface (its x
   height is 0.47 of the font size, against 0.52 for Helvetica and Arial), so the same 14px would read about a tenth
   smaller. font-size-adjust keeps every step of the type scale at the x height it had in the system sans and makes
   the fallback face shown while the font loads the same size; the em based sizes and the line boxes of text keep
   their size. It does not keep a field's height by itself: WebKit sets a single line field and a select on the font's
   own line spacing when that is larger, so components.css gives them a fixed height equal to the control height. The
   monospace face is not shipped and its x height differs by system, so the rules that set it opt out. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: var(--font-body); font-size: var(--text-0); font-size-adjust: 0.52; line-height: var(--leading-body); }

/* Links, spec 5.3: underlined in prose, thicker on hover, no visited colour */
a { color: var(--accent-text); text-underline-offset: 0.2em; }
a:visited { color: var(--accent-text); }
a:hover { text-decoration-thickness: 2px; }

/* Type, spec 4.4: the page title at --text-2, sections at --ph-text-lg, headings of a panel at --text-1; titles are set
   in the display face (Hepta Slab 600, design-d-spec.md 10) */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; color: var(--ink); }
h1 { margin: 0 0 var(--space-2); font-size: var(--text-2); font-weight: 800; line-height: var(--leading-display); letter-spacing: -0.02em; }
h2 { margin: var(--space-3) 0 var(--space-2); font-size: var(--ph-text-lg); }
h3 { margin: var(--space-2) 0 var(--space-1); font-size: var(--ph-text-md); }
h4 { margin: var(--space-2) 0 var(--space-1); font-size: var(--ph-text-md); }
p { margin: 0 0 var(--space-2); }
ul, ol { margin: 0 0 var(--space-2); padding-left: var(--space-3); }
dl { margin: 0 0 var(--space-2); }
dd { margin: 0; }
small { font-size: var(--ph-text-sm); }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.95em; font-size-adjust: none; }
img, svg { max-width: 100%; }
hr { border: 0; border-top: var(--border-w) solid var(--line); margin: var(--space-3) 0; }

/* Focus, spec 4.7 and design-d-spec.md 6: a 2px ring with 2px offset in the accent on paper and canvas; the sidebar and
   the main button override the colour and offset in shell.css and components.css. Focus is never removed from a control. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A heading the page moves the focus to (tabindex="-1": the title of an open side panel, large studios task 124) is
   where reading starts, not a control: it draws no ring, as the main area the skip link focuses draws none (shell.css). */
:is(h1, h2, h3)[tabindex="-1"]:focus { outline: none; }

/* Tables, design-d-spec.md 5: the head is small labels in the secondary ink on the sheet itself, with no band, and the
   rows are separated by one quiet rule. A head is in sentence case (spec 4.4); only the list table of components.css,
   the data table drawn as a card, sets its head labels in uppercase with tracking (design-d-spec.md 2). */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--surface-1); }
th, td { padding: var(--space-1) var(--space-2); border-bottom: var(--border-w) solid var(--surface-2); text-align: left; vertical-align: middle; line-height: 1.35; }
thead th { color: var(--ink-2); font-size: var(--text--1); font-weight: 600; }
tbody th { font-weight: 600; }
caption { padding: var(--space-1) var(--space-2); color: var(--ink-2); font-size: var(--ph-text-sm); text-align: left; background: var(--bg); }

input, select, textarea { accent-color: var(--accent); }
[hidden] { display: none !important; }

/* Print, spec 7.3: chrome, filters and actions hidden, dark text on white, full table rules, no shadow. */
@media print {
  @page { size: A4; margin: 15mm; }
  /* Every card, sheet and popover takes its shadow from one of the three roles, so setting the roles to none prints
     them all flat, whichever stylesheet and selector drew them. */
  :root { --shadow-1: none; --shadow-2: none; --shadow-3: none; }
  body { background: var(--surface-1); color: var(--ink); }
  a { color: var(--ink); text-decoration: none; }
  /* Spec 7.3: what works only on screen is not printed (toolbars, tabs, segments, period navigators, pagers, row actions
     and their column, row selection boxes, drawers, header and panel actions, menus and buttons), and no form of the page
     is the printed document (the filters, pickers, create and settings forms and the disclosures that hold them), so
     none of their controls prints (044 review C-6). components.css and the feature files load after this file and set
     display on the same classes, so the list is raised above their single class rules instead of using !important. */
  html:root :is(.toolbar, .tabs, .segments, .period, .pagination, .row-actions, .row-drawer, .row-open, .page-actions, .page-info, .panel-actions,
    .form-actions, .menu, button, .button, .button-primary, .button-ghost, .button-danger, .data-table input[type="checkbox"],
    .data-table thead th:has(> .visually-hidden:only-child), form, details.disclosure) { display: none; }
  table { background: var(--surface-1); }
  /* The quiet row rule of the screen would not show on paper: every cell of every table prints a full rule in --ink-3,
     which reaches 3:1 on white paper (design-d-spec.md 5), and the head labels print in the ink of the text. The
     selector is raised like the list above, so a feature table that rules its own cells prints the same rule; the data
     table repeats it in components.css, after its own rules. */
  html:root :is(th, td) { border: var(--border-w) solid var(--ink-3); }
  thead { display: table-header-group; }
  thead th { color: var(--ink); }
}
