/* kwatch dashboard: text size and high contrast, from View options.
   look.js sets data-text and data-contrast on <html> before the page
   draws. Every font size is in rem, so the root size scales the text
   and what is sized around it. The high-contrast colors pass WCAG AA
   (most pass AAA): text at least 7:1 on the page and the surfaces,
   borders at least 5:1. */
html { font-size: 100%; }
html[data-text="s"] { font-size: 87.5%; --text-scale: .875; }
html[data-text="l"] { font-size: 112.5%; --text-scale: 1.125; }
html[data-text="xl"] { font-size: 125%; --text-scale: 1.25; }

:root[data-contrast="more"] {
  --text: #0E1116; --text-muted: #2A2F38; --text-soft: #1F242C;
  --line: #5B6270; --control-border: #0E1116;
  --failing: #8F1C13; --degraded: #6B4100; --resolved: #164A9A; --success: #165A30;
  --ink-muted: #C3C7CE; --focus-width: 4px;
}
@media (prefers-color-scheme: dark) {
  :root[data-contrast="more"] {
    --bg: #0B0C0E; --surface: #17191D;
    --text: #FFFFFF; --text-muted: #DADDE2; --text-soft: #E8EAED;
    --line: #8A919C; --control-border: #C3C7CE;
    --failing: #FFB4A9; --degraded: #FFD27F; --resolved: #B5D1FF; --success: #A6EBBA;
    --failing-bg: #3A1F1E; --degraded-bg: #3A2C14; --resolved-bg: #1B2A44;
  }
}
/* No faded text: what is dimmed elsewhere stays readable. */
:root[data-contrast="more"] .muted,
:root[data-contrast="more"] .fchip.is-zero:not([aria-pressed="true"]) { color: var(--text-soft); }
:root[data-contrast="more"] .tablewrap.loading,
:root[data-contrast="more"] .itable.stale,
:root[data-contrast="more"] .it-row.is-gone td { opacity: .75; }
:root[data-contrast="more"] a, :root[data-contrast="more"] .link { text-decoration-thickness: 2px; }
:root[data-contrast="more"] .chip { border-color: currentColor; }
:root[data-contrast="more"] :focus-visible { outline-color: var(--text); box-shadow: 0 0 0 calc(var(--focus-width) + 2px) var(--bg); }
:root[data-contrast="more"].kw-stale .itable, :root[data-contrast="more"].kw-stale .detail,
:root[data-contrast="more"].kw-stale .updated { opacity: 1; }
/* Touch screens: every control is at least 44px tall. */
@media (pointer: coarse) {
  .tz-b, .fchip, .pager .btn, .ttools .btn, .updated .upd-try, .who .link, .dd-opt,
  .stsw .stsw-b, .qv, .ttools .vopts > summary, .side-top .who-b, .offline .btn,
  .incnav .btn, .shint > summary, .shint .shint-more, .badreq .btn { min-height: 44px; }
  .legend > summary { width: 44px; height: 44px; }
  .pager .btn { min-width: 44px; }
  .brand, .btn, .btn-sm, details > summary, .back a, .link, .fpill, .fpill-clear,
  .dd-btn, .vopts-pop .dd-btn, .pager .dd-btn, .pager-size .dd-btn,
  .lg-ctl .dd-btn, .d-ctx-b, .in-link, .tr-link {
    min-height: 44px;
  }
  .brand, .btn, .btn-sm, .back a { min-width: 44px; }
  .brand, .back a, .link, .in-link, .tr-link { display: inline-flex; align-items: center; }
  /* A checkbox keeps its size; the label around it is the hit area. */
  .cols-c { min-height: 44px; padding: 0 6px; }
  .cols-mv { width: 44px; height: 44px; }
}
/* Touch screens, the rest: controls that set a smaller size of their
   own still get a 44px hit area (!important wins over each one's own
   size). A bar or a dot keeps its look: the extra room is transparent
   padding around it. */
@media (pointer: coarse) {
  html .btn, html .btn-sm, html .copy-ico, html .cmd .btn,
  html .tz-b, html .link, html .brand, html .ds-raw-t,
  html details > summary, html .vo-colsnote .link { min-height: 44px !important; }
  html .btn, html .btn-sm, html .tz-b, html .copy-ico { min-width: 44px !important; }
  html .link { display: inline-flex; align-items: center; }
  html .ds-raw-t, html details > summary { align-content: center; }
  /* Links inside a sentence: inline padding widens the hit area
     without moving the lines. */
  html a.ulink { padding-block: 12px; }
  html .ds-more a.ulink { display: inline-flex; align-items: center; min-height: 44px; padding-block: 0; }
  html .viz-track:has(a.viz-seg) { overflow: visible; }
  html a.viz-seg { box-sizing: content-box; padding: 17px 0; margin: -17px 0; background-clip: content-box; }
  html .viz-dot { box-sizing: content-box; width: 18px; height: 18px; padding: 13px; margin-left: -22px; bottom: -22px; border: 0; background-clip: content-box; }
}
/* A wide touch screen shows the table: each title link is a full
   44px row (a phone card is one big link already). */
@media (pointer: coarse) and (min-width: 701px) {
  html .itable td.c-title .it-link { min-height: 44px; }
}
