/* Copyright (c) 2026 Tech Talker 360. All rights reserved. For use on tools.techtalker360.com only. Terms: https://tools.techtalker360.com/terms */
/*
 * Shared base stylesheet for Tech Talker 360 tools.
 *
 * Injected on every tool page by bootstrap_app.php just before </head> (after
 * each tool's own assets/style.css), so on a specificity tie its rules win by
 * load order. It is the single source of truth for the whole collection's
 * colors (the Console theme tokens) and typography: ONE token per element
 * type, defined once here, used by every app.
 *
 * To resize a tag across EVERY app, change its token below. A single tool
 * adjusts one tag only by overriding it with a more specific class of its own.
 * All sizes are rem, so they track the root and the display-size control.
 * Inline tags inherit (1em) so nested text keeps its context size.
 */

/*
 * Root size: one rule, with no breakpoint steps (uiux typography.md "Size the
 * interface in rem so the browser text setting scales it"). 1rem is 10px at
 * the default browser text size, times the display-size scale. A layout that
 * does not fit a narrow window reflows; the root never shrinks.
 *
 * Tool stylesheets keep only the same base rule, with no breakpoint steps;
 * this one loads after them, so a tool can never shrink the root.
 *
 * The scale has a new name, --tt360UiScale, and keeps its old one,
 * --tt360-ui-scale, until every tool reads the new one. The display-size
 * scripts set both on <html>.
 */
html {
    font-size: calc(62.5% * var(--tt360UiScale, var(--tt360-ui-scale, 1)));
}

/*
 * Console theme tokens, from the themes skill (themes/console/tokens.css).
 *
 * Every rem value here is Console's value x 1.6, because this repository's
 * root is 62.5% (1rem = 10px) while Console writes rem as px / 16. The px
 * parts of the shadows stay px.
 *
 * How the theme is chosen: the head script that bootstrap_app.php injects
 * sets data-theme ("light" or "dark") and color-scheme on <html> before
 * paint, from the dock's Theme control (System, Light or Dark, saved under
 * localStorage "tt360ThemeOverride") or from prefers-color-scheme. Without
 * JavaScript and with no data-theme, the system setting still applies
 * through the media query block below, and light is the final fallback.
 *
 * The selectors are [data-theme="..."] (0,1,0) on purpose: tools declare
 * their own palettes under the same selectors, and this file loads after
 * them, so these values win.
 */

/* Light mode: the fallback on :root, and the explicit data-theme="light". */
:root,
[data-theme="light"] {
    color-scheme: light;
    --page: #edeff3;
    --sunken: #f6f7f9;
    --raised: #ffffff;
    --overlay: #ffffff;
    --border-subtle: #dcdee2;
    --border-control: #7c7f85;
    --text-primary: #13161e;
    --text-secondary: #44484f;
    --text-muted: #61646b;
    --text-disabled: #898c92;
    --accent-text: #005422;
    --accent-ring: #007432;
    --accent-soft: #def0e6;
    --accent-solid: #25d366;
    --accent-solid-hover: #3ce073;
    --accent-on-solid: #0c0f17;
    --success-text: #005325;
    --success-soft: #e4f0e8;
    --success-solid: #2b8449;
    --success-on-solid: #ffffff;
    --warning-text: #654100;
    --warning-soft: #f2ebde;
    --warning-solid: #ad7300;
    --warning-on-solid: #0c0f17;
    --danger-text: #8b1d22;
    --danger-soft: #f7e6e6;
    --danger-solid: #c94545;
    --danger-solid-hover: #b93a3b;
    --danger-on-solid: #ffffff;
    --info-text: #004f63;
    --info-soft: #deeff3;
    --info-solid: #007e9c;
    --info-on-solid: #ffffff;
    --shadow-1: 0 1px 2px rgb(19 22 30 / 0.08), 0 0.8rem 2.4rem -0.8rem rgb(19 22 30 / 0.14);
    --shadow-2: 0 2px 4px rgb(19 22 30 / 0.07), 0 1.6rem 3.2rem -0.8rem rgb(19 22 30 / 0.11);
    --shadow-3: 0 4px 8px rgb(19 22 30 / 0.06), 0 2.8rem 5.6rem -1.6rem rgb(19 22 30 / 0.09);
    /* Console's optional effect values: hover and pressed surfaces, the lit
       top edge of dark layers, and the modal backdrop. */
    --surface-hover: #f1f2f6;
    --surface-active: #e3e4e8;
    --hairline: inset 0 0 0 transparent;
    --backdrop: rgb(19 22 30 / 0.44);
}

/* Dark mode, explicit. */
[data-theme="dark"] {
    color-scheme: dark;
    --page: #0b0d12;
    --sunken: #141821;
    --raised: #1b1f29;
    --overlay: #272c38;
    --border-subtle: #2a2f3b;
    --border-control: #82858b;
    --text-primary: #eff0f3;
    --text-secondary: #c9cacf;
    --text-muted: #a2a4aa;
    --text-disabled: #75787f;
    --accent-text: #71e18d;
    --accent-ring: #2abb5c;
    --accent-soft: #19342d;
    --accent-solid: #25d366;
    --accent-solid-hover: #3ce073;
    --accent-on-solid: #0c0f17;
    --success-text: #91dba3;
    --success-soft: #21342f;
    --success-solid: #2b8449;
    --success-on-solid: #ffffff;
    --warning-text: #fdc16e;
    --warning-soft: #352e22;
    --warning-solid: #ad7300;
    --warning-on-solid: #0c0f17;
    --danger-text: #ffbab5;
    --danger-soft: #3c272d;
    --danger-solid: #c94545;
    --danger-solid-hover: #b93a3b;
    --danger-on-solid: #ffffff;
    --info-text: #70d8fa;
    --info-soft: #19323e;
    --info-solid: #007e9c;
    --info-on-solid: #ffffff;
    --shadow-1: 0 1px 2px rgb(3 5 10 / 0.5), 0 1.2rem 2.8rem -1.2rem rgb(3 5 10 / 0.65);
    --shadow-2: 0 2px 6px rgb(3 5 10 / 0.45), 0 2rem 4rem -1.2rem rgb(3 5 10 / 0.6);
    --shadow-3: 0 4px 12px rgb(3 5 10 / 0.4), 0 3.2rem 6.4rem -1.6rem rgb(3 5 10 / 0.55);
    --surface-hover: #232833;
    --surface-active: #2e3441;
    --hairline: inset 0 1px 0 rgb(255 255 255 / 0.09);
    --backdrop: rgb(5 7 15 / 0.68);
}

/* Dark mode when the system asks for it and no data-theme is set. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --page: #0b0d12;
        --sunken: #141821;
        --raised: #1b1f29;
        --overlay: #272c38;
        --border-subtle: #2a2f3b;
        --border-control: #82858b;
        --text-primary: #eff0f3;
        --text-secondary: #c9cacf;
        --text-muted: #a2a4aa;
        --text-disabled: #75787f;
        --accent-text: #71e18d;
        --accent-ring: #2abb5c;
        --accent-soft: #19342d;
        --accent-solid: #25d366;
        --accent-solid-hover: #3ce073;
        --accent-on-solid: #0c0f17;
        --success-text: #91dba3;
        --success-soft: #21342f;
        --success-solid: #2b8449;
        --success-on-solid: #ffffff;
        --warning-text: #fdc16e;
        --warning-soft: #352e22;
        --warning-solid: #ad7300;
        --warning-on-solid: #0c0f17;
        --danger-text: #ffbab5;
        --danger-soft: #3c272d;
        --danger-solid: #c94545;
        --danger-solid-hover: #b93a3b;
        --danger-on-solid: #ffffff;
        --info-text: #70d8fa;
        --info-soft: #19323e;
        --info-solid: #007e9c;
        --info-on-solid: #ffffff;
        --shadow-1: 0 1px 2px rgb(3 5 10 / 0.5), 0 1.2rem 2.8rem -1.2rem rgb(3 5 10 / 0.65);
        --shadow-2: 0 2px 6px rgb(3 5 10 / 0.45), 0 2rem 4rem -1.2rem rgb(3 5 10 / 0.6);
        --shadow-3: 0 4px 12px rgb(3 5 10 / 0.4), 0 3.2rem 6.4rem -1.6rem rgb(3 5 10 / 0.55);
        --surface-hover: #232833;
        --surface-active: #2e3441;
        --hairline: inset 0 1px 0 rgb(255 255 255 / 0.09);
        --backdrop: rgb(5 7 15 / 0.68);
    }
}

/*
 * The repository's own token names, mapped to the Console roles so existing
 * tool CSS keeps working. They
 * reference the Console tokens, so they follow the mode on their own. The
 * selector list matches the tools' palette selectors, so this mapping wins.
 * --bg has a new name, --background, and keeps the old one, pointed at it,
 * until every tool reads the new one.
 */
:root,
[data-theme="light"],
[data-theme="dark"] {
    --background: var(--page);
    --bg: var(--background);
    --card: var(--raised);
    --surface: var(--sunken);
    --text: var(--text-primary);
    --muted: var(--text-muted);
    --border: var(--border-subtle);
    --accent: var(--accent-solid);
    --hover: var(--accent-solid-hover);
    --disabled: var(--text-disabled);
    --danger: var(--danger-text);
    --shadow: var(--shadow-1);
    --soft: var(--accent-soft);
}

