/* P29 A: the token classes (docs/DESIGN.md). The screens that still had Tailwind colours written by hand (team, settings, catalog, customers, financial, the windows of app.html,
   the job tabs Contract, Changes and Billing, the public pages) use these instead: every colour is a variable of static/css/tokens.css, in both themes.
   tools/p29_tokenize.py turned the old classes into these (the table is at the top of it). Loaded after tw-app.css and ds.css, before reading.css. */

/* surfaces and lines */
html .tk-surface { background-color: var(--t-surface); }
html .tk-surface-2 { background-color: var(--t-surface-2); }
html .tk-overlay { background-color: var(--t-overlay); }
html .tk-line { border-color: var(--t-line); }
html .tk-line-strong { border-color: var(--t-line-strong); }
html .tk-border-surface { border-color: var(--t-surface); }
html .tk-divide > * + * { border-color: var(--t-line); }
html .tk-ring { --tw-ring-color: var(--t-line); }
html .tk-ring-strong { --tw-ring-color: var(--t-line-strong); }

/* text: main, secondary, label (the label is the secondary colour in the dark theme, where the cards are see-through: docs/DESIGN.md, reading.css) */
html .tk-text { color: var(--t-text); }
html .tk-text-2 { color: var(--t-text-2); }
html .tk-label { color: var(--t-label); }
html.dark .tk-label { color: var(--t-text-2); }
html .tk-accent-text { color: var(--t-accent); }
html .tk-ok-text { color: var(--t-ok); }
html .tk-warn-text { color: var(--t-warn); }
html .tk-bad-text { color: var(--t-bad); }

/* the solid buttons and their text */
html .tk-accent { background-color: var(--t-accent); color: var(--t-on-accent); }
html .tk-ok { background-color: var(--t-ok); color: var(--t-on-ok); }
html .tk-bad { background-color: var(--t-bad); color: var(--t-on-bad); }
html .tk-warn { background-color: var(--t-warn); color: var(--t-surface); }
html .tk-inverse { background-color: var(--t-text); color: var(--t-surface); }
html :is(.tk-accent, .tk-ok, .tk-bad, .tk-warn, .tk-inverse):not(:disabled):hover { filter: brightness(.92); }
html.dark :is(.tk-accent, .tk-ok, .tk-bad, .tk-warn, .tk-inverse):not(:disabled):hover { filter: brightness(1.08); }
html .tk-border-accent { border-color: var(--t-accent); }
html .tk-border-ok { border-color: var(--t-ok); }
html .tk-border-warn { border-color: var(--t-warn); }
html .tk-ring-ok { --tw-ring-color: var(--t-ok); }

/* the soft boxes (notices): the state's background with the state's text (DESIGN.md "Avisos") */
html .tk-accent-soft { background-color: var(--t-accent-soft); }
html .tk-ok-soft { background-color: var(--t-ok-bg); }
html .tk-warn-soft { background-color: var(--t-warn-bg); }
html .tk-bad-soft { background-color: var(--t-bad-bg); }

/* hover and focus */
html .tk-hover:hover { background-color: var(--t-surface-2); }
html .tk-hover-accent:hover { background-color: var(--t-accent-soft); }
html .tk-hover-ok:hover { background-color: var(--t-ok-bg); }
html .tk-hover-text:hover { color: var(--t-text); }
html .tk-hover-border:hover { border-color: var(--t-accent); }
html .tk-focus:focus, html body .tk-focus:focus-visible { border-color: var(--t-accent); --tw-ring-color: color-mix(in srgb, var(--t-accent) 30%, transparent); }
html .tk-ring-accent { --tw-ring-color: var(--t-accent); }
html .tk-border-bad { border-color: var(--t-bad); }
html .tk-hover-bad:hover { background-color: var(--t-bad-bg); }
html .tk-hover-bad-text:hover { color: var(--t-bad); }
html .tk-ring-text { --tw-ring-color: var(--t-text); }
html .tk-hover-accent-text:hover { color: var(--t-accent); }

/* the fields of every converted page (theme.css drew them with its own hex in the dark theme): the field's pair of tokens; a field that is see-through on purpose stays so */
html body :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not(.bg-transparent) { background-color: var(--t-surface); border-color: var(--t-line-strong); color: var(--t-text); }
html body :is(input, select, textarea).bg-transparent:not([type=checkbox]):not([type=radio]) { background-color: transparent; color: var(--t-text); }
/* a button or link drawn with a bare "border" (no colour of its own): the border of buttons (DESIGN.md: --t-line-strong) */
html body :is(button, a).border:not([class*="tk-line"]):not([class*="tk-border"]) { border-color: var(--t-line-strong); }
