/* Tahoma has no SemiBold face: WPF synthesises it from Regular (narrower than the real Bold). A regular-only alias reproduces that. */
@font-face { font-family: "HDTahoma"; src: local("Tahoma"), local("Tahoma Regular"); font-weight: 400; font-style: normal; }
/* HDTools.UI web port. Every colour and metric comes from hdui-tokens.css (generated from the WPF XAML). */
.hdui, .hdui * { box-sizing: border-box; }
.hdui {
  font-family: "HDTahoma", var(--m-FontFamily-Body), Tahoma, "Segoe UI", sans-serif;
  font-size: var(--m-FontSize-Body);
  line-height: 13px;
  color: var(--b-Text);
  background: var(--b-WindowBg);
  -webkit-font-smoothing: auto;
  text-rendering: geometricPrecision;
}
.hdui button { font: inherit; color: inherit; margin: 0; }
.hdui svg { display: block; flex: none; }

/* ---------- text roles (Hd.Title / Subtitle / Label / Help / StatusText) ---------- */
.hd-title { margin: 8px; line-height: 16px; font-weight: 600; font-size: var(--m-FontSize-Title); color: var(--b-TextStrong); }
.hd-subtitle { line-height: 15px; font-weight: 600; font-size: var(--m-FontSize-Subtitle); color: var(--b-TextHeader); }
.hd-label { line-height: 13px; color: var(--b-Text); }
.hd-label.strong { color: var(--b-TextHeader); }
.hd-label.muted { color: var(--b-TextMuted); }
.hd-help { line-height: 13px; color: var(--b-TextMuted); }
.hd-status { line-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--b-TextStrong); }
.hd-status.muted { color: var(--b-TextMuted); }

/* ---------- layout ---------- */
.hd-stack { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.hd-row { display: flex; flex-direction: row; gap: 8px; align-items: center; }
.hd-wrap { display: flex; flex-wrap: wrap; align-items: flex-start; }
.hd-wrap-i { display: flex; align-items: center; margin: 0 8px 0 0; }
.hd-wrap-i.b { margin-right: 4px; }
.hd-wrap-btn > .hd-wrap-i { margin: 0 4px 8px 0; }
.hd-cols { display: grid; gap: 8px 4px; }
.hd-cols > .hd-btn { width: 100%; min-width: 0; }

/* ---------- Level / CollapsiblePanel ---------- */
.hd-level.d1 { border: 1px solid var(--b-Level1Border); background: var(--b-Level1Bg); }
.hd-lv-head { position: relative; margin-left: -1px; height: 25px; display: flex; align-items: center; background: var(--b-LevelHeaderBg); cursor: pointer; padding-left: 11px; padding-right: 0; transition: background-color var(--m-Motion-HoverOut); }
.hd-lv-head:hover { background: color-mix(in srgb, var(--b-CollectionHover) 100%, var(--b-LevelHeaderBg)); transition-duration: var(--m-Motion-HoverIn); }
.hd-rail { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--b-Accent); }
.hd-lv-title { flex: 1; min-width: 0; color: var(--b-TextHeader); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-chev { margin: 0 8px; color: var(--b-TextHeader); transition: transform var(--m-Motion-Reveal) cubic-bezier(.2,.7,.3,1); }
.hd-level.d1.collapsed > .hd-lv-head { background: var(--b-CollectionRowB); }
.hd-level.d1.collapsed > .hd-lv-head .hd-chev { transform: rotate(180deg); }
.hd-lv-clip { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--m-Motion-Reveal) cubic-bezier(.2,.7,.3,1), opacity var(--m-Motion-Reveal); }
.hd-lv-clip > .hd-lv-body { min-height: 0; overflow: hidden; margin: 8px; } /* one field on all four sides = 8 (owner 2026-10-12: sides, vertical and row gaps are the same number) */
.hd-level.d1.collapsed > .hd-lv-clip { grid-template-rows: 0fr; opacity: 0; }
.hd-level.d1.collapsed > .hd-lv-clip > .hd-lv-body { margin-top: 0; margin-bottom: 0; }
.hd-level.d2 { border: 1px solid var(--b-Level2Border); background: var(--b-Level2Bg); padding: 8px; }
.hd-lv2-gap { height: 8px; }
.hd-level.d3 { border: 1px solid var(--b-Level3Border); background: var(--b-Level3Bg); padding: 8px 12px; }

/* ---------- Buttons: cell = visible box + 1 px slack on every side (Shared.xaml Button) ---------- */
/* WPF Hd.ButtonHeight + Themes/Foundation/Metrics.xaml: Roomy remains default.
   Classic opts into the existing WPF 27/31/35 cells without local control overrides. */
.hdui { --hd-button-metric-gap:0px; --hd-button-metric-half:0px; --hd-button-side-small:0px; --hd-button-side-standard:0px; --hd-button-side-large:0px; }
.hdui[data-button-metrics="classic"] { --hd-button-metric-gap:4px; --hd-button-metric-half:2px; --hd-button-side-small:2px; --hd-button-side-standard:4px; --hd-button-side-large:6px; }
.hd-btn { position: relative; display: inline-flex; padding: 1px; border: 0; background: none; cursor: default; min-width: 77px; outline: none; vertical-align: top; --bg: var(--b-ButtonBg); --bd: var(--b-BorderButton); --fg: var(--b-ButtonText); --hbg: var(--b-ButtonBgHover); --hbd: var(--b-ButtonHoverBorder); --pbg: var(--b-ButtonPressedBg); --pbd: var(--b-ButtonHoverBorder); --hfg: var(--b-ButtonTextHover); --afg: var(--b-ButtonTextActive); }
.hd-btn.s-compact { height: calc(31px - var(--hd-button-metric-gap)); font-size: var(--m-FontSize-Button-Compact); }
.hd-btn.s-standard { height: calc(35px - var(--hd-button-metric-gap)); font-size: var(--m-FontSize-Button-Default); }
.hd-btn.s-large { height: calc(39px - var(--hd-button-metric-gap)); font-size: var(--m-FontSize-Button-Large); }
.hd-btn.io { min-width: 0; }
.hd-btn.io.s-compact { width: calc(31px - var(--hd-button-metric-gap)); } .hd-btn.io.s-standard { width: calc(35px - var(--hd-button-metric-gap)); } .hd-btn.io.s-large { width: calc(39px - var(--hd-button-metric-gap)); }
.hd-face { flex: 1; display: flex; align-items: center; justify-content: center; border: 1px solid var(--bd); border-radius: var(--m-Corner-Button); background: var(--bg); color: var(--fg); white-space: nowrap; transition: background-color var(--m-Motion-ButtonHoverOut) ease-out, border-color var(--m-Motion-ButtonHoverOut) ease-out, color var(--m-Motion-ButtonHoverOut) ease-out; }
.hd-btn.s-compact .hd-face { padding: calc(6px - var(--hd-button-metric-half)) 12px calc(7px - var(--hd-button-metric-half)); }
.hd-btn.s-standard .hd-face { padding: calc(6px - var(--hd-button-metric-half)) 16px; }
.hd-btn.s-large .hd-face { padding: calc(8px - var(--hd-button-metric-half)) 20px calc(9px - var(--hd-button-metric-half)); }
.hd-btn.io .hd-face { padding: 0; }
/* two-colour panel glyphs and chevrons */
.hd-glyph, .hd-chevron { flex: none; display: block; }
.hd-glyph .gb { color: var(--c-IconDefault); } .hd-glyph .ga { color: var(--c-IconAccent); } .hd-glyph .gs { color: var(--c-IconSecondary); }
.hd-glyph.mono .gb, .hd-glyph.mono .ga, .hd-glyph.mono .gs, .hd-btn.v-primary .hd-glyph path, .hd-btn.v-success .hd-glyph path, .hd-btn:disabled .hd-glyph path { color: inherit; }
/* joined segment */
.hd-seg { display: inline-flex; } .hd-seg.fit { display: flex; }
.hd-seg > .hd-btn { min-width: 0; } .hd-seg.fit > .hd-btn { flex: 1 1 0; }
.hd-seg > .hd-btn + .hd-btn { margin-left: -3px; }
.hd-seg > .hd-btn.on { z-index: 1; }
/* separate buttons of one choice (o.separate): the 4 px row gap, cells never share a border */
.hd-seg.sep { gap: 4px; } .hd-seg.sep > .hd-btn + .hd-btn { margin-left: 0; }
.hd-seg > .hd-btn.s-compact:not(.io) .hd-face { padding-left: 6px; padding-right: 6px; }
/* sliding choice (HDUI.slideChoice): one quiet framed field, the captions lie on it, one plate crawls under the chosen caption.
   Accepted by the owner on 2026-10-13 (proposal-switch-buttons.html, passes 3-5):
   - three sizes: small (row 27, plate 17, corners 10 / 6), medium (row 31, plate 21, corners 11 / 7; the default), large (row 35,
     plate 23, corners 12 / 8, 19 px icons); the plate keeps 3 px (small, medium) or 4 px (large) of field inside the 1 px frame;
   - the field is only a little darker than the panel, its frame is the neutral field line (PanelBorder), never the blue button outline;
   - the plate is a calm blue that becomes the full button blue under the pointer; the move is seen (300 ms);
   - plate shape by position: the first is rounded on the left, the last on the right, a middle one is a rectangle (2 px corners);
   - captions 0.8, the chosen one and the one under the pointer are full; no fill of any kind on a position that is not chosen;
   - disabled by the system principle: no fills, everything in the one disabled colour, no outer frame, the chosen position is
     an outline that lies OUTSIDE the plate. */