/* Sizes, fonts and radii: the same in both modes (Console x 1.6). */
:root {
    --radius-sm: 0.4rem;
    --radius-md: 0.8rem;
    --radius-lg: 1.4rem;
    --radius-xl: 1.8rem;
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/*
 * Motion tokens (uiux motion.md "Motion tokens: a few shared durations and
 * easings"). Every transition in the shared assets takes its duration and
 * curve from these, and so should every tool.
 *
 * - Fast: presses, color changes, small toggles, and the exit of a popover.
 * - Base: hovers, tooltips, menus and popovers entering; dialog and toast exits.
 * - Slow: sheets, dialogs and toasts entering, and the theme cross-fade.
 * - Ease out: entrances, hovers, anything answering the user.
 * - Ease in: exits, a little shorter than their entrance.
 * - Ease in out: ambient loops and the theme cross-fade.
 *
 * assets/tool-nav.js and assets/pwa.js read --tt360DurationBase and
 * --tt360DurationSlow at run time for their hide and fade timers, so a change
 * here keeps them in step.
 */
:root {
    --tt360DurationFast: 120ms;
    --tt360DurationBase: 200ms;
    --tt360DurationSlow: 280ms;
    --tt360EaseOut: cubic-bezier(0.22, 1, 0.36, 1);
    --tt360EaseIn: cubic-bezier(0.55, 0, 1, 0.45);
    --tt360EaseInOut: cubic-bezier(0.45, 0, 0.55, 1);

    /* The one focus ring: 2px, offset 2px, drawn with outline so it survives
       forced colors (uiux accessibility.md "Focus rings drawn with outline
       survive forced colors"). Its color is set per mode below. */
    --tt360FocusRingWidth: 2px;
    --tt360FocusRingOffset: 2px;
}

/*
 * State colors that follow the mode. They reference the Console tokens, and
 * the selector list matches the mode selectors, so they resolve on whichever
 * element carries data-theme.
 *
 * - Focus ring: --accent-ring, at 3:1 or more on every Console surface.
 * - Scrollbar thumb: --border-control, the 3:1 control border, on a
 *   transparent track, so the thumb reads against the surface it sits on
 *   (uiux layout-spacing.md "Keep scrollbars visible on scroll areas").
 */
:root,
[data-theme="light"],
[data-theme="dark"] {
    --tt360FocusRingColor: var(--accent-ring);
    --tt360ScrollbarThumb: var(--border-control);
    --tt360ScrollbarTrack: transparent;
}

/* Console's system stack for all UI text. Equal specificity with each
   tool's own body rule, and this file loads last, so it wins. */
body {
    font-family: var(--font-sans);
}

/*
 * Theme cross-fade. assets/tool-nav.js sets data-tt360-theme-fade on <html>
 * only while the user switches the theme, so a restored theme never animates
 * on load, and removes it once --tt360DurationSlow has passed. Colors fade;
 * nothing moves, so the fade stays under reduced motion: these selectors are
 * more specific than the reduced-motion block's universal rule (uiux
 * motion.md, "One reduced-motion block covers transitions too").
 */
html[data-tt360-theme-fade],
html[data-tt360-theme-fade] *,
html[data-tt360-theme-fade] *::before,
html[data-tt360-theme-fade] *::after {
    transition-property: background-color, color, border-color, outline-color, fill, stroke, box-shadow !important;
    transition-duration: var(--tt360DurationSlow) !important;
    transition-timing-function: var(--tt360EaseInOut) !important;
    transition-delay: 0s !important;
}

:root {
    /* Display-size control (set on <html> by the dock's Aa control). */
    --tt360UiScale: 1;

    /* Editor surfaces (elements carrying .tt360_editor or .tt360Editor).
       --tt360EditorScale amplifies the display-size control's effect on
       editors only, and the editor rule keeps the result at 12px or more. */
    --tt360Editor: 1.6rem;
    --tt360EditorScale: 2.5;

    /* Headings */
    --tt360H1: 1.8rem;
    --tt360H2: 1.45rem;
    --tt360H3: 1.3rem;
    --tt360H4: 1.25rem;
    --tt360H5: 1.2rem;
    --tt360H6: 1.15rem;

    /* Block & flow text */
    --tt360P: 1.3rem;
    --tt360Li: 1.3rem;
    --tt360Blockquote: 1.3rem;
    --tt360Dt: 1.3rem;
    --tt360Dd: 1.3rem;
    --tt360Address: 1.3rem;
    --tt360Summary: 1.3rem;
    --tt360Legend: 1.3rem;
    --tt360Figcaption: 1.2rem;
    --tt360Caption: 1.2rem;
    --tt360Small: 1.2rem;
    --tt360Pre: 1.2rem;

    /* Table cells */
    --tt360Th: 1.2rem;
    --tt360Td: 1.2rem;

    /* Inline tags: 1em = keep the inherited size (a <span> inside an <h1> must
       stay h1-sized). Raise only if every inline element should grow. */
    --tt360Inline: 1em;

    /* Form controls */
    --tt360Button: 1.4rem;
    --tt360Input: 1.4rem;
    --tt360Textarea: 1.4rem;
    --tt360Select: 1.4rem;
    --tt360Option: 1.4rem;
    --tt360Label: 1.3rem;
}

/*
 * The old token names, kept until every tool reads the new ones. Each one
 * points at its new name on :root, so it resolves there to the same value,
 * the touch raise below included, and the tools that still read it get the
 * same sizes. The rules in this file read the new names.
 */
:root {
    --tt360-ui-scale: var(--tt360UiScale);
    --tt360-editor: var(--tt360Editor);
    --tt360-editor-scale: var(--tt360EditorScale);
    --tt360-h1: var(--tt360H1);
    --tt360-h2: var(--tt360H2);
    --tt360-h3: var(--tt360H3);
    --tt360-h4: var(--tt360H4);
    --tt360-h5: var(--tt360H5);
    --tt360-h6: var(--tt360H6);
    --tt360-p: var(--tt360P);
    --tt360-li: var(--tt360Li);
    --tt360-blockquote: var(--tt360Blockquote);
    --tt360-dt: var(--tt360Dt);
    --tt360-dd: var(--tt360Dd);
    --tt360-address: var(--tt360Address);
    --tt360-summary: var(--tt360Summary);
    --tt360-legend: var(--tt360Legend);
    --tt360-figcaption: var(--tt360Figcaption);
    --tt360-caption: var(--tt360Caption);
    --tt360-small: var(--tt360Small);
    --tt360-pre: var(--tt360Pre);
    --tt360-th: var(--tt360Th);
    --tt360-td: var(--tt360Td);
    --tt360-inline: var(--tt360Inline);
    --tt360-button: var(--tt360Button);
    --tt360-input: var(--tt360Input);
    --tt360-textarea: var(--tt360Textarea);
    --tt360-select: var(--tt360Select);
    --tt360-option: var(--tt360Option);
    --tt360-label: var(--tt360Label);
}

/*
 * Touch screens: fields and body text at 1.6rem (16px at 100%). A phone
 * zooms the page into any field whose text is under 16px (mobile-native
 * "Page zooms into the input"), and body text is at least 1.6rem wherever
 * touch is possible. The element rules
 * below read these tokens and win over a tool's own sizes of equal
 * specificity, so the raise lives here. Every other token keeps its value.
 * The old names follow, since they point at these on :root.
 */
@media (pointer: coarse) {
    :root {
        --tt360Input: 1.6rem;
        --tt360Textarea: 1.6rem;
        --tt360Select: 1.6rem;
        --tt360Option: 1.6rem;
        --tt360P: 1.6rem;
        --tt360Li: 1.6rem;
        --tt360Dd: 1.6rem;
        --tt360Blockquote: 1.6rem;
    }
}

/*
 * Editor. The base size is --tt360Editor, and --tt360EditorScale (A)
 * amplifies the display-size control for editors only. The rem root already
 * carries the scale s (--tt360UiScale), so the rule applies only the
 * residual factor A - (A - 1) / s. It is exactly 1 at s = 1, so the default
 * size never moves, and above 100% editors grow A times as fast as the rest.
 *
 * Below 100% the amplified size drops fast (A = 2.5 gives 8px at 80%), so
 * max() keeps it at 12px or more (uiux typography.md "No text below 12px").
 * The floor is 1.2rem divided by s: 1rem already holds s, so the division
 * keeps it at 12px at every display size, while it still grows with the
 * browser's own text setting. A px floor would ignore that setting, and a
 * bare 1.2rem would fall to 9.6px at 80%.
 *
 * Never multiply the base by --tt360UiScale anywhere else.
 *
 * The marker has a new name, .tt360Editor, beside the old .tt360_editor,
 * until every tool carries the new one.
 */
.tt360_editor,
.tt360Editor {
    font-size: max(
        calc(1.2rem / var(--tt360UiScale, var(--tt360-ui-scale, 1))),
        calc(
            var(--tt360Editor, 1em) *
            (
                var(--tt360EditorScale, 1) -
                (var(--tt360EditorScale, 1) - 1) / var(--tt360UiScale, var(--tt360-ui-scale, 1))
            )
        )
    );
}

/*
 * Element typography. Each tag is sized via the bare element AND the shared
 * `.card <tag>` scope: because base.css loads last, `.card h1` (specificity
 * 0,1,1) ties with and beats a tool's own `.card h1`, so every app takes the
 * global token BY DEFAULT. A tool overrides one tag only with a more specific
 * class.
 */
h1, .card h1 { font-size: var(--tt360H1); }
h2, .card h2 { font-size: var(--tt360H2); }
h3, .card h3 { font-size: var(--tt360H3); }
h4, .card h4 { font-size: var(--tt360H4); }
h5, .card h5 { font-size: var(--tt360H5); }
h6, .card h6 { font-size: var(--tt360H6); }

p, .card p { font-size: var(--tt360P); }
li, .card li { font-size: var(--tt360Li); }
blockquote, .card blockquote { font-size: var(--tt360Blockquote); }
dt, .card dt { font-size: var(--tt360Dt); }
dd, .card dd { font-size: var(--tt360Dd); }
address, .card address { font-size: var(--tt360Address); }
summary, .card summary { font-size: var(--tt360Summary); }
legend, .card legend { font-size: var(--tt360Legend); }
figcaption, .card figcaption { font-size: var(--tt360Figcaption); }
caption, .card caption { font-size: var(--tt360Caption); }
small, .card small { font-size: var(--tt360Small); }
pre, .card pre { font-size: var(--tt360Pre); }
th, .card th { font-size: var(--tt360Th); }
td, .card td { font-size: var(--tt360Td); }

/* Inline tags inherit their context (1em) so nested text is never broken. */
span, a, strong, em, b, i, u, s, mark, code, kbd, samp,
abbr, cite, q, sub, sup, time, var, dfn, ins, del {
    font-size: var(--tt360Inline);
}

/*
 * Form controls. The bare element sizes every standard control; the marker
 * classes (and the universal/bespoke button classes a tool's CSS would
 * otherwise outrank) take the same token. Editors keep .tt360_editor, which
 * outranks `textarea` so an editor never picks up the textarea size.
 *
 * Each shared class is listed under its old name and its new one (such as
 * .tt360_button and .tt360Button), until every tool carries the new one.
 *
 * The label size also reaches every class that held "_label" when this rule
 * matched by substring. They are listed one by one now, each with its new
 * name beside it, so a tool that renames one keeps the size. A new name that
 * another tool already gives an element this rule does not reach is left out,
 * since adding it would resize that element: fieldLabel, resultLabel and
 * switchLabel. The tool waves move these elements onto .tt360Label.
 */
button, .tt360_button, .tt360Button { font-size: var(--tt360Button); }
input, .tt360_input, .tt360Input { font-size: var(--tt360Input); }
textarea { font-size: var(--tt360Textarea); }
select, .tt360_select, .tt360Select { font-size: var(--tt360Select); }
option { font-size: var(--tt360Option); }

label,
.tt360_label,
.tt360Label,
:is(
    .collab_share_label, .collaborationShareLabel,
    .control_label, .controlLabel,
    .detail_section_label, .detailSectionLabel,
    .field_label,
    .history_summary_label, .historySummaryLabel,
    .input_label, .inputLabel,
    .key_label, .keyLabel,
    .log_part_label, .logPartLabel,
    .metric_label, .metricLabel,
    .palette_chip_label, .paletteChipLabel,
    .phase_label, .phaseLabel,
    .quick_label, .quickLabel,
    .quran_label_row, .quranLabelRow,
    .quran_text_label, .quranTextLabel,
    .result_label,
    .stat_label, .statisticLabel,
    .status_label, .statusLabel,
    .switch_label,
    .toggle_label, .toggleLabel,
    .url_label, .urlLabel,
    .url_preview_label, .urlPreviewLabel
) {
    font-size: var(--tt360Label);
}

.primary_btn, .primaryButton,
.secondary_btn, .secondaryButton,
.danger_btn, .dangerButton {
    font-size: var(--tt360Button);
}

/*
 * Small helper text. The .tt360_meta marker (new name .tt360Meta) is the
 * explicit hook. This rule once matched classes by word stem ("chip",
 * "hint", "pill", "badge", "caption", "eyebrow", "kicker", "_value" and
 * "_meta"). The lists below name each of those classes, with its new name
 * beside it, so a tool that renames one keeps the size. A new name that
 * another tool already gives an element this rule does not reach is left
 * out, since adding it would resize that element: toggleChip, dropHint,
 * fieldHint and rangeValue. The tool waves move these elements onto
 * .tt360Meta.
 */
.tt360_meta,
.tt360Meta,
.status_box,
.statusBox,
.count_box,
.countBox,
/* chip */
:is(
    .caps_chip, .capsChip,
    .chipFace,
    .chipList,
    .chipMark,
    .helper_chip, .helperChip,
    .info_chip, .informationChip,
    .meta_chip, .metaChip,
    .mod_chip, .modifierChip,
    .mod_chips, .modifierChips,
    .palette_chip, .paletteChip,
    .palette_chip_label, .paletteChipLabel,
    .palette_chip_meta, .paletteChipMeta,
    .palette_chip_swatch, .paletteChipSwatch,
    .palette_chip_value, .paletteChipValue,
    .scenario_chip, .scenarioChip,
    .stat_chip, .statisticChip,
    .status-chip, .statusChip,
    .swatch_chip, .swatchChip,
    .toggle_chip
),
/* hint */
:is(
    .collab_qr_hint, .collaborationQrHint,
    .cycle_hint, .cycleHint,
    .drop_hint,
    .drop_prompt_hint, .dropPromptHint,
    .field_hint,
    .help-hint, .helpHint,
    .metric_hint, .metricHint,
    .panel_hint, .panelHint,
    .tt360_size_panel_hint, .tt360SizePanelHint
),
/* pill */
:is(
    .count_pill, .countPill,
    .stat_pill, .statisticPill
),
/* badge */
:is(
    .badge,
    .badge_group, .badgeGroup,
    .countdown_badge, .countdownBadge,
    .detail_badge, .detailBadge,
    .ep_badge, .endpointBadge,
    .glass_badge, .glassBadge,
    .live_badge, .liveBadge,
    .result_status_badge, .resultStatusBadge,
    .stage_badges, .stageBadges,
    .status_badge, .statusBadge,
    .summary_badge, .summaryBadge
),
/* caption, eyebrow, kicker */
:is(
    .qr_caption, .qrCaption,
    .quick_caption, .quickCaption,
    .eyebrow,
    .section_kicker, .sectionKicker
),
/* _value */
:is(
    .color_value, .colorValue,
    .field_value, .fieldValue,
    .hdr_value, .headerValue,
    .history_summary_value, .historySummaryValue,
    .kv_value, .keyValueValue,
    .metric_value, .metricValue,
    .palette_chip_value, .paletteChipValue,
    .quick_value, .quickValue,
    .quran_feedback_values, .quranFeedbackValues,
    .range_value,
    .result_value, .resultValue,
    .stat_value, .statisticValue,
    .stat_value_text, .statisticValueText,
    .swatch_values, .swatchValues,
    .tt360_size_value, .tt360SizeValue,
    .url_preview_value, .urlPreviewValue
),
/* _meta */
:is(
    .board_meta, .boardMeta,
    .detail_meta_row, .detailMetaRow,
    .ep_meta, .endpointMeta,
    .file_meta, .fileMeta,
    .hero_meta, .heroMeta,
    .history_summary_meta, .historySummaryMeta,
    .palette_chip_meta, .paletteChipMeta,
    .progress_meta, .progressMeta,
    .result_meta, .resultMeta,
    .saved_session_meta, .savedSessionMeta,
    .typing_meta, .typingMeta
) {
    font-size: var(--tt360Small);
}

/*
 * Filled call-to-action buttons and selected segmented states: Console's
 * bright green fill with its dark label (9.66:1). White text on #25d366 is
 * never used (about 2:1). Hover brightens the fill, only where a fine pointer
 * can hover.
 *
 * .inline-btn is not painted here. Tools use it for different things, some
 * for a bare icon button inside a field, where a fill hugs the glyph, so it
 * gets only the neutral :where() floor below that every button gets, and
 * each tool styles its own. A green call to action carries .tt360_btn_solid.
 */
.tt360_btn_solid,
.primary_btn,
.tt360ButtonSolid,
.primaryButton,
:is(.preset_btn, .presetButton):is(.is_active, .isActive),
:is(.mod_chip, .modifierChip):is(.is_active, .isActive) {
    background: var(--accent-solid);
    color: var(--accent-on-solid);
}

/*
 * The selected segmented states also take an --accent-text edge, so the
 * selected option does not rest on the bright fill alone: #25d366 is about
 * 2:1 against a light card, while the light --accent-text is about 9:1
 * against it and 4.6:1 against the fill. In dark mode the fill itself is
 * about 8:1 against the card, and the edge is 10:1 (WCAG 1.4.11, uiux
 * color-contrast.md "Accent tokens per role"). Every tool that uses these
 * classes gives them a 1px border at rest, so only its color changes and the
 * box keeps its size (uiux css-techniques.md "State styles never change an
 * element's size").
 */
:is(.preset_btn, .presetButton):is(.is_active, .isActive),
:is(.mod_chip, .modifierChip):is(.is_active, .isActive) {
    border-color: var(--accent-text);
}

/*
 * Interactive states (uiux motion.md "Interactive by default"): rest,
 * hover, pressed, focus, disabled, and busy where a control runs an action.
 *
 * Precedence: disabled wins, then busy, pressed, focus and hover. Hover and
 * press never apply to a disabled or busy control. Busy is marked with
 * data-loading (or aria-busy="true") beside aria-disabled="true"; a busy
 * control keeps its look and stays focusable (uiux accessibility.md "Busy
 * buttons keep their variant's look", "Loading buttons keep focus"). Hover
 * lives only behind the fine-pointer gate. No state changes font-weight.
 *
 * Two layers:
 * 1. The shared button classes this file paints (.primary_btn,
 *    .tt360_btn_solid, .secondary_btn, .danger_btn) carry their states at
 *    class specificity, so they win a tie with a tool's own rules by load
 *    order. A tool changes one of them only with a more specific selector.
 * 2. Bare elements and the marker classes (.tt360_button, .tt360_input,
 *    .tt360_select) get a floor inside :where(), at specificity 0. Any rule a
 *    tool writes for the same property wins, so a tool's own look and states
 *    keep working, and a control the tool never styled still gets every state.
 *    The one exception is the focus ring and the press on the marker classes,
 *    which sit at class specificity: they never fight a tool's look.
 *
 * Every class here is named under its old name and its new one
 * (.primary_btn and .primaryButton, .tt360_btn_solid and .tt360ButtonSolid,
 * .secondary_btn and .secondaryButton, .danger_btn and .dangerButton,
 * .tt360_button, .tt360_input and .tt360_select and their camelCase names),
 * at the same specificity, until every tool carries the new names.
 */

/* Transitions: named properties only, never "all". */
:where(button, input, select, textarea, summary, a[href], .tt360_button, .tt360Button, .tt360_input, .tt360Input, .tt360_select, .tt360Select) {
    transition:
        background-color var(--tt360DurationBase) var(--tt360EaseOut),
        border-color var(--tt360DurationBase) var(--tt360EaseOut),
        color var(--tt360DurationBase) var(--tt360EaseOut),
        box-shadow var(--tt360DurationBase) var(--tt360EaseOut),
        scale var(--tt360DurationFast) var(--tt360EaseOut);
}

/* The shared classes also keep the transform a tool may lift them with. */
.primary_btn, .primaryButton,
.tt360_btn_solid, .tt360ButtonSolid,
.secondary_btn, .secondaryButton,
.danger_btn, .dangerButton {
    transition:
        background-color var(--tt360DurationBase) var(--tt360EaseOut),
        border-color var(--tt360DurationBase) var(--tt360EaseOut),
        color var(--tt360DurationBase) var(--tt360EaseOut),
        box-shadow var(--tt360DurationBase) var(--tt360EaseOut),
        transform var(--tt360DurationBase) var(--tt360EaseOut),
        translate var(--tt360DurationBase) var(--tt360EaseOut),
        scale var(--tt360DurationFast) var(--tt360EaseOut);
}

/* Hover, only where a fine pointer can hover. */
@media (hover: hover) and (pointer: fine) {
    :is(.tt360_btn_solid, .tt360ButtonSolid):not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):hover,
    :is(.primary_btn, .primaryButton):not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):hover {
        background: var(--accent-solid-hover);
        color: var(--accent-on-solid);
    }

    /* The outline button's hover: the accent tint (uiux variants.md "Button",
       secondary outline). */
    :is(.secondary_btn, .secondaryButton):not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):hover {
        border-color: var(--accent-ring);
        background: var(--accent-soft);
        color: var(--accent-text);
    }

    :is(.danger_btn, .dangerButton):not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):hover {
        border-color: var(--danger-text);
        background: var(--danger-soft);
        color: var(--danger-text);
    }

    /* Floor for buttons a tool never styled. */
    :where(button, input[type="button"], input[type="submit"], input[type="reset"], .tt360_button, .tt360Button):where(:not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):hover) {
        background-color: var(--surface-hover);
    }

    /* Fields: the border steps up from --border-control to --text-secondary.
       Two layers, like the buttons. The :where() floor, at specificity 0,
       covers a field no tool styled. Most tools give their fields a border
       of their own, which outranks that floor, so fields in the tool card
       (.card input, select and textarea, at 0,1,1) and the marker classes
       (at 0,1,0) get the hover again. That ties with a typical tool border
       rule such as input[type="text"], .card input or .toolInput, and wins
       by load order; a tool's own, more specific hover still wins. Every
       condition sits inside :where(), so it adds no specificity. There is no
       hover on a disabled, read-only, busy, invalid or focused field, so an
       error keeps its danger border and focus keeps its own look. Only
       border-color changes. */
    :where(input:not([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="image"]), select, textarea, .tt360_input, .tt360Input, .tt360_select, .tt360Select):where(:not(:disabled, [aria-disabled="true"], [readonly], [aria-readonly="true"], [aria-busy="true"], [data-loading], [aria-invalid="true"], :focus):hover),
    .card input:where(:not([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="image"])):where(:not(:disabled, [aria-disabled="true"], [readonly], [aria-readonly="true"], [aria-busy="true"], [data-loading], [aria-invalid="true"], :focus):hover),
    .card select:where(:not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading], [aria-invalid="true"], :focus):hover),
    .card textarea:where(:not(:disabled, [aria-disabled="true"], [readonly], [aria-readonly="true"], [aria-busy="true"], [data-loading], [aria-invalid="true"], :focus):hover),
    :is(.tt360_input, .tt360Input):where(:not(:disabled, [aria-disabled="true"], [readonly], [aria-readonly="true"], [aria-busy="true"], [data-loading], [aria-invalid="true"], :focus):hover),
    :is(.tt360_select, .tt360Select):where(:not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading], [aria-invalid="true"], :focus):hover) {
        border-color: var(--text-secondary);
    }
}

/* Pressed: never gated. The individual scale property composes with any
   transform a tool positions the button with (uiux css-techniques.md
   "Animated transforms never replace a positioning transform"). */
:is(.tt360_btn_solid, .tt360ButtonSolid):not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):active,
:is(.primary_btn, .primaryButton):not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):active,
:is(.secondary_btn, .secondaryButton):not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):active,
:is(.danger_btn, .dangerButton):not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):active,
:is(.tt360_button, .tt360Button):not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):active {
    scale: 0.97;
}

:where(button, input[type="button"], input[type="submit"], input[type="reset"]):where(:not(:disabled, [aria-disabled="true"], [aria-busy="true"], [data-loading]):active) {
    scale: 0.97;
}

/* Focus: the one shared ring. It shows on aria-disabled and busy controls
   too, which stay focusable, and looks different from a selected state,
   which is a fill or a tint (uiux accessibility.md "Focus looks different
   from selected"). */
:is(.tt360_btn_solid, .tt360ButtonSolid):focus-visible,
:is(.primary_btn, .primaryButton):focus-visible,
:is(.secondary_btn, .secondaryButton):focus-visible,
:is(.danger_btn, .dangerButton):focus-visible,
:is(.tt360_button, .tt360Button):focus-visible,
:is(.tt360_input, .tt360Input):focus-visible,
:is(.tt360_select, .tt360Select):focus-visible {
    outline: var(--tt360FocusRingWidth) solid var(--tt360FocusRingColor);
    outline-offset: var(--tt360FocusRingOffset);
}