.hd-slide { position: relative; display: inline-flex; flex: none; align-items: center; box-sizing: border-box; height: 31px; padding: 0 5px; vertical-align: top; --plate: color-mix(in srgb, var(--b-ButtonBg) 55%, var(--b-Level1Bg)); --pr: 7px; --slide: 300ms cubic-bezier(.4,0,.2,1); }
.hd-slide-track { position: absolute; left: 1px; top: 1px; right: 1px; bottom: 1px; box-sizing: border-box; border: 1px solid var(--b-PanelBorder); border-radius: 11px; background: color-mix(in srgb, var(--b-Level1Bg) 86%, #000); }
.hd-slide-thumb { position: absolute; left: 5px; top: 5px; height: 21px; border-radius: var(--pr); background: var(--plate); transition: transform var(--slide), border-radius var(--slide), background-color 160ms ease-out; }
.hd-slide[data-pos=first] .hd-slide-thumb { border-radius: var(--pr) 2px 2px var(--pr); }
.hd-slide[data-pos=mid] .hd-slide-thumb { border-radius: 2px; }
.hd-slide[data-pos=last] .hd-slide-thumb { border-radius: 2px var(--pr) var(--pr) 2px; }
.hd-slide:not(.disabled):has(> .hd-btn.on:hover) .hd-slide-thumb { background: var(--b-ButtonBg); }
/* the captions are their own cells (not a button size): 4 px lower than the row, text line and icons on whole pixels */
.hd-slide > .hd-btn { z-index: 1; min-width: 0; height: 27px; padding: 1px 0; font-size: var(--m-FontSize-Button-Compact); }
.hd-slide > .hd-btn .hd-face, .hd-slide > .hd-btn:hover:not(:disabled) .hd-face, .hd-slide > .hd-btn:active:not(:disabled) .hd-face, .hd-slide > .hd-btn:disabled .hd-face { background: transparent; border-color: transparent; padding: 4px 0 5px; }
.hd-slide > .hd-btn .hd-face:has(> .hd-bl), .hd-slide > .hd-btn .hd-face:has(> svg:only-child) { padding-top: 0; padding-bottom: 0; }
.hd-slide > .hd-btn .hd-bl { height: 23px; }
.hd-slide > .hd-btn .hd-bl > .hd-bt { align-self: flex-start; margin-top: 4px; }
.hd-slide > .hd-btn .hd-face { position: relative; color: var(--b-ButtonSecondaryTextActive); opacity: .8; transition: opacity var(--slide), color var(--slide); }
.hd-slide > .hd-btn:hover:not(:disabled) .hd-face { color: var(--b-ButtonSecondaryTextActive); opacity: 1; }
[data-theme=dark] .hd-slide > .hd-btn:hover:not(:disabled) .hd-face { color: var(--b-ButtonText); }
.hd-slide > .hd-btn.on .hd-face, .hd-slide > .hd-btn.on:hover:not(:disabled) .hd-face { color: var(--b-ButtonText); opacity: 1; }
/* small */
.hd-slide.s-small { height: 27px; --pr: 6px; }
.hd-slide.s-small .hd-slide-track { border-radius: 10px; }
.hd-slide.s-small .hd-slide-thumb { height: 17px; }
.hd-slide.s-small > .hd-btn { height: 23px; }
.hd-slide.s-small > .hd-btn .hd-face { padding-top: 2px; padding-bottom: 3px; }
.hd-slide.s-small > .hd-btn .hd-face:has(> .hd-bl), .hd-slide.s-small > .hd-btn .hd-face:has(> svg:only-child) { padding-top: 0; padding-bottom: 0; }
.hd-slide.s-small > .hd-btn .hd-bl { height: 19px; }
.hd-slide.s-small > .hd-btn .hd-bl > .hd-bt { margin-top: 2px; }
/* large: 19 px icons */
.hd-slide.s-large { height: 35px; padding: 0 6px; --pr: 8px; }
.hd-slide.s-large .hd-slide-track { border-radius: 12px; }
.hd-slide.s-large .hd-slide-thumb { left: 6px; top: 6px; height: 23px; }
.hd-slide.s-large > .hd-btn { height: 31px; }
.hd-slide.s-large > .hd-btn .hd-face { padding-top: 6px; padding-bottom: 7px; }
.hd-slide.s-large > .hd-btn .hd-face:has(> .hd-bl), .hd-slide.s-large > .hd-btn .hd-face:has(> svg:only-child) { padding-top: 0; padding-bottom: 0; }
.hd-slide.s-large > .hd-btn .hd-bl { height: 27px; }
.hd-slide.s-large > .hd-btn .hd-bl > .hd-bt { margin-top: 6px; }
/* tight (owner, 2026-10-13, corrected the same night: "everything is rectangular, the rounding looks radial"):
   almost square corners that grow with the size: frame 0 / 2 / 3, plate 0 / 1 / 2 (small / medium / large) */
/* owner 2026-10-17: the rounding of the HD Browser view switch (former .tight) is the ONLY look of every sliding choice */
.hd-slide { --pr: 1px; }
.hd-slide .hd-slide-track { border-radius: 2px; }
.hd-slide.s-small { --pr: 0px; }
.hd-slide.s-small .hd-slide-track { border-radius: 0; }
.hd-slide.s-large { --pr: 2px; }
.hd-slide.s-large .hd-slide-track { border-radius: 3px; }
.hd-slide[data-pos] .hd-slide-thumb { border-radius: var(--pr); }
/* light theme (owner, 2026-10-13: the grey field looked dirty): a clean white field, the plate in the button colour */
[data-theme=light] .hd-slide { --plate: var(--b-ButtonBg); }
[data-theme=light] .hd-slide-track { background: var(--b-InputHoverBg); }
[data-theme=light] .hd-slide:not(.disabled):has(> .hd-btn.on:hover) .hd-slide-thumb { background: color-mix(in srgb, var(--b-ButtonBg) 80%, var(--b-ButtonSecondaryBorder)); }
/* disabled */
.hd-slide.disabled .hd-slide-track { background: transparent; border-color: transparent; }
.hd-slide.disabled .hd-slide-thumb { background: transparent; box-shadow: 0 0 0 1px var(--b-ButtonDisabledBorder); }
.hd-slide.disabled > .hd-btn .hd-face { color: var(--b-ButtonDisabledText); opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hd-slide-thumb, .hd-slide > .hd-btn .hd-face { transition: none; } }
.hd-lv-actions { flex: none; display: flex; align-items: center; gap: 8px; margin-right: 8px; }
.hd-bl { display: inline-flex; align-items: center; position: relative; }
/* icon + text, compact: the group takes the whole 23 px inner height (odd), so 13 / 15 / 17 px icons centre on whole pixels;
   the text keeps its own line (4 px from the top, as without an icon). Never centre an odd icon in an even box. */
.hd-btn.s-compact .hd-face:has(> .hd-bl) { padding-top: 0; padding-bottom: 0; }
.hd-btn.s-compact .hd-bl { height: calc(27px - var(--hd-button-metric-gap)); }
.hd-btn.s-compact .hd-bl > .hd-bt { align-self: flex-start; margin-top: calc(6px - var(--hd-button-metric-half)); }
/* icon + text, large: same rule. The 21 px icon in the 18 px text box sat on a half pixel; the group takes the 31 px inner height
   (odd), the text keeps its line 6 px from the top, as without an icon. */
.hd-btn.s-large .hd-face:has(> .hd-bl) { padding-top: 0; padding-bottom: 0; }
.hd-btn.s-large .hd-bl { height: calc(35px - var(--hd-button-metric-gap)); }
.hd-btn.s-large .hd-bl > .hd-bt { align-self: flex-start; margin-top: calc(8px - var(--hd-button-metric-half)); }
/* icon + text, standard (31): same rule. The group takes the 27 px inner height (odd), so the 19 px icon sits on whole pixels;
   the text line starts 8 px from the button top, as measured in the WPF control (Hd.PrimaryButton, Standard, 2026-10-12). */
.hd-btn.s-standard .hd-face:has(> .hd-bl) { padding-top: 0; padding-bottom: 0; }
.hd-btn.s-standard .hd-bl { height: calc(31px - var(--hd-button-metric-gap)); }
.hd-btn.s-standard .hd-bl > .hd-bt { align-self: flex-start; margin-top: calc(8px - var(--hd-button-metric-half)); }
.hd-bl > svg + .hd-bt { margin-left: 8px; }
.hd-bl > .hd-bt + svg { margin-left: 8px; }
.hd-bt { line-height: normal; }
/* Accepted by the owner on 2026-10-13: every button size is 4 px higher (27 / 31 / 35 -> 31 / 35 / 39), 2 px more above and
   below text and icon. Optical balance of icon + text (variant A): the icon is lighter than the text, so the side that holds
   the icon gets less padding: 10 / 12 / 14 instead of 12 / 16 / 20 (in a fixed-width button the content stands 1 / 2 / 3 px
   closer to the icon side). */
.hd-btn.s-compact .hd-face:has(> .hd-bl > svg:first-child) { padding-left: calc(10px + var(--hd-button-side-small)); } .hd-btn.s-compact .hd-face:has(> .hd-bl > svg:last-child) { padding-right: calc(10px + var(--hd-button-side-small)); }
.hd-btn.s-standard .hd-face:has(> .hd-bl > svg:first-child) { padding-left: calc(12px + var(--hd-button-side-standard)); } .hd-btn.s-standard .hd-face:has(> .hd-bl > svg:last-child) { padding-right: calc(12px + var(--hd-button-side-standard)); }
.hd-btn.s-large .hd-face:has(> .hd-bl > svg:first-child) { padding-left: calc(14px + var(--hd-button-side-large)); } .hd-btn.s-large .hd-face:has(> .hd-bl > svg:last-child) { padding-right: calc(14px + var(--hd-button-side-large)); }
/* A button that stands beside a 25 px field (combo, number, text) keeps the field height: cell 27, face 25, the same top edge.
   Found by the row it stands in, or marked by hand with .by-field (HDUI.button {byField: true}). The 27 x 27 tool icon too. */
.hd-btn.s-compact.by-field, .hd-btn.hd-tool.s-compact,
:is(.hd-row, .hd-formrow, .hd-slrow):has(> :is(.hd-combo:not(.tall), .hd-num, .hd-tb, .hd-nb, .hd-sel)) > .hd-btn.s-compact,
:is(.hd-row, .hd-formrow, .hd-slrow):has(> :is(.hd-combo:not(.tall), .hd-num, .hd-tb, .hd-nb, .hd-sel)) > .hd-seg > .hd-btn.s-compact { height: 27px; }
.hd-btn.io.s-compact.by-field, .hd-btn.hd-tool.s-compact.io,
:is(.hd-row, .hd-formrow, .hd-slrow):has(> :is(.hd-combo:not(.tall), .hd-num, .hd-tb, .hd-nb, .hd-sel)) > .hd-btn.io.s-compact,
:is(.hd-row, .hd-formrow, .hd-slrow):has(> :is(.hd-combo:not(.tall), .hd-num, .hd-tb, .hd-nb, .hd-sel)) > .hd-seg > .hd-btn.io.s-compact { width: 27px; }
.hd-btn:hover:not(:disabled) .hd-face { background: var(--hbg); border-color: var(--hbd); color: var(--hfg); transition-duration: var(--m-Motion-ButtonHoverIn); }
.hd-btn:active:not(:disabled) .hd-face { background: var(--pbg); border-color: var(--pbd); color: var(--afg); transition-duration: var(--m-Motion-Press); }
.hd-btn:focus-visible .hd-face { box-shadow: 0 0 0 1px var(--b-SliderFocusRing); }
.hd-btn.v-secondary { --bg: var(--b-ButtonSecondaryBg); --bd: var(--b-ButtonSecondaryBorder); --fg: var(--b-ButtonSecondaryText); --hbg: var(--b-ButtonSecondaryHoverBg); --hbd: var(--b-ButtonSecondaryBorder); --pbg: var(--b-ButtonSecondaryPressedBg); --pbd: var(--b-ButtonSecondaryBorder); --hfg: var(--b-ButtonSecondaryTextHover); --afg: var(--b-ButtonSecondaryTextActive); }
.hd-btn svg .dk-soft { fill: currentColor; fill-opacity: .2; stroke: none; } /* the soft body of an outline icon: 20 % of its colour */
.hd-btn.v-subtle { --bg: var(--b-ButtonSubtleBg); --bd: transparent; --fg: var(--b-ButtonSubtleText); --hbg: var(--b-ButtonSubtleHoverBg); --hbd: var(--b-PanelBorder); --pbg: var(--b-ButtonSubtlePressedBg); --pbd: var(--b-ButtonSecondaryBorder); --hfg: var(--b-ButtonSubtleTextHover); --afg: var(--b-ButtonSubtleTextActive); }
.hd-btn.v-success { --bg: var(--b-ButtonSuccessBg); --bd: var(--b-StateSuccessBorder); --fg: var(--b-ButtonSuccessText); --hbg: var(--b-ButtonSuccessHoverBg); --hbd: var(--b-StateSuccessBorder); --pbg: var(--b-ButtonSuccessPressedBg); --pbd: var(--b-StateSuccessBorder); --hfg: var(--b-ButtonSuccessText); --afg: var(--b-ButtonSuccessText); }
/* STANDARD (Pavel 2026-10-30, "always"): every filled button (success, warning, danger) has its border INSIDE in the dark theme; WPF twin: Shared.xaml FilledEdge/FilledRing, key Opacity.ButtonFilledInset.
   Accepted by the owner on 2026-10-13, dark theme. (1) A filled button with a LIGHT outline looked larger than one with a dark
   outline: the outer edge of success / danger is the same dark line as on the primary button, the light line lies 1 px inside.
   (2) An outline-only (secondary) button under the pointer: the line turns blue, the face gets a little darker (90 %).
   (3) The hover line may hint at the action (HDUI.button {hint}): reddish = clear / remove, greenish = save / accept. */
[data-theme=dark] .hd-btn:is(.v-success, .v-warning, .v-danger):not(.hd-toggle) { --bd: var(--b-ButtonHoverBorder); --hbd: var(--b-ButtonHoverBorder); --pbd: var(--b-ButtonHoverBorder); }
[data-theme=dark] .hd-btn.v-success:not(.hd-toggle):not(:disabled) .hd-face { box-shadow: inset 0 0 0 1px var(--b-StateSuccessBorder); }
[data-theme=dark] .hd-btn.v-danger:not(.hd-toggle):not(:disabled) .hd-face { box-shadow: inset 0 0 0 1px var(--b-StateDangerBorder); }
[data-theme=dark] .hd-btn.v-warning:not(.hd-toggle):not(:disabled) .hd-face { box-shadow: inset 0 0 0 1px var(--b-StateWarningBorder); }
[data-theme=dark] .hd-btn.v-secondary:not(.hd-toggle) { --hbd: var(--b-ComboHoverBorder); --pbd: var(--b-ComboHoverBorder); --hbg: color-mix(in srgb, var(--b-ButtonSecondaryBg) 90%, #000); }
[data-theme=dark] .hd-btn.v-secondary.hint-danger:not(.hd-toggle) { --hbd: var(--b-StateDangerBorder); --pbd: var(--b-StateDangerBorder); }
[data-theme=dark] .hd-btn.v-secondary.hint-success:not(.hd-toggle) { --hbd: var(--b-StateSuccessBorder); --pbd: var(--b-StateSuccessBorder); }
.hd-btn.v-warning { --bg: var(--b-ButtonWarningBg); --bd: var(--b-StateWarningBorder); --fg: var(--b-ButtonWarningText); --hbg: var(--b-ButtonWarningHoverBg); --hbd: var(--b-StateWarningBorder); --pbg: var(--b-ButtonWarningPressedBg); --pbd: var(--b-StateWarningBorder); --hfg: var(--b-ButtonWarningText); --afg: var(--b-ButtonWarningText); }
.hd-btn.v-danger { --bg: var(--b-ButtonDangerBg); --bd: var(--b-StateDangerBorder); --fg: var(--b-ButtonDangerText); --hbg: var(--b-ButtonDangerHoverBg); --hbd: var(--b-StateDangerBorder); --pbg: var(--b-ButtonDangerPressedBg); --pbd: var(--b-StateDangerBorder); --hfg: var(--b-ButtonDangerText); --afg: var(--b-ButtonDangerText); }
/* Filled web selection palette; frozen WPF binary is unchanged. */
.hdui { --b-ButtonFilledBg:#2f5fa8; --b-ButtonFilledHoverBg:#376dbc; --b-ButtonFilledPressedBg:#244b87; --b-ButtonFilledText:#ffffff; }
.hdui[data-theme=dark] { --b-ButtonFilledBg:#365f9e; --b-ButtonFilledHoverBg:#4071ba; --b-ButtonFilledPressedBg:#2b4f85; --b-ButtonFilledText:#ffffff; }

.hd-btn.v-filled { --bg: var(--b-ButtonFilledBg); --bd: var(--b-ButtonFilledBg); --fg: var(--b-ButtonFilledText); --hbg: var(--b-ButtonFilledHoverBg); --hbd: var(--b-ButtonFilledHoverBg); --pbg: var(--b-ButtonFilledPressedBg); --pbd: var(--b-ButtonFilledPressedBg); --hfg: var(--b-ButtonFilledText); --afg: var(--b-ButtonFilledText); }
.hd-btn.v-filled .hd-glyph path { color: inherit; }
.hd-btn:disabled .hd-face { background: var(--b-ButtonDisabledBg); border-color: var(--b-ButtonDisabledBorder); color: var(--b-ButtonDisabledText); }
/* o.tone: the icon carries the meaning, the face stays quiet (owner, 2026-10-14). Restrained tones, light theme first */
/* The tone rainbow (owner, 2026-10-15: "one rainbow, agreed in feel for the light and the dark theme, by contrast and harmony").
   Nine hues of ONE perceived lightness (OKLCH L 0.50 light, chroma 0.10-0.13 / L 0.80 dark, chroma 0.07: owner 2026-10-15 "кислотные цвета очень агрессивны", the dark set follows the accepted Console tones), so no colour shouts louder than another;
   contrast to the button face and the panel 5.4-6.5 (light) and 4.7-5.6 (dark). Meaning of each hue:
   red = delete / close, orange = clear / reset (not delete), amber = warning / view filter, green = create / add / paint / apply,
   teal = pick / select, blue = copy / split / an ordinary action / category, violet = cut / move / type, rose = favourite / phase,
   gray = refresh / neutral. Use these variables, never a private colour. */
:root, [data-theme=light] { --hd-tn-red: #A03F3C; --hd-tn-orange: #964C04; --hd-tn-amber: #7E5E01; --hd-tn-green: #357426; --hd-tn-teal: #02736E;
  --hd-tn-blue: #2F62AC; --hd-tn-violet: #6F4FA1; --hd-tn-rose: #973F6E; --hd-tn-gray: #5C646F; }
[data-theme=dark] { --hd-tn-red: #E7ADA8; --hd-tn-orange: #E1B394; --hd-tn-amber: #D2BB8C; --hd-tn-green: #A7C99F; --hd-tn-teal: #8ACCC7;
  --hd-tn-blue: #A3C0EA; --hd-tn-violet: #C4B4E4; --hd-tn-rose: #E1ACC4; --hd-tn-gray: #B5BFCB; }
.hd-btn.tone-danger, .hd-btn.tone-red { --tn: var(--hd-tn-red); } .hd-btn.tone-clear, .hd-btn.tone-orange { --tn: var(--hd-tn-orange); }
.hd-btn.tone-warning, .hd-btn.tone-amber { --tn: var(--hd-tn-amber); } .hd-btn.tone-success, .hd-btn.tone-green { --tn: var(--hd-tn-green); }
.hd-btn.tone-pick, .hd-btn.tone-teal { --tn: var(--hd-tn-teal); } .hd-btn.tone-info, .hd-btn.tone-blue { --tn: var(--hd-tn-blue); }
.hd-btn.tone-move, .hd-btn.tone-violet { --tn: var(--hd-tn-violet); } .hd-btn.tone-rose { --tn: var(--hd-tn-rose); }
.hd-btn.tone-neutral, .hd-btn.tone-gray { --tn: var(--hd-tn-gray); }
.hd-btn[class*="tone-"]:not(:disabled) .hd-face svg, .hd-btn[class*="tone-"]:not(:disabled) .hd-face svg path { color: var(--tn); }
/* Hd.ToolIcon */
.hd-btn.hd-tool { --bg: var(--b-CollectionRowA); --bd: var(--b-BorderDeep); }

/* ---------- ToggleButton ---------- */
.hd-toggle { --bg: var(--b-ButtonSecondaryBg); --bd: var(--b-ButtonSecondaryBorder); --fg: var(--b-ButtonSecondaryText); --hbg: var(--b-ButtonSecondaryHoverBg); --hbd: var(--b-ButtonSecondaryBorder); --hfg: var(--b-ButtonSecondaryTextHover); --pbg: var(--b-ButtonBgHover); --pbd: var(--b-Accent); --afg: var(--b-ButtonSecondaryTextActive);
  --on-bg: var(--b-ButtonBg); --on-bd: var(--b-Accent); --on-fg: var(--b-ButtonText); }
.hd-toggle.v-secondary { --on-bg: var(--b-ButtonSecondaryPressedBg); --on-bd: var(--b-ButtonSecondaryBorder); --on-fg: var(--b-ButtonSecondaryTextActive); --pbg: var(--b-ButtonSecondaryPressedBg); --pbd: var(--b-ButtonSecondaryBorder); }
.hd-toggle.v-subtle { --bg: var(--b-ButtonSubtleBg); --bd: transparent; --fg: var(--b-ButtonSubtleText); --hbg: var(--b-ButtonSubtleHoverBg); --hbd: var(--b-PanelBorder); --hfg: var(--b-ButtonSubtleTextHover); --on-bg: var(--b-ButtonSubtlePressedBg); --on-bd: var(--b-ButtonSecondaryBorder); --on-fg: var(--b-ButtonSubtleTextActive); }
.hd-toggle.v-success { --bg: var(--b-ButtonSuccessBg); --bd: var(--b-StateSuccessBorder); --fg: var(--b-ButtonSuccessText); --hbg: var(--b-ButtonSuccessHoverBg); --hbd: var(--b-StateSuccessBorder); --hfg: var(--b-ButtonSuccessText); --on-bg: var(--b-ButtonSuccessHoverBg); --on-bd: var(--b-StateSuccessBorder); --on-fg: var(--b-ButtonSuccessText); --pbg: var(--b-ButtonSuccessPressedBg); --pbd: var(--b-StateSuccessBorder); }
.hd-toggle.v-warning { --bg: var(--b-ButtonWarningBg); --bd: var(--b-StateWarningBorder); --fg: var(--b-ButtonWarningText); --hbg: var(--b-ButtonWarningHoverBg); --hbd: var(--b-StateWarningBorder); --hfg: var(--b-ButtonWarningText); --on-bg: var(--b-ButtonWarningHoverBg); --on-bd: var(--b-StateWarningBorder); --on-fg: var(--b-ButtonWarningText); --pbg: var(--b-ButtonWarningPressedBg); --pbd: var(--b-StateWarningBorder); }
.hd-toggle.v-danger { --bg: var(--b-ButtonDangerBg); --bd: var(--b-StateDangerBorder); --fg: var(--b-ButtonDangerText); --hbg: var(--b-ButtonDangerHoverBg); --hbd: var(--b-StateDangerBorder); --hfg: var(--b-ButtonDangerText); --on-bg: var(--b-ButtonDangerHoverBg); --on-bd: var(--b-StateDangerBorder); --on-fg: var(--b-ButtonDangerText); --pbg: var(--b-ButtonDangerPressedBg); --pbd: var(--b-StateDangerBorder); }
.hd-toggle.on .hd-face { background: var(--on-bg); border-color: var(--on-bd); color: var(--on-fg); }
.hd-toggle.on:hover:not(:disabled) .hd-face { background: color-mix(in srgb, var(--b-TextStrong) 6%, var(--on-bg)); border-color: var(--on-bd); color: var(--on-fg); }
.hd-toggle.v-primary.on:hover:not(:disabled) .hd-face { color: var(--b-ButtonTextHover); }
.hd-toggle:not(.on):hover:not(:disabled) .hd-face { background: var(--hbg); border-color: var(--hbd); color: var(--hfg); }
.hd-toggle:active:not(:disabled) .hd-face { background: var(--pbg); border-color: var(--pbd); }
/* Favorite = accepted borderless icon state */
.hd-toggle.fav .hd-face, .hd-toggle.fav:hover:not(:disabled) .hd-face, .hd-toggle.fav:active:not(:disabled) .hd-face, .hd-toggle.fav.on .hd-face { background: transparent; border-color: transparent; color: var(--b-TextMuted); }
.hd-toggle.fav.on .hd-face { color: var(--b-Accent); }
.hd-toggle.fav:hover:not(:disabled) .hd-face { color: var(--b-TextStrong); }
.hd-toggle.fav:disabled .hd-face { color: var(--b-ButtonDisabledText); }

/* ---------- Tabs ---------- */
.hd-tabs { display: flex; flex-direction: column; }
.hd-tabstrip { display: flex; align-items: flex-end; height: 29px; }
.hd-tab { position: relative; height: 27px; min-width: 49px; padding: 0 8px 0 0; display: flex; align-items: center; background: none; border: 1px solid transparent; border-radius: 0; color: var(--b-TabInactiveText); cursor: default; outline: none; }
.hd-tab-rail { width: 3px; align-self: stretch; margin: -1px 8px -1px -1px; background: var(--b-Accent); opacity: 0; }
.hd-tab-text { white-space: nowrap; }
.hd-tab > .hd-glyph { margin-right: 8px; }
/* the selected tab is 1 px taller downwards (it covers the surface border): keep the glyph on the same whole pixel */
.hd-tab.sel > .hd-glyph { margin-bottom: 1px; }
.hd-tab:disabled > .hd-glyph path { color: inherit; }
/* tab with a glyph (owner 2026-10-12): while not selected its glyph and title are dimmed together, hover shows them in full, the selected tab is full */
.hd-tab.ic:not(.sel):not(:disabled) > .hd-glyph, .hd-tab.ic:not(.sel):not(:disabled) > .hd-tab-text { opacity: .55; }
.hd-tab.ic:not(.sel):not(:disabled):hover > .hd-glyph, .hd-tab.ic:not(.sel):not(:disabled):hover > .hd-tab-text { opacity: 1; }
/* owner 2026-10-12: the pointer gives the picture and title their full brightness back; the plate behind stays, at half strength */
.hd-tab.ic:not(.sel):not(:disabled):hover::before { opacity: .5; }
.hd-tab:hover { color: var(--b-TabHoverText); }
.hd-tab:hover::before { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 27px; background: var(--b-TabHoverBg); z-index: -1; }
.hd-tab.sel { height: 29px; color: var(--b-TabActiveText); background: var(--b-PanelBg); border: 1px solid var(--b-TabActiveBorder); border-bottom: 0; margin-bottom: -1px; z-index: 2; }
.hd-tab.sel:hover::before { display: none; }
.hd-tab:disabled, .hd-tab:disabled:hover { color: var(--b-TextDisabled); }
.hd-tab:disabled:hover::before { display: none; }
.hd-tabsurface { position: relative; z-index: 1; background: var(--b-PanelBg); border: 1px solid var(--b-TabActiveBorder); }

/* ---------- Scroll area ---------- */
.hd-sa { position: relative; display: flex; min-height: 0; min-width: 0; }
.hd-sa-view { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.hd-sa-view::-webkit-scrollbar { display: none; }
.hd-sa-bar { position: relative; flex: none; width: 8px; }
.hd-sa-thumb { position: absolute; left: 2px; width: 4px; border-radius: 2px; background: var(--b-ScrollThumb); transition: background-color 140ms; }
.hd-sa-bar:hover .hd-sa-thumb, .hd-sa-thumb.drag { background: var(--b-ScrollThumbHover); }
/* Hd.Scroll allowHorizontal: opt-in two-axis viewport, same track and thumb as the vertical scroll. */
.hd-sa-xy { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: minmax(0,1fr) auto; }
.hd-sa-xy > .hd-sa-view { grid-column: 1; grid-row: 1; }
.hd-sa-xy > .hd-sa-bar { grid-column: 2; grid-row: 1; }
.hd-sa-bar-x { position: relative; grid-column: 1; grid-row: 2; height: 8px; min-width: 0; }
.hd-sa-thumb-x { position: absolute; top: 2px; height: 4px; border-radius: 2px; background: var(--b-ScrollThumb); transition: background-color 140ms; }
.hd-sa-bar-x:hover .hd-sa-thumb-x, .hd-sa-thumb-x.drag { background: var(--b-ScrollThumbHover); }

/* ---------- Logo ---------- */
.hd-logo-a { fill: var(--b-Accent); }
.hd-logo-s { fill: var(--b-Muted); }
.hd-logo-clip { overflow: hidden; }

/* ---------- form row ---------- */
.hd-formrow { display: flex; align-items: center; gap: 8px; }
.hd-fr-l { flex: none; }
.hd-formrow > :last-child { margin-left: auto; }

/* ---------- combo ---------- */
.hd-combo { position: relative; height: 25px; display: flex; align-items: center; font-size: var(--m-FontSize-Input); color: var(--b-ComboText); cursor: default; outline: none; }
.hd-combo-frame { position: relative; flex: 1; min-width: 0; height: 25px; display: flex; background: var(--b-ComboBg); border: 1px solid var(--b-ComboBorder); border-radius: var(--m-Corner-Control); transition: background-color var(--m-Motion-ComboHoverOut), border-color var(--m-Motion-ComboHoverOut); }
.hd-combo.tall, .hd-combo.tall > .hd-combo-frame { height: 31px; } /* face with 19 px icons */
.hd-combo-text { flex: 1; min-width: 0; padding: 0 0 1px 7px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-combo-btn { width: 24px; display: flex; align-items: center; justify-content: center; color: var(--b-ComboGlyph); }
.hd-combo-arrow { margin-left: 1px; } /* 9 px arrow in a 24 px cell: whole pixel, as WPF layout rounding */
.hd-combo:hover:not(.disabled) .hd-combo-frame, .hd-combo.open .hd-combo-frame { background: var(--b-ComboHoverBg); border-color: var(--b-ComboHoverBorder); transition-duration: var(--m-Motion-ComboHoverIn); }
.hd-combo:hover:not(.disabled) .hd-combo-btn, .hd-combo.open .hd-combo-btn { color: var(--b-ComboHoverGlyph); }
.hd-combo:focus-visible .hd-combo-frame { border-color: var(--b-ComboHoverBorder); }
.hd-combo.disabled { color: var(--b-ComboDisabled); }
.hd-combo.disabled .hd-combo-frame { border-color: var(--b-ButtonDisabledBorder); }
.hd-combo.disabled .hd-combo-btn { color: var(--b-ComboDisabled); }
/* HdComboBoxTemplate popup: one square opaque rectangle over the combo (VerticalOffset 0), 1 px PopupBorder,
   27 px anchor row (ComboAnchorBg, selected text, arrow turned up), 27 px rows RowA/RowB, hover ComboRowHover,
   content padding 6,0,4,1 (Thickness.ComboContentPadding); no inner separators, no accent outline. */
.hd-popup { position: absolute; left: 0; top: -1px; z-index: 50; box-sizing: border-box; background: var(--b-ComboRowA); border: 1px solid var(--b-PopupBorder); box-shadow: 0 2px 8px var(--c-PopupShadow); max-height: 245px; overflow-x: hidden; overflow-y: auto; }
.hd-popup-anchor { position: sticky; top: 0; height: 27px; display: flex; align-items: center; padding: 0 0 1px 6px; background: var(--b-ComboAnchorBg); color: var(--b-ComboActiveText); white-space: nowrap; }
.hd-popup-anchor > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hd-popup-anchor > svg { flex: none; margin: 1px 10px 0 8px; color: var(--b-ComboActiveGlyph); }
.hd-popup-row { height: 27px; box-sizing: border-box; display: flex; align-items: center; padding: 0 4px 1px 6px; white-space: nowrap; color: var(--b-ComboText); background: var(--b-ComboRowA); transition: background-color var(--m-Motion-ComboHoverOut); }
.hd-popup-row.alt { background: var(--b-ComboRowB); }
.hd-popup-row:hover { background: var(--b-ComboRowHover); transition-duration: var(--m-Motion-ComboHoverIn); }
.hd-popup-row.sel { color: var(--b-ComboActiveText); }

/* reference renders were captured before the 160 ms selected-tab fade ran: ?ref=1 shows that state */
.hd-tabs.nofade .hd-tab.sel { background: none; border-color: transparent; }
.hd-tabs.nofade .hd-tab.sel .hd-tab-rail { opacity: 0 !important; }
.hd-tab.sel .hd-tab-rail { opacity: 1; }
/* WPF renders grayscale text; a compositing layer disables Chromium's LCD antialiasing */
.hdui { will-change: transform; }

/* ---- selection controls ---- */
.hd-sel { display: inline-flex; align-items: center; height: 25px; color: var(--b-Text); cursor: default; position: relative; font-size: 11px; }
.hd-sel-glyph { position: relative; width: 17px; height: 17px; flex: none; display: block; }
.hd-sel.large .hd-sel-glyph { width: 19px; height: 19px; }
.hd-sel-text { margin: 0 0 1px 6px; white-space: nowrap; }
.hd-sel-icon { flex: none; margin-left: 6px; }
.hd-sel.has-icon .hd-sel-text { margin-left: 4px; }
.hd-sel-halo { position: absolute; inset: 0; box-sizing: border-box; border: 2px solid var(--b-SliderHalo); opacity: 0; transition: opacity var(--m-Motion-HoverOut) ease; }
.hd-sel:hover .hd-sel-halo { opacity: 1; transition-duration: var(--m-Motion-HoverIn); }
.hd-cb-box { position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; box-sizing: border-box; border: 1px solid var(--b-SelectionControlBorder); background: var(--b-CheckBg); }
.hd-sel.large .hd-cb-box { width: 15px; height: 15px; }
.hd-cb-box.sq { border-radius: 1px; }
.hd-cb-mark { position: absolute; left: -1px; top: -1px; }
.hd-cb-check { stroke: var(--b-CheckMarkOn); display: none; }
.hd-cb.mark-large .hd-cb-check { stroke: var(--b-SelectionControlLargeMark); }
.hd-cb-sq, .hd-cb-mixed { fill: var(--b-CheckMarkOn); stroke: var(--b-CheckMarkOn); display: none; }
.hd-cb-mixed { fill: var(--b-CheckGhost); stroke: var(--b-CheckGhost); }
.hd-cb[data-state="on"].mark-check .hd-cb-check, .hd-cb[data-state="on"].mark-large .hd-cb-check { display: block; }
.hd-cb[data-state="on"].mark-square .hd-cb-sq { display: block; }
.hd-cb[data-state="mixed"] .hd-cb-mixed { display: block; }
.hd-cb:hover .hd-cb-box { border-color: var(--b-SelectionControlHoverBorder); background: var(--b-InputHoverBg); }
.hd-cb:hover[data-state="on"].mark-check .hd-cb-check { stroke: var(--b-CheckMarkHover); }
.hd-cb:hover[data-state="on"].mark-large .hd-cb-check { stroke: var(--b-SelectionControlLargeHoverMark); }
.hd-rb-ring { position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; box-sizing: border-box; border-radius: 50%; border: 1px solid var(--b-SelectionControlBorder); background: var(--b-CheckBg); display: flex; align-items: center; justify-content: center; }
.hd-sel.large .hd-rb-ring { width: 15px; height: 15px; }
.hd-rb .hd-sel-halo { border-radius: 50%; }
.hd-rb-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--b-CheckMarkOn); display: none; }
.hd-sel.large .hd-rb-dot { width: 7px; height: 7px; }
.hd-rb[data-state="on"] .hd-rb-dot { display: block; }
.hd-rb:hover .hd-rb-ring { border-color: var(--b-SelectionControlHoverBorder); background: var(--b-InputHoverBg); }
.hd-sel.disabled { color: var(--b-DisabledStroke); }
.hd-sel.disabled .hd-sel-halo { display: none; }
.hd-sel.disabled .hd-cb-box, .hd-sel.disabled .hd-rb-ring { border-color: var(--b-SelectionControlDisabled); background: var(--b-DisabledSurface); }
.hd-sel.disabled .hd-cb-check { stroke: var(--b-SelectionControlDisabled) !important; }
.hd-sel.disabled .hd-cb-sq, .hd-sel.disabled .hd-cb-mixed { fill: var(--b-SelectionControlDisabled); stroke: var(--b-SelectionControlDisabled); }
.hd-sel.disabled .hd-rb-dot { background: var(--b-SelectionControlDisabled); }
/* ---- switch ---- */
.hd-sw { position: relative; display: block; flex: none; width: 25px; height: 21px; }
.hd-sw.large { width: 28px; height: 15px; }
.hd-sw.square { width: 28px; height: 15px; }
.hd-sw-track, .hd-sw-ring { position: absolute; left: 50%; top: 50%; width: 17px; height: 9px; margin: -4.5px 0 0 -8.5px; box-sizing: border-box; border-radius: 999px; }
.hd-sw-track { border: 1px solid var(--b-SelectionControlBorder); background: var(--b-SwitchTrackOff); }
.hd-sw-ring { border: 1px solid var(--b-Accent); background: var(--b-SwitchHoverRingBg); opacity: 0; transition: opacity var(--m-Motion-HoverOut) ease; }
.hd-sw:hover .hd-sw-ring { opacity: 1; transition-duration: var(--m-Motion-HoverIn); }
.hd-sw-thumb { position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; box-sizing: border-box; border-radius: 50%; border: 1px solid var(--b-SelectionControlBorder); background: var(--b-SwitchThumbOff); transform: translateX(-5px); transition: transform var(--m-Motion-HoverIn) ease; }
.hd-sw[data-state="on"] .hd-sw-thumb { background: var(--b-SwitchThumbOn); transform: translateX(5px); }
.hd-sw:hover .hd-sw-thumb { border-color: var(--b-SwitchHoverThumbStroke); }
.hd-sw.large .hd-sw-track, .hd-sw.large .hd-sw-ring { width: 25px; height: 13px; margin: -6.5px 0 0 -12.5px; }
.hd-sw.large .hd-sw-thumb { width: 12px; height: 12px; margin: -6px 0 0 -6px; transform: translateX(-6px); }
.hd-sw.large[data-state="on"] .hd-sw-thumb { transform: translateX(6px); background: var(--b-SwitchThumbOnLarge); }
/* ProjectingSquare (ToggleSwitch.LargeTemplate): track 28x15 r3.5, square thumb 11 r2.5, left 2 -> 15 */
.hd-sw.square .hd-sw-track, .hd-sw.square .hd-sw-ring { width: 28px; height: 15px; margin: -7.5px 0 0 -14px; border-radius: 3.5px; }
.hd-sw.square .hd-sw-thumb { border-radius: 2.5px; border-color: var(--b-SwitchThumbOffBorder); transform: translateX(-6.5px); }
.hd-sw.square[data-state="on"] .hd-sw-thumb { border-color: var(--b-SwitchThumbOnBorder); transform: translateX(6.5px); }
/* HdChoiceCard: 63 px card, icon 25 at 7,7, radio 17 top-right, caption bottom-left */
.hd-ccs { display: flex; gap: 8px; }
.hd-cc { position: relative; flex: 1 1 0; min-width: 0; height: 63px; box-sizing: border-box; padding: 0; font: inherit; text-align: left; cursor: default; border: 1px solid var(--b-SelectionControlBorder); border-radius: 6px; background: var(--c-HDTools-UI-Color-Opening-CardBg); color: var(--c-HDTools-UI-Color-Opening-ChoiceOffText); transition: border-color var(--m-Motion-HoverOut) ease; }
.hd-cc:hover { border-color: var(--b-SelectionControlHoverBorder); transition-duration: var(--m-Motion-HoverIn); }
.hd-cc.on { color: var(--b-Text); }
.hd-cc-ic { position: absolute; left: 7px; top: 7px; width: 25px; height: 25px; }
.hd-cc-rb { position: absolute; right: 10px; top: 11px; width: 17px; height: 17px; box-sizing: border-box; border-radius: 50%; border: 1px solid var(--b-SelectionControlBorder); background: var(--b-CheckBg); display: flex; align-items: center; justify-content: center; }
.hd-cc:hover .hd-cc-rb { border-color: var(--b-SelectionControlHoverBorder); }
.hd-cc.on .hd-cc-rb { background: var(--c-HDTools-UI-Color-Opening-ChoiceOnBg); }
.hd-cc-dot { display: none; width: 9px; height: 9px; box-sizing: border-box; border-radius: 50%; border: 1px solid var(--b-SelectionControlBorder); background: var(--b-CheckMarkOn); }
.hd-cc.on .hd-cc-dot { display: block; }
.hd-cc-t { position: absolute; left: 7px; right: 7px; bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--m-FontSize-Body); }
.hd-cc-check { position: absolute; right: 10px; top: 11px; height: 17px; pointer-events: none; }
.hd-check-card:disabled { color: var(--b-SelectionControlDisabled); border-color: var(--b-SelectionControlDisabled); }
.hd-check-card:disabled .hd-glyph path { color: inherit; }
.hd-check-card:focus-visible { outline: 1px solid var(--b-SelectionControlHoverBorder); outline-offset: 2px; }

.hd-sw.disabled { opacity: .56; }
.hd-sw.disabled .hd-sw-track { border-color: var(--b-SelectionControlDisabled); }
.hd-sw.disabled .hd-sw-thumb { background: var(--b-SelectionControlDisabled); border-color: var(--b-SelectionControlDisabled); }
.hd-sw.disabled .hd-sw-ring { opacity: 0 !important; }
.hd-sw-row { display: flex; align-items: center; justify-content: space-between; min-height: 25px; }
/* spacing rule: a control and its own caption are 8 px apart (switch, check box, radio, slider label, form row); 4 px is only for buttons of one row */
.hd-sw-row { gap: 8px; }
.hd-sw-line { display: flex; align-items: center; gap: 8px; min-height: 25px; min-width: 0; }
.hd-sw-line > .hd-sw-cap { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.hd-sw-line.right > .hd-sw-cap { flex: 1 1 auto; }
/* ---- reveal ---- */
.hd-reveal { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--m-Motion-Reveal) cubic-bezier(.215,.61,.355,1), opacity var(--m-Motion-Reveal) cubic-bezier(.215,.61,.355,1); }
.hd-reveal.open { grid-template-rows: 1fr; opacity: 1; }
.hd-reveal-in { overflow: hidden; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .hd-reveal { transition: none; } }
/* ---- text box (25) / stepper family (29) ---- */
.hd-tb { box-sizing: border-box; height: 25px; border: 1px solid var(--b-SelectionControlBorder); background: var(--b-CheckBg); display: flex; min-width: 0; flex: 1 1 auto; }
.hd-tb.multi { height: 62px; }
.hd-tb.tall { height: 31px; } /* beside a tall combo (face with 19 px icons): one row = one height */
.hd-tb:hover, .hd-tb:focus-within { border-color: var(--b-InputActiveBorder); }
.hd-tb-in { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--b-InputText); font: 13px/1 "HDTahoma", Tahoma, sans-serif; padding: 0 6px; resize: none; }
.hd-tb.multi .hd-tb-in { padding: 4px 6px; line-height: 1.25; }
.hd-tb.ro { background: var(--b-DisabledSurface); }
.hd-tb.disabled { background: var(--b-DisabledSurface); border-color: var(--b-SelectionControlDisabled); }
.hd-tb.disabled .hd-tb-in { color: var(--b-DisabledStroke); }
.hd-tb.invalid { border-color: #d44; }
.hd-tb.stepper { height: 29px; }
.hd-tb.stepper .hd-tb-in { font-size: 15px; text-align: center; }
/* standard compact numeric up-down (WPF NumericUpDown.xaml): 25 px frame, 22+22 glyph cells, bars 10x2 */
.hd-num { box-sizing: border-box; display: flex; flex: none; height: 25px; min-width: 95px; border: 1px solid var(--b-NumericBorder); background: var(--b-NumericBg); }
.hd-num:hover { background: var(--b-NumericHoverBg); border-color: var(--b-InputActiveBorder); }
.hd-num:focus-within { background: var(--b-NumericFocusBg); border-color: var(--b-InputActiveBorder); }
.hd-num-in { flex: 1 1 0; width: 0; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--b-InputText); font: 13px/1 "HDTahoma", Tahoma, sans-serif; padding: 0 2px 0 6px; text-align: left; }
.hd-num:hover .hd-num-in, .hd-num:focus-within .hd-num-in { color: var(--b-InputActiveText); }
.hd-num > .hd-num-btn { position: relative; flex: none; width: 22px; height: 23px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--b-NumericGlyph); cursor: default; }
.hd-num > .hd-num-btn:hover { color: var(--b-NumericSpinButtonHoverGlyph); }
.hd-num > .hd-num-btn:active { color: var(--b-NumericSpinButtonActiveGlyph); }
.hd-num-h, .hd-num-v { position: absolute; background: currentColor; }
.hd-num-h { left: 6px; top: 11px; width: 10px; height: 2px; }
.hd-num-v { left: 10px; top: 7px; width: 2px; height: 10px; }
.hd-num.disabled { background: var(--b-DisabledSurface); border-color: var(--b-DisabledStroke); }
.hd-num.disabled .hd-num-in, .hd-num.disabled .hd-num-btn { color: var(--b-DisabledStroke); }
.hd-sn { display: flex; gap: 4px; height: 29px; flex: 1 1 auto; min-width: 0; }
.hd-sn-btn { width: 29px; height: 29px; box-sizing: border-box; padding: 0; border: 1px solid var(--b-SliderThumbStroke); background: var(--b-CheckBg); color: var(--b-InputGlyph); display: flex; align-items: center; justify-content: center; border-radius: 0; cursor: default; flex: none; }
.hd-sn-btn:hover { background: var(--b-InputHoverBg); border-color: var(--b-InputActiveBorder); }
.hd-sn-val { flex: 1; box-sizing: border-box; border: 1px solid var(--b-SliderThumbStroke); background: var(--b-CheckBg); display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--b-InputText); min-width: 0; }
.hd-sn.disabled { opacity: .5; }
/* ---- Hd.CountSlider (CountSlider.xaml): frame 29, tint 21 inset 3, marker 1x23, active marker 3x23 + 2 px halo ---- */
.hd-ss { position: relative; box-sizing: border-box; height: 29px; min-width: 95px; border: 1px solid var(--b-CountSliderBorder); background: var(--b-CountSliderBg); flex: 1 1 auto; overflow: hidden; cursor: default; }
.hd-ss-fill { position: absolute; top: 3px; height: 21px; background: var(--b-CountSliderLabelTint); }
.hd-ss-mark { position: absolute; top: 2px; height: 23px; width: 1px; background: var(--b-CountSliderMarker); }
.hd-ss-zero { position: absolute; top: 2px; height: 23px; width: 1px; background: var(--b-CountSliderSeparator); opacity: .5; }
.hd-ss-label, .hd-ss-value { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; font-size: 11px; pointer-events: none; white-space: nowrap; }
.hd-ss-label { left: 7px; right: 52px; overflow: hidden; text-overflow: ellipsis; color: var(--b-CountSliderLabelText); }
.hd-ss-value { right: 5px; width: 47px; justify-content: flex-end; color: var(--b-CountSliderValueText); }
.hd-ss:hover, .hd-ss.drag { background: var(--b-CountSliderHoverBg); border-color: var(--b-CountSliderHoverBorder); }
.hd-ss:hover .hd-ss-fill, .hd-ss.drag .hd-ss-fill { background: var(--b-CountSliderActiveTint); }
.hd-ss:hover .hd-ss-mark, .hd-ss.drag .hd-ss-mark { width: 3px; margin-left: -1px; background: var(--b-CountSliderMarkerActive); box-shadow: 0 0 0 2px var(--b-CountSliderMarkerHalo); }
.hd-ss:hover .hd-ss-value, .hd-ss.drag .hd-ss-value { color: var(--b-CountSliderHoverValue); }
.hd-ss.disabled, .hd-ss.disabled:hover { background: var(--b-CountSliderDisabledBg); border-color: var(--b-CountSliderDisabled); }
.hd-ss.disabled .hd-ss-fill { background: var(--b-CountSliderDisabledTint); }
.hd-ss.disabled .hd-ss-mark { width: 1px; margin-left: 0; box-shadow: none; background: var(--b-CountSliderDisabled); }
.hd-ss.disabled .hd-ss-label, .hd-ss.disabled .hd-ss-value { color: var(--b-CountSliderDisabled); }
/* ---- Hd.Slider (HdSliderRow + ClassicSlider.xaml): row 25, rail 1, active 3, thumb 13 in 21 hit, value box 47x19 ---- */
.hd-slrow { display: flex; align-items: center; gap: 8px; height: 25px; min-width: 160px; }
.hd-slrow-l { flex: none; color: var(--b-Text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-cs { position: relative; flex: 1 1 auto; min-width: 48px; height: 21px; cursor: default; }
.hd-cs-rail { position: absolute; left: 0; right: 0; top: 10px; height: 1px; background: var(--b-SliderBase); }
.hd-cs-act { position: absolute; left: 0; top: 9px; height: 3px; background: var(--b-SliderActive); }
.hd-cs-thumb { position: absolute; top: 4px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; box-sizing: border-box; background: var(--b-SliderThumbFill); border: 1px solid var(--b-SliderThumbStroke); }
.hd-cs:hover .hd-cs-rail { background: var(--b-SliderBaseHover); }
.hd-cs:hover .hd-cs-act { background: var(--b-SliderActiveHover); }
.hd-cs.drag .hd-cs-thumb { background: var(--b-SliderThumbFillHover); border-color: var(--b-SliderThumbStrokeHover); box-shadow: 0 0 0 4px color-mix(in srgb, var(--b-SliderHalo) 40%, transparent); }
.hd-slrow-v { flex: none; width: 47px; height: 19px; box-sizing: border-box; border: 1px solid var(--b-RangeBase); background: var(--b-NumericBg); color: var(--b-TextHeader); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.hd-slrow.disabled .hd-cs-rail, .hd-slrow.disabled .hd-cs-act { background: var(--b-SelectionControlDisabled); }
.hd-slrow.disabled .hd-cs-thumb { background: var(--b-SelectionControlDisabled); border-color: var(--b-SelectionControlDisabled); box-shadow: none; }
.hd-slrow.disabled .hd-slrow-l, .hd-slrow.disabled .hd-slrow-v { color: var(--b-DisabledStroke); }
/* ---- list ---- */
.hd-list { border: 1px solid var(--b-SelectionControlBorder); background: var(--b-CheckBg); box-sizing: border-box; overflow: auto; }
.hd-list-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; height: 22px; padding: 0 8px; font-size: 13px; color: var(--b-Text); }
.hd-list-row:hover { background: var(--b-InputHoverBg); }
.hd-list-row.sel { background: var(--b-SelectionBg); color: var(--b-SelectionText); }
.hd-list-row.muted { color: var(--b-DisabledStroke); text-decoration: line-through; }
.hd-list-b, .hd-list-c { color: var(--b-TextMuted); font-size: 11px; }

.hd-formrow { display: flex; align-items: center; gap: 8px; min-height: 25px; }
.hd-inline { font-size: 13px; color: var(--b-Text); padding: 0 6px; }
.hd-right { flex: 1; display: flex; justify-content: flex-end; }
.hd-nb { display: flex; align-items: center; box-sizing: border-box; width: 100px; height: 25px; border: 1px solid var(--b-SelectionControlBorder); background: var(--b-CheckBg); font-size: 13px; color: var(--b-InputText); }
.hd-nb:hover { border-color: var(--b-InputActiveBorder); }
.hd-nb-v { flex: 1; padding-left: 6px; } .hd-nb-s { width: 17px; text-align: center; color: var(--b-InputGlyph); font-size: 15px; }
.hd-nb.disabled { background: var(--b-DisabledSurface); border-color: var(--b-SelectionControlDisabled); color: var(--b-DisabledStroke); }

/* ---------- Window (HdWindow + HdTitleBar.xaml): 1 px OuterBorder, title bar 40 = 132 | * | 132, title centred 13 SemiBold, buttons 40x40 with 14 px glyph ---------- */
.hd-window { display: flex; flex-direction: column; box-sizing: border-box; border: 1px solid var(--b-OuterBorder); background: var(--b-WindowBg); overflow: hidden; }
.hd-titlebar { flex: none; height: 40px; display: grid; grid-template-columns: 132px minmax(80px, 1fr) 132px; align-items: center; background: var(--b-TitleBarBg); user-select: none; }

/* Native CompactTitleBar + LogoOnly, with a single close action. */
.hd-titlebar.compact { grid-template-columns:40px minmax(0,1fr) 40px; }
.hd-titlebar.compact .hd-titlebar-brand { width:24px; margin-left:8px; }
.hd-titlebar.compact .hd-titlebar-title { min-width:0; margin:0 8px; }
.hd-titlebar-brand { margin-left: 12px; width: 116px; height: 28px; overflow: hidden; display: flex; align-items: center; }
.hd-titlebar-title { margin: 0 16px; text-align: center; font-size: var(--m-FontSize-Title); font-weight: 600; line-height: 16px; color: var(--b-TitleBarTitle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-titlebar-btns { justify-self: end; display: flex; }
.hd-wbtn { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--b-TitleBarGlyph); display: flex; align-items: center; justify-content: center; cursor: default; transition: background-color var(--m-Motion-TitleBarHover); }
.hd-wbtn:hover { background: color-mix(in srgb, var(--b-Accent) 18%, transparent); }
.hd-wbtn.close:hover { background: var(--b-TitleBarCloseHoverBg); color: var(--b-TitleBarCloseGlyphActive); }
.hd-wbtn.close:active { background: var(--b-TitleBarClosePressBg); color: var(--b-TitleBarCloseGlyphActive); transition-duration: var(--m-Motion-TitleBarPress); }
.hd-win-header { flex: none; margin: 0 8px; }
.hd-win-footer { flex: none; margin: 0 8px 8px; }
.hd-win-body { flex: 1 1 auto; min-height: 0; margin: 8px; display: flex; gap: 8px; }
.hd-win-body.col { flex-direction: column; }
.hd-titlebar + .hd-win-body { margin-top: 0; }
/* framed bar: Hd.ActionsBar / Hd.StatusBar / Hd.HeaderBar content inside a level-3 frame (owner rule: nothing floats) */
.hd-bar { box-sizing: border-box; min-height: 32px; border: 1px solid var(--b-Level3Border); background: var(--b-Level3Bg); padding: 6px 8px; display: flex; align-items: center; gap: 8px; }
.hd-bar.actions { justify-content: flex-end; flex-wrap: wrap; }
.hd-grow { flex: 1 1 auto; min-width: 0; }
/* dialog = HdWindow with a close-only title bar, placed over its owner */
.hd-dialog { position: absolute; z-index: 50; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.hd-dialog-veil { position: absolute; inset: 0; z-index: 49; }
/* ---------- Hd.Menu (Shared.xaml ContextMenu + MenuItem): frame padding 4, row 24 = 20 | text (margin 8) | 12, hover Brush.Hover ---------- */
.hd-menu { position: absolute; z-index: 60; box-sizing: border-box; min-width: 120px; padding: 4px; background: var(--b-CollectionRowA); border: 1px solid var(--b-PopupBorder); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); user-select: none; }
.hd-menu-item { position: relative; height: 24px; display: flex; align-items: center; padding: 0 20px 0 28px; white-space: nowrap; color: var(--b-TextMuted); cursor: default; }
.hd-menu-item > .hd-icon { position: absolute; left: 7px; top: 5px; }
.hd-menu-item:hover { background: var(--b-Hover); }
.hd-menu-item.disabled, .hd-menu-item.disabled:hover { color: var(--b-DisabledStroke); background: transparent; }
.hd-menu-sep { height: 1px; margin: 3px 8px 3px 20px; background: var(--b-PanelBorder); opacity: .55; }

/* ===== 2026-10-11, round 4: check combo, category icons, key (static) sections, disabled segment ===== */
/* check rows (CreateCheckItemTemplate): square-mark checkbox, optional 19 px category icon (margin 0,0,6,0), text */
.hd-popup-row.check { cursor: default; padding-bottom: 0; }
.hd-popup-row.check > .hd-sel { flex: none; pointer-events: none; margin-right: 6px; }
.hd-popup-row.check > .hd-caticon { margin-right: 6px; }
.hd-popup-rt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-popup-search { height: var(--m-Size-Combo-SearchRow); box-sizing: border-box; display: flex; align-items: center; padding: 0 4px; background: var(--b-ComboSearchSectionBg); }
.hd-popup-search > .hd-tb { flex: 1 1 auto; height: var(--m-Size-Combo-SearchField); }
.hd-caticon { flex: none; display: block; color: #436199; }
.hdui[data-theme=dark] .hd-caticon { color: #9AB6F1; }
/* key section: always open, header is not a button */
.hd-level.d1.static > .hd-lv-head { cursor: default; }
/* an open combo list must not be cut by the section body (the body clips only for the collapse animation) */
.hd-lv-clip > .hd-lv-body:has(.hd-combo.open) { overflow: visible; }
/* disabled toggle (also the checked cell of a disabled segment) keeps the system disabled look */
.hd-toggle:disabled .hd-face, .hd-toggle.on:disabled .hd-face { background: var(--b-ButtonDisabledBg); border-color: var(--b-ButtonDisabledBorder); color: var(--b-ButtonDisabledText); }
/* combo list scrolls with the design-system scroll area (HdScrollViewer look), head rows stay fixed */
.hd-popup.sa { display: flex; flex-direction: column; overflow: hidden; }
.hd-popup.sa > .hd-popup-anchor, .hd-popup.sa > .hd-popup-search { flex: none; position: static; }
.hd-popup.sa > .hd-sa { flex: 1 1 auto; }

/* 2026-10-11 round 6: popup search row as in WPF (above the anchor row; glass at the right; "Только выбранное" check), level-header action buttons */
.hd-popup.srch { top: calc(-1px - var(--m-Size-Combo-SearchRow)); }
.hd-popup-search { padding: 0 6px; gap: 8px; } /* 6 = the row text inset: search, filter, rows and footer share one left edge */
.hd-popup-search > .hd-popup-only { flex: none; }
.hd-popup-search > .hd-tb { position: relative; background: var(--b-PopupSearchBg); border-color: var(--b-PopupSearchBorder); }
.hd-popup-search .hd-tb-in { padding: 0 24px 0 2px; }
.hd-popup-glass { position: absolute; right: 7px; top: 5px; color: var(--b-PopupSearchGlyph); pointer-events: none; }
.hd-lv-clip:has(.hd-combo.open) { overflow: visible; }
.hd-lv-actions:has(> .hd-btn) { gap: 4px; margin-right: 7px; } /* frame of the last button 8 from the section edge, as the title on the left */
.hd-lv-actions > .hd-btn.s-compact { height: 25px; min-height: 25px; } .hd-lv-actions > .hd-btn.s-compact.io { width: 25px; min-width: 25px; } /* never taller than the 25 px header */
/* a section that never collapses: as Hd.Section, its header actions end 4 px before the inner right edge of the frame (measured in WPF 2026-10-12) */
.hd-level.static > .hd-lv-head .hd-lv-actions { margin-right: 4px; }

/* 2026-10-11 round 7: level header without the accent rail (HDUI.level(..., { rail: false })) */
.hd-level.norail > .hd-lv-head { margin-left: 0; padding-left: 8px; }
.hd-seg > .hd-btn.cw.s-compact:not(.io) .hd-face { padding-left: 0; padding-right: 0; width: 100%; box-sizing: border-box; justify-content: center; text-align: center; }

/* 2026-10-11 round 8: tool-panel lists use the Body size (11), same as the buttons beside them (owner's word).
   Put class hd-panel-text on the panel root; the popup rows inherit it. */
.hd-panel-text .hd-combo { font-size: var(--m-FontSize-Body); }
.hd-panel-text .hd-combo-text { padding-bottom: 0; } /* 11 px line on whole pixels, same baseline as the 12 px button text beside it */
.hd-panel-text .hd-popup-anchor, .hd-panel-text .hd-popup-row { padding-bottom: 0; }
.hd-panel-text .hd-popup-search .hd-tb-in { font-size: var(--m-FontSize-Body); }
.hd-panel-text .hd-btn.s-compact { font-size: var(--m-FontSize-Body); } /* panel buttons = panel lists = captions: 11 */
.hd-panel-text .hd-btn.s-compact .hd-face > .hd-bt:only-child { padding-bottom: 1px; } /* text-only face: 13 px line in 24 -> whole pixel, same row as icon buttons */

/* 2026-10-11 round 9: leading 15 px glyph of a combo (HDUI.combo {icon}); 8 px from the frame edge, 8 px to the text */
.hd-combo-ic { flex: none; align-self: center; margin: 0 0 0 7px; }
.hd-combo.ic .hd-combo-text { padding-left: 8px; }
.hd-popup-anchor > .hd-combo-ic { margin: -2px 8px 0 1px; } /* same pixel as on the closed frame */

/* check combo (2026-10-12, owner): icons on the closed face, framed footer with «Готово» */
.hd-combo-face { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.hd-combo-face.icons { gap: 8px; }
.hd-combo-fi { display: flex; align-items: center; gap: 4px; min-width: 0; }
.hd-combo-fi > span { flex: none; }
.hd-combo-face.icons .hd-combo-fi { gap: 1px; }
.hd-combo-face .hd-caticon { flex: none; }
.hd-popup-anchor .hd-caticon { color: inherit; }
/* tall check combo (owner 2026-10-13): the 19 px icons sit on whole pixels (5 px above and below), and the anchor row of the opened
   list repeats the closed face pixel for pixel: same height, same left edge, so the icons do not jump when the list opens */
.hd-combo.tall .hd-combo-text { padding-bottom: 0; }
.hd-combo.tall .hd-popup-anchor { height: 31px; box-sizing: border-box; padding: 1px 0 1px 7px; }
.hd-combo.tall .hd-popup-anchor > svg { margin: 0 7px 0 8px; }   /* the arrow stays on the pixel of the closed arrow */
.hd-popup-foot-gap { flex: 1 1 auto; }
.hd-popup-groups { flex: none; padding: 0 6px 4px; background: var(--b-ComboSearchSectionBg); }
.hd-popup-foot { flex: none; display: flex; align-items: center; padding: 4px 6px; background: var(--b-ComboSearchSectionBg); border-top: 1px solid var(--b-PopupBorder); }
.hd-popup:has(> .hd-popup-foot) { max-height: 312px; }


/* IconCombo: native combo surfaces with authored pictures (not scaled icons). */
.hd-combo.hd-iconcombo, .hd-iconcombo .hd-combo-frame { height: 31px; }
.hd-combo.hd-iconcombo.large, .hd-iconcombo.large .hd-combo-frame { height: 39px; }
.hd-iconcombo .hd-combo-text { padding-top: 0; padding-bottom: 0; }
.hd-rich-content { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hd-rich-content > svg { flex: none; }
.hd-rich-caption { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hd-iconcombo .hd-popup-anchor { height: 33px; }
.hd-iconcombo.large .hd-popup-anchor { height: 41px; }
.hd-iconcombo .hd-popup-row { height: 31px; padding-top: 0; padding-bottom: 0; }
.hd-iconcombo.large .hd-popup-row { height: 39px; }
.hd-iconcombo.no-arrow .hd-combo-btn { display: none; }
.hd-iconcombo.icon-only .hd-combo-text { justify-content: center; padding: 0; }
.hd-combo.hd-iconcombo.compact { height: 29px; }
.hd-iconcombo.compact .hd-combo-frame { height: 25px; }
.hd-iconcombo.compact .hd-popup-anchor { height: 27px; }
.hd-iconcombo.compact .hd-popup-row { height: 22px; }
.hd-iconcombo-portal { display: block; position: fixed; z-index: 1000; background: none; }

/* HDColorPickerControl web selection core; see hdui-color.js for the native source. */
.hd-color-swatch { flex: none; padding: 0; border: 1px solid var(--b-ComboBorder); border-radius: 3px; cursor: pointer; outline: none; }
.hd-color-swatch:hover, .hd-color-swatch:focus-visible { border-color: var(--b-Accent); }
.hd-color-picker { box-sizing: border-box; width: 508px; padding: 7px; border: 1px solid var(--b-PanelBorder); background: var(--b-Level2Bg); display: grid; grid-template-columns: 196px 84px 196px; grid-template-rows: 20px 196px auto; gap: 8px; }
.hd-color-picker > .hd-label { align-self: center; font-size: 10px; white-space: nowrap; }
.hd-color-preview { display: flex; height: 20px; border: 1px solid var(--b-NumericBorder); }
.hd-color-preview > * { flex: 1; border: 0; min-width: 0; height: 18px; }
.hd-color-history { display: grid; grid-template-columns: repeat(9,20px); gap: 2px; }
.hd-color-cell { display: block; box-sizing: border-box; width: 20px; height: 20px; padding: 0; border: 1px solid var(--b-NumericBorder); cursor: pointer; outline: none; }
.hd-color-cell:hover, .hd-color-cell:focus-visible, .hd-color-cell.selected { box-shadow: inset 0 0 0 1px #fff, inset 0 0 0 2px #111; }
.hd-color-pad { position: relative; box-sizing: border-box; width: 196px; height: 196px; border: 1px solid var(--b-NumericBorder); background: linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,transparent),var(--hd-picker-hue); touch-action: none; cursor: crosshair; outline: none; }
.hd-color-pad-ring { position: absolute; box-sizing: border-box; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 1px solid #fff; border-radius: 50%; box-shadow: inset 0 0 0 2px #111; pointer-events: none; }
.hd-color-sliders { display: flex; justify-content: space-around; }
.hd-color-track { position: relative; width: 20px; height: 196px; touch-action: none; outline: none; }
.hd-color-track-fill { position: absolute; left: 6px; top: 0; width: 8px; height: 196px; border: 1px solid var(--b-NumericBorder); box-sizing: border-box; }
.hd-color-track:first-child .hd-color-track-fill { background: linear-gradient(to top,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00); }
.hd-color-knob { position: absolute; left: 0; width: 20px; height: 8px; margin-top: -4px; border: 1px solid var(--b-RangeBase); background: var(--b-SliderThumbFill); box-sizing: border-box; pointer-events: none; }
.hd-color-pad:focus-visible, .hd-color-track:focus-visible { outline: 1px solid var(--b-Accent); outline-offset: 2px; }
.hd-color-palette { display: grid; grid-template-columns: repeat(9,20px); grid-auto-rows: 20px; gap: 2px; align-content: start; }
.hd-color-fields { grid-column: 1 / -1; display: grid; grid-template-columns: 84px 196px 196px; gap: 8px; }
.hd-color-field-group { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.hd-color-field-group > .hd-label { text-align: center; }
.hd-color-field-group .hd-row { gap: 8px; }
.hd-color-field-group .hd-tb { min-width: 0; flex: 1; }
.hd-color-field-group input { width: 100%; min-width: 0; text-align: center; }


/* Narrow browser panes: retain native drawing sizes; stack and use HDUI scroll. */
.hd-color-scroll { height: 100%; min-height: 0; }
@media (max-width: 541px) {
  .hd-color-picker { width: 100%; grid-template-columns: 196px 84px; grid-template-rows: 20px 196px 20px 152px auto; justify-content: center; }
  .hd-color-picker > .hd-color-preview { grid-area: 1 / 1; }
  .hd-color-picker > .hd-label { grid-area: 3 / 2; }
  .hd-color-picker > .hd-color-history { grid-area: 3 / 1; }
  .hd-color-picker > .hd-color-pad { grid-area: 2 / 1; }
  .hd-color-picker > .hd-color-sliders { grid-area: 2 / 2; }
  .hd-color-picker > .hd-color-palette { grid-area: 4 / 1 / 5 / 3; justify-self: center; }
  .hd-color-picker > .hd-color-fields { grid-area: 5 / 1 / 6 / 3; grid-template-columns: 84px 196px; }
  .hd-color-picker .hd-color-field-group:last-child { grid-column: 1 / -1; width: 196px; justify-self: center; }
}

/* Single-column list: its owner supplies HDUI.scrollArea. */
.hd-list.single { overflow: visible; }
.hd-list.single .hd-list-row { grid-template-columns: minmax(0,1fr); }
.hd-list.single .hd-list-a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Large section header with icon (HDUI.level o.icon; accepted by Pavel 2026-10-17): 31 px, 19 px icon on whole pixels (6 px above/below), 8 px to the title */
.hd-level.big > .hd-lv-head { height: 31px; }
.hd-level.big > .hd-lv-head > .hd-lv-icon { margin-right: 8px; }
.hd-level.big > .hd-lv-head > .hd-lv-title { font-size: 12px; font-weight: bold; }
.hd-level.big > .hd-lv-head .hd-lv-actions > .hd-btn.s-compact { height: 25px; }


/* Editable centre of the NumberStepper; edge cells and theme stay shared. */
.hd-sn-caption{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--b-CountSliderLabelText)}
.hd-sn-val:has(.hd-sn-editor){padding:0 4px;gap:4px}
.hd-sn-editor{box-sizing:border-box;min-width:0;width:47px;max-width:100%;flex:0 1 47px;border:0;outline:0;background:transparent;color:inherit;font:inherit;text-align:center;padding:0}
.hd-sn-val:focus-within{border-color:var(--b-InputActiveBorder)}

/* Icon list in the shared 29px stepper family. Popup remains an independent portal. */
.hd-combo.hd-iconcombo.stepper,.hd-iconcombo.stepper .hd-combo-frame{height:29px}

/* Button-faced IconCombo composes the real secondary button, preserving its popup. */
.hd-combo.hd-iconcombo.button-face{height:31px}
.hd-iconcombo.button-face>.hd-combo-frame{display:none}
.hd-iconcombo-trigger{position:relative;width:100%}
.hd-iconcombo-trigger>.hd-chevron{position:absolute;right:8px;top:13px;width:9px;height:5px;pointer-events:none}
.hd-iconcombo-trigger>.hd-face{padding-right:24px}


/* Compact working controls: one type scale, surface and one-pixel frame.
   Opt-in: ordinary forms and existing consumers retain their own metrics. */
[data-control-density="compact-tool"]{font-size:var(--m-FontSize-Body);font-weight:normal}
.hd-sn[data-control-density="compact-tool"]{flex:none}
.hd-sn[data-control-density="compact-tool"] .hd-sn-val,
.hd-sn[data-control-density="compact-tool"] .hd-sn-btn,
.hd-ss[data-control-density="compact-tool"]{
 background:var(--b-ButtonSecondaryBg);border:1px solid var(--b-ButtonSecondaryBorder);
 color:var(--b-ButtonSecondaryText);border-radius:var(--m-Corner-Button);
 font-size:var(--m-FontSize-Body);font-weight:normal;
}
.hd-sn[data-control-density="compact-tool"] .hd-sn-btn,
.hd-sn[data-control-density="compact-tool"] .hd-sn-btn:hover,
.hd-sn[data-control-density="compact-tool"] .hd-sn-btn:active{color:var(--b-ButtonDisabledText)}
.hd-sn[data-control-density="compact-tool"] .hd-sn-caption,
.hd-ss[data-control-density="compact-tool"] .hd-ss-label,
.hd-ss[data-control-density="compact-tool"] .hd-ss-value{font-size:var(--m-FontSize-Body);font-weight:normal;color:var(--b-ButtonSecondaryText)}
.hd-sn[data-control-density="compact-tool"] .hd-sn-editor{font-weight:normal}
.hd-sn[data-control-density="compact-tool"] .hd-sn-btn:hover,
.hd-ss[data-control-density="compact-tool"]:hover{background:var(--b-ButtonSecondaryHoverBg)}
.hd-sn[data-control-density="compact-tool"] .hd-sn-val:focus-within{border-color:var(--b-InputActiveBorder)}
.hd-slide[data-control-density="compact-tool"] .hd-slide-track{background:var(--b-ButtonSecondaryBg)}
.hd-slide[data-control-density="compact-tool"] .hd-slide-thumb{top:6px;height:19px}

[data-control-density=compact-tool] .hd-bt{font-size:var(--m-FontSize-Body);font-weight:normal}

/* Opt-in equal picture insets. 21px specimen canvas stays at its authored size. */
.hd-combo.hd-iconcombo.picture-padded,
.hd-iconcombo.picture-padded .hd-combo-frame { height:calc(21px + 2 * var(--hd-picture-padding)); }
.hd-iconcombo.picture-padded .hd-combo-text { padding:0 0 0 calc(var(--hd-picture-padding) - 1px); }
.hd-iconcombo.picture-padded .hd-popup-row { height:calc(21px + 2 * var(--hd-picture-padding)); padding:0 var(--hd-picture-padding); }
.hd-iconcombo.picture-padded .hd-rich-content { gap:var(--hd-picture-padding); }