:where(button, input, select, textarea, summary, a[href], [tabindex]:not([tabindex="-1"]), [contenteditable]:not([contenteditable="false"])):where(:focus-visible) {
    outline: var(--tt360FocusRingWidth) solid var(--tt360FocusRingColor);
    outline-offset: var(--tt360FocusRingOffset);
}

/* Disabled: its own tokens, never opacity (uiux forms-inputs.md "Disabled
   fields use their own tokens, not opacity"). A busy control is excluded,
   so it keeps its look. */
:is(.tt360_btn_solid, .tt360ButtonSolid):is(:disabled, [aria-disabled="true"]):not([aria-busy="true"], [data-loading]),
:is(.primary_btn, .primaryButton):is(:disabled, [aria-disabled="true"]):not([aria-busy="true"], [data-loading]),
:is(.secondary_btn, .secondaryButton):is(:disabled, [aria-disabled="true"]):not([aria-busy="true"], [data-loading]),
:is(.danger_btn, .dangerButton):is(:disabled, [aria-disabled="true"]):not([aria-busy="true"], [data-loading]) {
    border-color: var(--border-subtle);
    background: var(--sunken);
    color: var(--text-disabled);
    box-shadow: none;
    cursor: not-allowed;
}

:where(button, input, select, textarea, .tt360_button, .tt360Button, .tt360_input, .tt360Input, .tt360_select, .tt360Select):where(:is(:disabled, [aria-disabled="true"]):not([aria-busy="true"], [data-loading])) {
    color: var(--text-disabled);
    cursor: not-allowed;
}

:where(input:not([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="image"]), select, textarea, .tt360_input, .tt360Input, .tt360_select, .tt360Select):where(:disabled, [aria-disabled="true"]) {
    border-color: var(--border-subtle);
    background-color: var(--sunken);
}

/* Busy: the variant's own look, with the progress cursor. */
:is(.tt360_btn_solid, .tt360ButtonSolid):is([aria-busy="true"], [data-loading]),
:is(.primary_btn, .primaryButton):is([aria-busy="true"], [data-loading]),
:is(.secondary_btn, .secondaryButton):is([aria-busy="true"], [data-loading]),
:is(.danger_btn, .dangerButton):is([aria-busy="true"], [data-loading]) {
    cursor: progress;
}

:where(button, input, .tt360_button, .tt360Button):where([aria-busy="true"], [data-loading]) {
    cursor: progress;
}

/*
 * Labels of the shared buttons (uiux components.md "Buttons, badges and
 * tabs size to a one-line label", and its exception for a label wider than
 * its whole row). A button never grows past its row: a label that does not
 * fit wraps inside the button, between words, centered. Only the wrapping
 * wins over a tool's own rule (a nowrap); the width cap, the alignment and
 * the word breaking sit in :where(), so a tool that set its own keeps it.
 * The break is "break-word", never "anywhere": "anywhere" lowers the
 * button's smallest width, so a flex row shrinks it and splits ordinary
 * words one or two letters a line instead of wrapping the row.
 */
.primary_btn, .primaryButton,
.secondary_btn, .secondaryButton,
.danger_btn, .dangerButton {
    white-space: normal;
}

:where(.primary_btn, .primaryButton, .secondary_btn, .secondaryButton, .danger_btn, .dangerButton) {
    max-inline-size: 100%;
    text-align: center;
    overflow-wrap: break-word;
}

/*
 * A shared button that holds an icon wraps its content, so when the label
 * does not fit on one line beside the icon, the icon goes on a line of its
 * own above the label, each line centered by the button's own
 * justify-content. Without it, the icon, the gap and the label's longest
 * word stay on one line, wider than the button, and the centered content
 * spills past both of its edges
 * ("break-word" never lowers that width). Inside :where(), so a tool that
 * sets its own flex-wrap keeps it.
 *
 * The wrap also lowers the button's smallest width to its icon or its
 * longest word, so a tool that sizes its buttons from that width in a
 * wrapping row can fit more of them on a line; such a row sets
 * flex-wrap: nowrap on its buttons, as audiotest's .compact_actions does.
 */
:where(:is(.primary_btn, .primaryButton, .secondary_btn, .secondaryButton, .danger_btn, .dangerButton, .tt360_btn_solid, .tt360ButtonSolid):has(.tt360Icon)) {
    flex-wrap: wrap;
}

/*
 * A row of shared buttons that should stack in a narrow window carries
 * .tt360ButtonRow (the same uiux rule: "on a phone a button may go full
 * width"). Below 36em, which also catches a wider window at a large browser
 * text size, the row wraps and each shared button in it takes the full
 * row. It is opt in: a row that also holds a field, such as a stepper with
 * its input between two buttons, never carries it.
 */
@media (width < 36em) {
    .tt360ButtonRow {
        flex-wrap: wrap;
    }

    .tt360ButtonRow > :is(.primary_btn, .primaryButton, .secondary_btn, .secondaryButton, .danger_btn, .dangerButton) {
        flex: 1 1 100%;
        inline-size: 100%;
    }
}

/*
 * Scroll areas (uiux layout-spacing.md "Keep scrollbars visible on scroll
 * areas" and "Page scroll areas hand off at their end; overlays contain it").
 *
 * .tt360ScrollArea: a vertical scroll area inside the page. It keeps the
 * platform scrollbar, recolored from the tokens, with a stable gutter so the
 * content never shifts when the bar appears, and hands the scroll on to the
 * page at its end.
 * .tt360ScrollAreaContained: add it beside .tt360ScrollArea on the scroller
 * of an overlay (dialog, sheet, drawer, panel), so reaching its end never
 * scrolls the page behind it.
 *
 * A tool that keeps its own scroll class reuses the same three declarations
 * with the tokens.
 */
.tt360ScrollArea {
    overflow-y: auto;
    overscroll-behavior: auto;
    scrollbar-width: auto;
    scrollbar-gutter: stable;
    scrollbar-color: var(--tt360ScrollbarThumb) var(--tt360ScrollbarTrack);
}

.tt360ScrollArea.tt360ScrollAreaContained {
    overscroll-behavior: contain;
}

/*
 * The single card (a .card straight inside body) is the containing block of
 * the absolutely positioned content inside it, such as a visually hidden
 * label. That content then stays inside the card and scrolls with it,
 * instead of being placed against the page, where it can stretch the page's
 * scroll or show outside the card. :where() keeps this at specificity 0, so
 * a tool that positions its card another way keeps its own value.
 */
:where(body > .card) {
    position: relative;
}

/*
 * Visually hidden text: read by screen readers, never drawn (uiux
 * accessibility.md "Struck-through values carry visually hidden words").
 * It is clipped to a 1px box and taken out of the flow; inside the single
 * card, the card is its containing block (above).
 */
.tt360VisuallyHidden {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/*
 * The card header: the icon, then the title and its one line, on the
 * controls' start edge (uiux layout-spacing.md "One shared start edge inside
 * components"). The header carries .tt360CardHeader and its icon .icon. It is
 * a grid with the icon in a column of its own and the rest beside it; the
 * tool keeps its own gaps, alignment and placement inside that grid.
 *
 * The header is its own inline-size container (uiux layout-spacing.md
 * "Fluid first, container queries for components, media queries for the
 * page"). Its children follow its width, so where it is narrower than 20rem
 * (a phone at a large browser text or display size), every child after the
 * icon spans the whole row, under the icon, and the title and the lead take
 * the header's full width instead of a sliver beside the icon. Inside a
 * container query, rem is the root size, which carries both the browser text
 * setting and --tt360UiScale, so the switch moves with the header's own rem
 * content. The header's width comes from the card, never from its content,
 * so the containment changes nothing around it. A title word longer than
 * the whole header (such as "Companion" at 320px with the browser text at
 * 200%) breaks inside the word instead of running past the card; any other
 * word keeps whole.
 */
.tt360CardHeader {
    container: tt360CardHeader / inline-size;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    overflow-wrap: break-word;
}

@container tt360CardHeader (inline-size < 20rem) {
    .tt360CardHeader > :not(.icon) {
        grid-column: 1 / -1;
    }
}

/*
 * Room for the dock's bottom bar (uiux layout-spacing.md "Floating elements
 * each own a place", "Every page reflows at 320px with nothing covered").
 * Under 36em wide or 30em tall the dock is a full-width bar along the bottom
 * edge (assets/tool-nav.css, "The bottom bar"). --tt360DockReserveBlock is
 * declared with the dock's measurements there: the bar's height plus the
 * bottom safe area in bar mode, and 0px otherwise. This media query is the
 * same as the one in tool-nav.css; change the two together.
 *
 * In bar mode:
 * - body's bottom padding is the reserve plus the 1.6rem phone gutter, in
 *   place of a tool's own bottom padding, so a card that fits sits above the
 *   bar;
 * - keyboard focus and anchor jumps stop above the bar (scroll-padding);
 * - a single-card page (a .card straight inside body) keeps a vertical page
 *   scroll even when its tool hides body overflow, so a card taller than the
 *   room left scrolls into view to its end instead of ending under the bar.
 * A tool that caps its card's height subtracts the reserve from the cap:
 * max-block-size: calc(100dvh - <its own block padding> - var(--tt360DockReserveBlock)).
 */
@media (width < 36em), (height < 30em) {
    html {
        scroll-padding-block-end: var(--tt360DockReserveBlock, 0px);
    }

    body {
        padding-block-end: calc(var(--tt360DockReserveBlock, 0px) + 1.6rem);
    }

    body:has(> .card) {
        overflow-y: auto;
    }
}

/*
 * The site footer: the copyright notice and the Terms and Privacy links,
 * written once by renderSiteFooter() in bootstrap_app.php and placed after
 * the page's main block on every page (uiux variants.md "Footer", its
 * defaults: one row that wraps, on the page background with a hairline).
 *
 * On a tool page the body is a grid (or, in one tool, a flex box) that
 * centers the card. The footer adds a second row: the first row takes the
 * free height and still centers the card in it, so a short card stays in
 * the middle and the footer sits at the bottom of the window. A card at its
 * height cap pushes the footer just below the fold, where the page scroll
 * reaches it. :where() keeps the rule at specificity 0, so a page that
 * lays its body out another way (the homepage) sets its own.
 *
 * Where the dock is the floating column, the footer keeps the dock's width
 * clear on both sides, so its centered text never runs under the dock. In
 * the bottom-bar layout the bar owns the bottom edge and base.css already
 * pads the body above it, so no side room is needed.
 */
:where(body:has(> .tt360SiteFooter)) {
    grid-template-rows: 1fr auto;
    row-gap: 2.4rem;
    flex-direction: column;
}

.tt360SiteFooter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem 1.6rem;
    inline-size: 100%;
    padding-block-start: 1.2rem;
    padding-inline: var(--tt360DockReserve, 0px);
    border-block-start: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: var(--tt360Small);
    line-height: 1.5;
    text-align: center;
}

@media (width < 36em), (height < 30em) {
    .tt360SiteFooter {
        padding-inline: 0;
    }
}

.tt360SiteFooter .tt360SiteFooterBrand,
.tt360SiteFooter .tt360SiteFooterNotice {
    margin: 0;
    font-size: inherit;
}

/* The brand line's link sits inside its sentence, so it keeps the text's
   line height; it shares the footer links' color, underline and hover. */
.tt360SiteFooterBrand a {
    color: var(--accent-text);
    font-weight: 600;
    text-decoration-line: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: max(1px, 0.07em);
    transition:
        color var(--tt360DurationFast) var(--tt360EaseOut),
        text-decoration-thickness var(--tt360DurationFast) var(--tt360EaseOut);
}

@media (hover: hover) and (pointer: fine) {
    .tt360SiteFooterBrand a:hover {
        color: color-mix(in oklab, var(--accent-text), var(--text-primary) 30%);
        text-decoration-thickness: max(2px, 0.12em);
    }
}

.tt360SiteFooterBrand a:active {
    color: var(--text-primary);
    text-decoration-thickness: max(2px, 0.12em);
}

.tt360SiteFooterLinks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1.6rem;
}

/* Links stay underlined at rest (uiux variants.md "Link", default always);
   hover thickens the line and moves the color toward the primary text,
   pressing deepens it, and focus takes the shared ring. Each link is at
   least 2.4rem tall, 4.4rem under a coarse pointer, with 1.6rem between. */
.tt360SiteFooterLink {
    display: inline-flex;
    align-items: center;
    min-block-size: 2.4rem;
    color: var(--accent-text);
    font-weight: 600;
    text-decoration-line: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: max(1px, 0.07em);
    transition:
        color var(--tt360DurationFast) var(--tt360EaseOut),
        text-decoration-thickness var(--tt360DurationFast) var(--tt360EaseOut);
}

@media (hover: hover) and (pointer: fine) {
    .tt360SiteFooterLink:hover {
        color: color-mix(in oklab, var(--accent-text), var(--text-primary) 30%);
        text-decoration-thickness: max(2px, 0.12em);
    }
}

.tt360SiteFooterLink:active {
    color: var(--text-primary);
    text-decoration-thickness: max(2px, 0.12em);
}

@media (pointer: coarse) {
    .tt360SiteFooterLink {
        min-block-size: 4.4rem;
    }
}

/*
 * Icons: Tabler Icons outline SVGs (MIT), one set for every shared surface
 * (uiux layout-spacing.md "Icon-to-label gap"). The files are in
 * assets/icons/tabler/, renderIcon() in bootstrap_app.php writes them inline,
 * and every icon carries the tt360Icon class. 2rem (20px) is the default
 * size; a smaller control sets 1.6rem on its own icon. Icons draw in
 * currentColor, so they take the text color of their control.
 */
.tt360Icon {
    display: inline-block;
    flex: none;
    inline-size: 2rem;
    block-size: 2rem;
    vertical-align: middle;
}

/*
 * The shared dialog: assets/dialog.js builds it and window.tt360Dialog opens
 * it (alert, confirm, prompt). A native <dialog> opened with showModal(), so
 * the page behind is inert, in the default variant of uiux variants.md
 * "Dialog": md width (32rem there, 51.2rem here), never wider than the window
 * less 3.2rem, a dim backdrop, the overlay surface and the xl radius.
 *
 * Motion: the script adds .isVisible on the frame after showModal(), so the
 * dialog fades and rises on the slow duration while the backdrop fades in.
 * Closing removes .isVisible, both leave on the base duration with the
 * ease-in curve, and the script calls close() once that has run. The
 * reduced-motion block below keeps the fade and drops the rise.
 *
 * A long dialog scrolls inside, with a visible scrollbar, and its scroll
 * never reaches the page (uiux layout-spacing.md "Page scroll areas hand off
 * at their end; overlays contain it"). Every rule inside it is scoped under
 * .tt360Dialog, so a tool's bare h2, p, label, input or button rules and its
 * own .primary_btn layout never reach it.
 */
.tt360Dialog {
    box-sizing: border-box;
    inline-size: min(51.2rem, 100vw - 3.2rem);
    max-inline-size: none;
    max-block-size: calc(100dvh - 3.2rem);
    margin: auto;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Both edges, so the padding stays even beside a classic scrollbar. */
    scrollbar-gutter: stable both-edges;
    scrollbar-color: var(--tt360ScrollbarThumb) var(--tt360ScrollbarTrack);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: var(--overlay);
    color: var(--text-primary);
    box-shadow: var(--hairline), var(--shadow-3);
    font-family: var(--font-sans);
    opacity: 0;
    translate: 0 0.8rem;
    transition:
        opacity var(--tt360DurationBase) var(--tt360EaseIn),
        translate var(--tt360DurationBase) var(--tt360EaseIn);
}

.tt360Dialog.isVisible {
    opacity: 1;
    translate: 0 0;
    transition-duration: var(--tt360DurationSlow);
    transition-timing-function: var(--tt360EaseOut);
}

/* The fallback color is Console's light backdrop, for browsers whose
   ::backdrop does not inherit custom properties. */
.tt360Dialog::backdrop {
    background: var(--backdrop, rgb(19 22 30 / 0.44));
    opacity: 0;
    transition: opacity var(--tt360DurationBase) var(--tt360EaseIn);
}

.tt360Dialog.isVisible::backdrop {
    opacity: 1;
    transition-duration: var(--tt360DurationSlow);
    transition-timing-function: var(--tt360EaseOut);
}

/* One column that never grows past the dialog: a long word in the title
   or a long button label wraps inside it instead of widening the column.
   The padding is 1.6rem on a phone and 2.4rem on a wide window; with large
   text in a narrow window it stays at 5vw, so the line keeps room for whole
   words. At the default text size nothing changes from 320px up. */
.tt360Dialog .tt360DialogForm {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
    margin: 0;
    padding: clamp(min(1.6rem, 5vw), 5vw, 2.4rem);
}

/* At 2rem a long word such as "collaboration" is wider than the dialog in
   a 320px window with large text. There the title eases down with the
   window, never below the 1.6rem body size; at ordinary sizes it is 2rem. */
.tt360Dialog .tt360DialogTitle {
    margin: 0;
    color: var(--text-primary);
    font-size: min(2rem, max(1.6rem, 11vw));
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-align: start;
    text-transform: none;
    overflow-wrap: break-word;
}

/* The message keeps the line breaks the caller wrote. Title and message
   break inside a word only when that word is longer than the whole line. */
.tt360Dialog .tt360DialogMessage {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.6rem;
    line-height: 1.5;
    text-align: start;
    white-space: pre-line;
    overflow-wrap: break-word;
}

/* A prompt's field: the label above it (uiux forms-inputs.md "Labels above
   fields; beside only on wide forms"), then the field, the hint and the
   error. The label sits closer to its field than the field to the buttons. */
.tt360Dialog .tt360DialogField {
    display: grid;
    gap: 0.8rem;
}

.tt360Dialog .tt360DialogLabel {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
}

/* 1.6rem text, so a phone never zooms the page into the field. */
.tt360Dialog .tt360DialogInput {
    box-sizing: border-box;
    inline-size: 100%;
    min-block-size: 4rem;
    margin: 0;
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--border-control);
    border-radius: var(--radius-md);
    background: var(--sunken);
    color: var(--text-primary);
    font: inherit;
    font-size: 1.6rem;
    line-height: 1.4;
    box-shadow: none;
}

.tt360Dialog .tt360DialogInput::placeholder {
    color: var(--text-muted);
}

.tt360Dialog .tt360DialogInput[aria-invalid="true"] {
    border-color: var(--danger-text);
}

.tt360Dialog .tt360DialogInput:focus-visible {
    border-color: var(--accent-ring);
    outline: var(--tt360FocusRingWidth) solid var(--tt360FocusRingColor);
    outline-offset: var(--tt360FocusRingOffset);
}

/* An invalid field keeps its danger border under the focus ring. */
.tt360Dialog .tt360DialogInput[aria-invalid="true"]:focus-visible {
    border-color: var(--danger-text);
}

.tt360Dialog .tt360DialogHint {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1.45;
}

/* The error stays inside the dialog, beside the field it is about (uiux
   feedback-notifications.md "Errors from a modal dialog stay in the
   dialog"), with an icon so the state never rests on color alone. */
.tt360Dialog .tt360DialogError {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin: 0;
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
    color: var(--danger-text);
    font-size: 1.4rem;
    line-height: 1.45;
}

.tt360Dialog .tt360DialogError[hidden] {
    display: none;
}

.tt360Dialog .tt360DialogError .tt360Icon {
    inline-size: 1.6rem;
    block-size: 1.6rem;
    margin-block-start: 0.2rem;
}

/* One trailing group, primary last (uiux layout-spacing.md "Footer and
   dialog actions: one trailing group, primary last"). The buttons wrap
   together on a narrow screen and keep their height. */
.tt360Dialog .tt360DialogActions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-block-start: 0.8rem;
}

/*
 * Buttons: the shape is set here; the fill, label color and every state come
 * from the shared .primary_btn, .secondary_btn and .danger_btn rules above.
 * These rules sit at (0,2,0). The shared hover and disabled rules are
 * (0,3,0), so they still apply. The shared busy rule is only (0,2,0) and
 * comes earlier, so it would lose its progress cursor to the pointer below:
 * the busy rule after the shape rule puts it back at (0,3,0). The
 * destructive action is the outlined .danger_btn, never the filled primary
 * (uiux layout-spacing.md "Destructive action is never the default").
 * A label longer than the dialog is wide wraps inside its button, as in a
 * 320px window at a large text size, instead of running past the edge. It
 * breaks inside a word only when that word is longer than the button
 * (min-inline-size: 0 lets the button shrink to the row, and "break-word"
 * then splits only that word), and its side padding eases down to 5vw in
 * that case, like the form's.
 */
.tt360Dialog .tt360DialogButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-sizing: border-box;
    inline-size: auto;
    min-inline-size: 0;
    max-inline-size: 100%;
    min-block-size: 4rem;
    margin: 0;
    padding: 0 min(1.6rem, 5vw);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    box-shadow: none;
    font: inherit;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: normal;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: normal;
    overflow-wrap: break-word;
    cursor: pointer;
}

/* Busy while a prompt's validator runs: the progress cursor, at (0,3,0). */
.tt360Dialog .tt360DialogButton:is([aria-busy="true"], [data-loading]) {
    cursor: progress;
}

.tt360Dialog :is(.primary_btn, .primaryButton) {
    background: var(--accent-solid);
    color: var(--accent-on-solid);
}

.tt360Dialog :is(.secondary_btn, .secondaryButton) {
    border-color: var(--border-control);
    background: transparent;
    color: var(--text-primary);
}

.tt360Dialog :is(.danger_btn, .dangerButton) {
    border-color: var(--danger-text);
    background: transparent;
    color: var(--danger-text);
}

@media (hover: hover) and (pointer: fine) {
    .tt360Dialog .tt360DialogInput:not(:disabled, [readonly]):hover {
        border-color: var(--text-secondary);
    }

    .tt360Dialog .tt360DialogInput[aria-invalid="true"]:not(:disabled, [readonly]):hover {
        border-color: var(--danger-text);
    }
}

@media (pointer: coarse) {
    .tt360Dialog .tt360DialogButton,
    .tt360Dialog .tt360DialogInput {
        min-block-size: 4.4rem;
    }
}

/*
 * Forced colors: Windows contrast themes (uiux accessibility.md
 * "Accessibility pass before a page is done", item 5, and "Focus looks
 * different from selected"). The browser repaints every background as
 * Canvas, every text as CanvasText and drops box-shadow, so a state drawn
 * with a fill, a tint or a shadow ring disappears: the selected segment
 * looks like the others, and a switch's track and thumb vanish. This one
 * block gives each of those states a system color.
 *
 * - Selected, pressed, checked and open items fill with SelectedItem and
 *   SelectedItemText. The browser keeps an author's system color on borders
 *   and outlines but still repaints backgrounds and text, so these items set
 *   forced-color-adjust: none and paint themselves, with no shadow. Their
 *   contents inherit SelectedItemText, and the parts that carry text drop
 *   their own fill, edge and shadow.
 * - !important is used in this block only, on colors, shadows and the range
 *   slider's appearance. With forced-color-adjust: none the browser stops
 *   repainting these items, so a tool rule that outranks this block
 *   (notepad's .tool_btn[aria-pressed] at 0,2,0 against 0,1,0 here, or a
 *   selected hover at 0,4,0) would show its own palette raw inside a
 *   contrast theme; and tools turn their sliders' appearance off at up to
 *   0,2,1. No tool sets these with !important.
 * - The focus ring turns CanvasText: an outline with a gap, never a fill, so
 *   it stays apart from the SelectedItem fill, and it stays a system color
 *   inside the items above. A focused selected item adds an inset
 *   SelectedItemText band, so an inset ring never sits on SelectedItem.
 * - Tab underlines fill with Highlight; the sliding chip behind a segmented
 *   control fills with SelectedItem, like the segment on it.
 * - Switch tracks get a CanvasText edge and thumb, a SelectedItem track when
 *   on, and GrayText when disabled. The edge is an inset outline, so the
 *   track keeps its size and a tool's focus ring, which is more specific,
 *   still replaces it. Range sliders a tool styled return to the browser's
 *   own slider, which forced colors draws in system colors.
 * - At the end: GrayText for aria-disabled shared buttons, an edge and a
 *   Highlight fill for progress bars and meters, and three markers a tool
 *   adds itself: .tt360MaskIcon and .tt360PseudoMaskIcon for icons drawn
 *   with a CSS mask, and .tt360ColorSample for a color the user is
 *   choosing, which keeps its real color.
 */
@media (forced-colors: active) {
    :root,
    [data-theme="light"],
    [data-theme="dark"] {
        --tt360FocusRingColor: CanvasText;
    }

    :is(
        [aria-pressed="true"],
        [aria-selected="true"],
        [role="radio"][aria-checked="true"],
        [role="menuitemradio"][aria-checked="true"],
        [role="menuitemcheckbox"][aria-checked="true"],
        .tt360_nav_button[aria-expanded="true"],
        .segment:has(input:checked),
        .protocolOption:has(input:checked),
        input:checked + :is(.modeSegment, .protoSegment, .protocolSegment, .directionSegment, .segmentFace, .chipFace, .tt360ThemeSegment),
        :is(.segment, .viewOption) input:checked + span,
        :is(.preset_btn, .presetButton):is(.is_active, .isActive),
        :is(.mod_chip, .modifierChip):is(.is_active, .isActive)
    ) {
        forced-color-adjust: none;
        border-color: SelectedItem !important;
        background-color: SelectedItem !important;
        background-image: none !important;
        color: SelectedItemText !important;
        box-shadow: none !important;
    }

    /* Inside a selected item, every part takes SelectedItemText, and every
       part that carries text drops its own fill, edge and shadow, which
       forced-color-adjust: none (inherited) would otherwise show raw: a
       tinted name panel kept --accent-soft behind SelectedItemText, about
       1.3:1. Icons, images, aria-hidden decoration, color swatches and the
       .tt360MaskIcon and .tt360ColorSample markers (below) keep their look. */
    :is(
        [aria-pressed="true"],
        [aria-selected="true"],
        [role="radio"][aria-checked="true"],
        [role="menuitemradio"][aria-checked="true"],
        [role="menuitemcheckbox"][aria-checked="true"],
        .tt360_nav_button[aria-expanded="true"],
        .segment:has(input:checked),
        .protocolOption:has(input:checked),
        input:checked + :is(.modeSegment, .protoSegment, .protocolSegment, .directionSegment, .segmentFace, .chipFace, .tt360ThemeSegment),
        :is(.segment, .viewOption) input:checked + span,
        :is(.preset_btn, .presetButton):is(.is_active, .isActive),
        :is(.mod_chip, .modifierChip):is(.is_active, .isActive)
    ) * {
        color: inherit !important;
    }

    :is(
        [aria-pressed="true"],
        [aria-selected="true"],
        [role="radio"][aria-checked="true"],
        [role="menuitemradio"][aria-checked="true"],
        [role="menuitemcheckbox"][aria-checked="true"],
        .tt360_nav_button[aria-expanded="true"],
        .segment:has(input:checked),
        .protocolOption:has(input:checked),
        input:checked + :is(.modeSegment, .protoSegment, .protocolSegment, .directionSegment, .segmentFace, .chipFace, .tt360ThemeSegment),
        :is(.segment, .viewOption) input:checked + span,
        :is(.preset_btn, .presetButton):is(.is_active, .isActive),
        :is(.mod_chip, .modifierChip):is(.is_active, .isActive)
    ) :not(svg, svg *, img, [aria-hidden="true"], [aria-hidden="true"] *, [class*="swatch" i], [class*="thumb" i], .tt360MaskIcon, .tt360ColorSample) {
        border-color: currentColor !important;
        background-color: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    /* Focus on a selected item. Its SelectedItem fill sits right beside the
       ring, and many rings are drawn inset (the tab rows), where a CanvasText
       ring on SelectedItem is about 1.7:1. An inset SelectedItemText band,
       twice the ring's width, runs along the inside of the edge: an inset
       ring is drawn on top of it, and an outside ring has Canvas beside it,
       so the ring meets a contrasting band or Canvas either way. It is more
       specific than the selected rule above, so it wins its box-shadow.
       A .segment label always takes the band itself, never its span: where
       the label is the face (securepass, mimechecker, whatsapp) the span
       hugs its text, so a band on it covered the letters, and where the
       span is the face (commandtoolkit) the label is a bare wrapper of the
       same box, so its band runs along the face's edge. The span keeps
       losing its fill and shadow to the selected-descendant rule above.
       Only a .viewOption span bands itself, since its label is never
       painted. */
    :is(
        [aria-pressed="true"],
        [aria-selected="true"],
        [role="radio"][aria-checked="true"],
        [role="menuitemradio"][aria-checked="true"],
        [role="menuitemcheckbox"][aria-checked="true"],
        .tt360_nav_button[aria-expanded="true"],
        :is(.preset_btn, .presetButton):is(.is_active, .isActive),
        :is(.mod_chip, .modifierChip):is(.is_active, .isActive)
    ):focus-visible,
    :is(.segment, .protocolOption):has(input:checked:focus-visible),
    input:checked:focus-visible + :is(.modeSegment, .protoSegment, .protocolSegment, .directionSegment, .segmentFace, .chipFace, .tt360ThemeSegment),
    .viewOption input:checked:focus-visible + span {
        box-shadow: inset 0 0 0 calc(var(--tt360FocusRingWidth) * 2) SelectedItemText !important;
    }

    .tabIndicator {
        forced-color-adjust: none;
        background-color: Highlight !important;
    }

    :is(.modeIndicator, .segIndicator, .segmentIndicator, .directionIndicator, .protoIndicator, .protocolIndicator, .tt360ThemeIndicator) {
        forced-color-adjust: none;
        border-color: SelectedItem !important;
        background-color: SelectedItem !important;
        box-shadow: none !important;
    }

    /* Switches: the track beside a role="switch" checkbox (or one of the
       shared track class names), or the checkbox itself when a tool draws
       the switch on it. A pseudo-element with no content draws nothing, so
       only the thumb a tool really has is painted. */
    :is(input[role="switch"] + [aria-hidden="true"], .switchTrack, .switch_track, .slider_switch, .sliderSwitch) {
        outline: 1px solid CanvasText;
        outline-offset: -1px;
    }

    :is(input[role="switch"] + [aria-hidden="true"], .switchTrack, .switch_track, .slider_switch, .sliderSwitch, input[role="switch"])::before,
    :is(input[role="switch"] + [aria-hidden="true"], .switchTrack, .switch_track, .slider_switch, .sliderSwitch, input[role="switch"])::after {
        forced-color-adjust: none;
        background-color: CanvasText !important;
        box-shadow: none !important;
    }

    :is(input[role="switch"]:checked + [aria-hidden="true"], input:checked + :is(.switchTrack, .switch_track, .slider_switch, .sliderSwitch), input[role="switch"]:checked) {
        forced-color-adjust: none;
        border-color: SelectedItem !important;
        background-color: SelectedItem !important;
    }

    :is(input[role="switch"]:checked + [aria-hidden="true"], input:checked + :is(.switchTrack, .switch_track, .slider_switch, .sliderSwitch), input[role="switch"]:checked)::before,
    :is(input[role="switch"]:checked + [aria-hidden="true"], input:checked + :is(.switchTrack, .switch_track, .slider_switch, .sliderSwitch), input[role="switch"]:checked)::after {
        background-color: SelectedItemText !important;
    }

    :is(input[role="switch"]:disabled + [aria-hidden="true"], input:disabled + :is(.switchTrack, .switch_track, .slider_switch, .sliderSwitch), input[role="switch"]:disabled) {
        border-color: GrayText !important;
        outline-color: GrayText;
        background-color: Canvas !important;
    }

    :is(input[role="switch"]:disabled + [aria-hidden="true"], input:disabled + :is(.switchTrack, .switch_track, .slider_switch, .sliderSwitch), input[role="switch"]:disabled)::before,
    :is(input[role="switch"]:disabled + [aria-hidden="true"], input:disabled + :is(.switchTrack, .switch_track, .slider_switch, .sliderSwitch), input[role="switch"]:disabled)::after {
        background-color: GrayText !important;
    }

    /* Range sliders go back to the browser's own slider, which draws its
       track, its filled part and its thumb in system colors. A styled track
       is a background, which forced colors drops, so it would vanish. */
    input[type="range"],
    input[type="range"]::-webkit-slider-thumb {
        appearance: auto !important;
    }

    /* A shared button that is aria-disabled stays focusable, so the browser
       does not gray it out the way it does a :disabled one: GrayText says
       it is unavailable. A busy button keeps its look. */
    :is(.primary_btn, .primaryButton, .tt360_btn_solid, .tt360ButtonSolid, .secondary_btn, .secondaryButton, .danger_btn, .dangerButton):is(:disabled, [aria-disabled="true"]):not([aria-busy="true"], [data-loading]) {
        border-color: GrayText !important;
        color: GrayText !important;
    }

    /* Progress bars and meters. The track's tint turns Canvas and the fill
       vanishes with it, so the track gets a CanvasText edge (inset, so it
       keeps its size) and the fill paints itself in Highlight.
       - A role="progressbar" or role="meter" element is the track, and an
         empty child of it is the fill.
       - A drawn bar without the role uses the markers: .tt360ProgressTrack
         on the track and .tt360ProgressFill on the fill. A segmented meter
         puts .tt360ProgressTrack on every segment and adds
         .tt360ProgressFill to each filled one. */
    :is([role="progressbar"], [role="meter"], .tt360ProgressTrack) {
        outline: 1px solid CanvasText;
        outline-offset: -1px;
    }

    :is(:is([role="progressbar"], [role="meter"]) > :empty, .tt360ProgressFill) {
        forced-color-adjust: none;
        outline-color: Highlight;
        background-color: Highlight !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    /* Icons drawn with a CSS mask over a currentColor fill. Forced colors
       repaints that fill as Canvas, so the icon vanishes. No selector can
       find a mask, so a tool marks it: .tt360MaskIcon on an element whose
       own box is the icon, .tt360PseudoMaskIcon on an element whose
       ::before or ::after is. The icon then paints itself in the system
       color of the text around it: CanvasText, LinkText in a link,
       ButtonText in a button, SelectedItemText in a pressed, selected or
       checked item, and GrayText when disabled (each later rule wins).
       currentColor would not do: an element that opts out of forced colors
       inherits the author's color, not the forced one. */
    .tt360MaskIcon,
    .tt360PseudoMaskIcon::before,
    .tt360PseudoMaskIcon::after {
        forced-color-adjust: none;
        background-color: CanvasText !important;
        background-image: none !important;
    }

    :where(a[href], a[href] *).tt360MaskIcon,
    :where(a[href], a[href] *).tt360PseudoMaskIcon::before,
    :where(a[href], a[href] *).tt360PseudoMaskIcon::after {
        background-color: LinkText !important;
    }

    :where(button, [role="button"], button *, [role="button"] *).tt360MaskIcon,
    :where(button, [role="button"], button *, [role="button"] *).tt360PseudoMaskIcon::before,
    :where(button, [role="button"], button *, [role="button"] *).tt360PseudoMaskIcon::after {
        background-color: ButtonText !important;
    }

    :where([aria-pressed="true"], [aria-selected="true"], [aria-checked="true"], [aria-pressed="true"] *, [aria-selected="true"] *, [aria-checked="true"] *).tt360MaskIcon,
    :where([aria-pressed="true"], [aria-selected="true"], [aria-checked="true"], [aria-pressed="true"] *, [aria-selected="true"] *, [aria-checked="true"] *).tt360PseudoMaskIcon::before,
    :where([aria-pressed="true"], [aria-selected="true"], [aria-checked="true"], [aria-pressed="true"] *, [aria-selected="true"] *, [aria-checked="true"] *).tt360PseudoMaskIcon::after {
        background-color: SelectedItemText !important;
    }

    :where(:disabled, [aria-disabled="true"], :disabled *, [aria-disabled="true"] *).tt360MaskIcon,
    :where(:disabled, [aria-disabled="true"], :disabled *, [aria-disabled="true"] *).tt360PseudoMaskIcon::before,
    :where(:disabled, [aria-disabled="true"], :disabled *, [aria-disabled="true"] *).tt360PseudoMaskIcon::after {
        background-color: GrayText !important;
    }

    /* A color the user is choosing or judging, such as a swatch or a
       preview of the chosen color, keeps its real color, with a CanvasText
       edge where it has a border. Mark it .tt360ColorSample. */
    .tt360ColorSample {
        forced-color-adjust: none;
        border-color: CanvasText !important;
    }
}

/*
 * The one reduced-motion block (uiux motion.md "One reduced-motion block
 * covers transitions too"). Movement goes: every animation and transition is
 * cut to 0.01ms (not 0, so cleanup that waits for transitionend still runs)
 * and smooth scrolling stops. Fades that carry meaning stay: the shared
 * overlays below keep their opacity and color fade, and lose their slide.
 * The theme cross-fade above keeps its own duration, because its selectors
 * are more specific than the universal rule here.
 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    :is(
        dialog,
        [popover],
        .tt360_launcher_backdrop,
        .tt360_launcher_panel,
        .tt360_support_panel,
        .tt360_size_panel,
        .tt360ThemePanel,
        .tt360_floating_tooltip,
        .tt360_pwa_prompt
    ) {
        transition-property: opacity, color, background-color !important;
        transition-duration: var(--tt360DurationBase) !important;
    }

    /* The shared overlays slide with the translate property alone, so
       dropping it removes their movement and leaves their position alone. */
    :is(
        .tt360_launcher_panel,
        .tt360_support_panel,
        .tt360_size_panel,
        .tt360ThemePanel,
        .tt360_floating_tooltip,
        .tt360_pwa_prompt,
        .tt360Dialog
    ) {
        translate: none !important;
    }
}
