/* ==========================================================================================
   callback-widget.css  -  ttisi.ru, callback widget v6.4 (v6.3 two-state trigger, icon-only A, clamped FAB, 3 separate consents) (name + phone + 2 required consents + optional call time)
   FINAL build for deploy review. CALLBACK L2 (04), 2026-10-11. Base = SITE-BUILDING v6.1 stylesheet (accepted).

   VISUAL SOURCE (authoritative): shared/design-registry/organisms-write/org-modal-callback.v6.2-final.json
     frame 584 wide, padding 56, rowGap 24, fill grey_100 (#ebf1f4), radius borderRadius_l
     title header_44_bold / lead header_20_bold / white card (pad 24, gap 24, neumorphism_dropShadow_buttonHover)
     card rows: time slot (link 16 | picker 56) -> Имя 56 -> phone 56 -> checkbox#1 (PDP label, wraps ~5 lines) -> checkbox#2 (24) -> submit 56 (left, 274)
     LAYOUT IS FLOW: nothing pins a container height; the reference frames (584x800 collapsed / 584x840 expanded) are the result of the
     content, not an input. Only the CONTROLS keep their kit heights (fields/selects/buttons 56, triggers 40).
     text field = "Text field/L/no title": 56 high, 1px elementBorderActive, radius S, text body_14_medium grey_700
     2 x Checkbox/M 24px (check_box_outline_blank, grey_500) + body_12_regular label, gap 12
     select = "Select/L/No title": white, 1px grey_600, radius S, padding 16, body_14_medium grey_700, chevron grey_600
     submit = Button/fill/L 56 high, buttonFullActive (#476d85), radius M, body_16_medium white, LEFT aligned
   TRIGGERS (v6.4, CALLBACK L2, 2026-10-20): ONE logical button in TWO exclusive states - A = LARGE in-flow ICON-ONLY handset in the header slot
             (56x56), B = SMALLER position:fixed FAB (48x48, icon only), visible only while A is scrolled out of view.
             Kit look: #476d85, radius 5, white `call` icon.
             The icon is the WHITE kit `call` (inline SVG, fill=currentColor, colour = --pp-buttonfulltextcolor = white).

   TOKENS: every colour / size / type value is var(--pp-*) from penpot-tokens.css, which MUST be loaded on the page
   (prod: /opt/ttisi-site/src/styles/penpot-tokens.css). No hex, no foreign palette.
   The only non-var colour literal is ONE rgb() inside --cbw-shadow-neu: Penpot's composite shadow
   neumorphism_dropShadow_buttonHover is not exposable as a single --pp-* variable (see tokens.css footer),
   its values are copied verbatim from penpot-tokens-snapshot-2026-10-04.json.

   SITE HOOKS (all optional custom properties):
     --cbw-fab-edge / --cbw-fab-bottom / --cbw-content-max / --cbw-fab-radius   state-B sticky FAB placement (v6.4 formula in the trigger block)
     --cbw-menu-radius                                                    state-A corner radius
     --cbw-trigger-font                                                   font of the labelled menu trigger
     --cbw-link-color                                                     colour of the consent-label links (default: inherit + underline)

   NOT drawn in Penpot (derived from kit tokens, spec F5/F6): checked / hover / focus / invalid states,
   success / error / rejected views, mobile (<=640px) scale, the triggers' hover/focus, the "Позвонить сейчас" way back
   (non-canon), the slots loading / unavailable note, the picker row below 480px (stacked here).
   ========================================================================================== */

.cbw,
.cbw-trigger {
  /* widget-local layout constants (not colours, no Penpot token exists for them) */
  --cbw-z: 9000;                 /* stacking of the floating trigger; the <dialog> itself uses the top layer */
  /* Penpot composite neumorphism_dropShadow_buttonHover: [-2 -2 4 0 white] + [2 2 4 0 #c3d0dd66] */
  --cbw-shadow-neu: -2px -2px 4px 0 var(--pp-colors-additional-white), 2px 2px 4px 0 rgb(195 208 221 / 0.4);
}

.cbw {
  --cbw-modal-w: 584px;          /* frame width (collapsed 584x785 / expanded 584x825) */
  --cbw-motion: 200ms;           /* time-section height transition (contract $disclosure.motion) */

  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; /* fontFamily_montserrat */
  color: var(--pp-colors-grey-black-800);
  -webkit-text-size-adjust: 100%;
}

/* resets use :where() = zero specificity, so every single-class rule below wins regardless of order */
:where(.cbw) *,
:where(.cbw) *::before,
:where(.cbw) *::after,
:where(.cbw-trigger),
:where(.cbw-trigger) *,
:where(.cbw-trigger) *::before,
:where(.cbw-trigger) *::after { box-sizing: border-box; }

.cbw [hidden] { display: none !important; }

:where(.cbw) button,
:where(.cbw) input,
:where(.cbw) select { font: inherit; color: inherit; margin: 0; }

:where(.cbw) h2,
:where(.cbw) h3,
:where(.cbw) p { margin: 0; }

/* ---------------------------------------------------------------- TRIGGERS  (Button/fill/M, #476d85, radius 5, white call icon)
   Both are plain <button data-cbw-open>, independent of where the layout step puts them. `hidden` until the script has wired
   them (no dead trigger without JS); the display rule below must not win over [hidden]. */
.cbw-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--pp-spacing-8);
  height: var(--pp-sizing-40);
  margin: 0;
  padding: var(--pp-spacing-8) var(--pp-spacing-16);     /* kit Button/fill/M: 8 / 16 */
  border: 0;
  border-radius: var(--pp-borderradius-m);               /* radius 5 */
  background: var(--pp-buttonfullactive);                /* #476d85 */
  color: var(--pp-buttonfulltextcolor);                  /* white -> the icon (fill=currentColor) is WHITE */
  /* Penpot draws the header button label in Raleway 14/500; the page's own header font wins if it sets --cbw-trigger-font */
  font-family: var(--cbw-trigger-font, "Raleway", "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  font-size: var(--pp-fontsize-14);
  font-weight: var(--pp-fontweight-medium);
  line-height: var(--pp-lineheight-1-6);
  letter-spacing: var(--pp-letterspacing-0);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.cbw-trigger[hidden] { display: none; }

.cbw-trigger:hover  { background: var(--pp-buttonfullhover); box-shadow: var(--cbw-shadow-neu); }
.cbw-trigger:active { background: var(--pp-buttonfullpressed); box-shadow: none; }

.cbw-trigger:focus-visible {
  outline: var(--pp-borderwidth-2) solid var(--pp-buttonfullpressed);
  outline-offset: var(--pp-spacing-2);
}

.cbw-trigger__icon {
  display: block;
  flex: 0 0 auto;
  width: var(--pp-sizing-24);                            /* native size of the kit `call` icon (24x24) */
  height: var(--pp-sizing-24);
  pointer-events: none;
}

/* ================================================================ v6.4: ONE logical callback button, TWO visual states (mutually exclusive)
   STATE A  .cbw-trigger--menu  LARGE ICON-ONLY handset (no label), INSIDE the header via [data-callback-header-slot] (SiteMenu), normal document flow
            (NOT fixed) = it scrolls away up with the header. 56 x 56 (kit Button/fill/L height = --pp-sizing-56), icon 32.
   STATE B  .cbw-trigger--fab   SMALLER sticky handset, position:fixed, always clickable. 48 x 48 (>= 44/48 touch target), icon only (24).
            Shown ONLY while the state-A button is outside the viewport (IntersectionObserver in callback-widget.js toggles B's `hidden`).
   Both = the same <button data-cbw-open>: same dialog, same form, same payload. Colours/sizes = tokens only. Corner radius = kit button radius
   (--pp-borderradius-m, 5; house style, unchanged). A round FAB is NOT a kit shape: opt in per site with --cbw-fab-radius / --cbw-menu-radius.

   STATE-B ANCHOR (v6.4), horizontal:
     right = max( edge-gap , (100% - content-max) / 2 - half-width )                        [+ safe-area-inset-right]   (100% = the viewport width WITHOUT the scrollbar: % on a fixed box's `right` resolves against the viewport, so the clamp stays exact when a classic scrollbar is shown)
       edge-gap     = --cbw-fab-edge, default 8px (spacing-8) on desktop, 16px (spacing-16) <= 767px  -> narrow/normal widths: hugs the browser RIGHT EDGE
       content-max  = --cbw-content-max, default 1280px = the site container (Penpot boards are 1280 wide; .hdr-top-in/.hdr-menu-in/.ec-wrap = max-width 1280)
       half-width   = --pp-sizing-24 (24px = half of the 48px button)
     So on wide screens, where the centered container leaves white margins, the button's CENTRE sits on the container's right edge, exactly as Penpot
     draws the handset (board x 1236..1324 on a 1280 board = centred on x=1280); it never floats in the white void. On a 1280-wide window the gutter
     56 (page padding) holds the whole button, nothing overlaps the text. EqArticle pages: set --cbw-content-max: 1168px on :root (their chrome is 1168).
   STATE-B BOTTOM: 24px (spacing-24) + the cookie banner height while it is shown (the site's banner publishes --ttisi-cc-h on <html>) + safe-area. */
.cbw-trigger--menu {
  width: var(--pp-sizing-56);
  height: var(--pp-sizing-56);
  padding: 0;
  border-radius: var(--cbw-menu-radius, var(--pp-borderradius-m));
}

.cbw-trigger--menu .cbw-trigger__icon {
  width: calc(var(--pp-sizing-24) + var(--pp-sizing-8));     /* 32 px */
  height: calc(var(--pp-sizing-24) + var(--pp-sizing-8));
}

.cbw-trigger--fab {
  position: fixed;
  right: calc(max(var(--cbw-fab-edge, var(--pp-spacing-8)), calc((100% - var(--cbw-content-max, 1280px)) / 2 - var(--pp-sizing-24))) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--cbw-fab-bottom, var(--pp-spacing-24)) + var(--ttisi-cc-h, 0px) + env(safe-area-inset-bottom, 0px));
  z-index: var(--cbw-z);
  width: calc(var(--pp-sizing-40) + var(--pp-sizing-8));     /* 48 px */
  height: calc(var(--pp-sizing-40) + var(--pp-sizing-8));
  padding: 0;
  border-radius: var(--cbw-fab-radius, var(--pp-borderradius-m));
  box-shadow: var(--cbw-shadow-neu);
}

/* mobile (<= 767 px, the site's own chrome breakpoint): content is full width, so no clamp is needed (the max() above already resolves to the edge gap);
   a little more air to the edge for the thumb. Same 48 px target (>= 44), state A stays in the header band next to the burger. */
@media (max-width: 767.98px) {
  .cbw-trigger--fab { --cbw-fab-edge: var(--pp-spacing-16); }
}

/* ---------------------------------------------------------------- dialog shell */
.cbw__dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(var(--cbw-modal-w), calc(100vw - 2 * var(--pp-spacing-16)));
  max-width: none;
  max-height: calc(100vh - 2 * var(--pp-spacing-16));
  max-height: calc(100dvh - 2 * var(--pp-spacing-16));
  padding: 0;
  border: 0;
  border-radius: var(--pp-borderradius-l);
  background: transparent;
  color: inherit;
  overflow: auto;
  overscroll-behavior: contain;
}

.cbw__dialog::backdrop {
  background: var(--pp-colors-grey-black-900);
  opacity: 0.6;
}

.cbw__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--pp-spacing-24);
  padding: var(--pp-spacing-56);
  border-radius: var(--pp-borderradius-l);
  background: var(--pp-colors-grey-grey-100);
}

/* close  (design: a text glyph in header_44_bold at the top-right; kept as a real <button>) */
.cbw__close {
  position: absolute;
  top: var(--pp-spacing-16);
  right: var(--pp-spacing-16);
  min-width: var(--pp-sizing-40);
  min-height: var(--pp-sizing-40);
  padding: 0 var(--pp-spacing-4);
  border: 0;
  border-radius: var(--pp-borderradius-s);
  background: transparent;
  color: var(--pp-colors-grey-black-800);
  font-size: var(--pp-fontsize-44);
  font-weight: var(--pp-fontweight-bold);
  line-height: var(--pp-lineheight-1-3);
  cursor: pointer;
}

.cbw__close:hover { color: var(--pp-colors-grey-grey-600); }

.cbw__close:focus-visible {
  outline: var(--pp-borderwidth-2) solid var(--pp-buttonfullpressed);
  outline-offset: var(--pp-spacing-2);
}

/* title  = typography.header.bold.header_44_bold */
.cbw__title {
  font-size: var(--pp-fontsize-44);
  font-weight: var(--pp-fontweight-bold);
  line-height: var(--pp-lineheight-1-3);
  letter-spacing: var(--pp-letterspacing-0);
  color: var(--pp-colors-grey-black-800);
}

/* lead   = typography.header.bold.header_20_bold */
.cbw__lead {
  font-size: var(--pp-fontsize-20);
  font-weight: var(--pp-fontweight-bold);
  line-height: var(--pp-lineheight-1-4);
  color: var(--pp-colors-grey-black-800);
}

/* ---------------------------------------------------------------- white card (callback_form) */
.cbw__card {
  display: flex;
  flex-direction: column;
  gap: var(--pp-spacing-24);
  padding: var(--pp-spacing-24);
  border-radius: var(--pp-borderradius-l);
  background: var(--pp-colors-additional-white);
  box-shadow: var(--cbw-shadow-neu);       /* neumorphism_dropShadow_buttonHover */
}

/* name + phone = "Text field/L/no title": 56 high, 1px elementBorderActive, radius S, text body_14_medium grey_700 */
.cbw__input {
  display: block;
  width: 100%;
  height: var(--pp-sizing-56);
  padding: 0 var(--pp-spacing-16);
  border: var(--pp-borderwidth-1) solid var(--pp-elementborderactive);
  border-radius: var(--pp-borderradius-s);
  background: var(--pp-colors-additional-white);
  color: var(--pp-colors-grey-grey-700);
  font-size: var(--pp-fontsize-14);
  font-weight: var(--pp-fontweight-medium);
  line-height: var(--pp-lineheight-1-6);
  letter-spacing: var(--pp-letterspacing-0);
  -webkit-appearance: none;
  appearance: none;
}

.cbw__input::placeholder { color: var(--pp-colors-grey-grey-700); opacity: 1; }
.cbw__input:hover        { border-color: var(--pp-elementborderhover); }

.cbw__input:focus,
.cbw__input:focus-visible {
  outline: var(--pp-borderwidth-1) solid var(--pp-elementborderpressed);
  border-color: var(--pp-elementborderpressed);
}

.cbw__input[aria-invalid="true"] {
  border-color: var(--pp-elementbordererror);
  outline-color: var(--pp-elementbordererror);
}

/* ---------------------------------------------------------------- consent rows  (Checkbox/M + body_12_regular) */
.cbw__consent {
  display: flex;
  align-items: flex-start;
  gap: var(--pp-spacing-12);
}

.cbw__check {
  position: relative;
  flex: 0 0 var(--pp-sizing-24);
  width: var(--pp-sizing-24);
  height: var(--pp-sizing-24);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--pp-borderradius-s);
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Material check_box_outline_blank geometry (kit icon): 24 frame, 18 box inset 3, 2px stroke, grey_500 */
.cbw__check::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: var(--pp-borderwidth-2) solid var(--pp-colors-grey-grey-500);
  border-radius: var(--pp-borderradius-s);
  background: transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.cbw__check:hover::before { border-color: var(--pp-colors-grey-grey-600); }

.cbw__check:checked::before {
  border-color: var(--pp-buttonfullactive);
  background: var(--pp-buttonfullactive);
}

.cbw__check:checked::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 5px;
  width: 6px;
  height: 11px;
  border: solid var(--pp-buttonfulltextcolor);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cbw__check:focus-visible {
  outline: var(--pp-borderwidth-2) solid var(--pp-buttonfullpressed);
  outline-offset: var(--pp-spacing-2);
}

.cbw__check[aria-invalid="true"]::before { border-color: var(--pp-elementbordererror); }

.cbw__consent-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--pp-fontsize-12);
  font-weight: var(--pp-fontweight-regular);
  line-height: var(--pp-lineheight-1-3);
  letter-spacing: var(--pp-letterspacing-0);
  color: var(--pp-colors-grey-black-800);
  cursor: pointer;
}

/* real <a href> inside the label (new tab): underline + the site link colour (hook), a click on a link does not toggle the box */
.cbw__consent-text a {
  color: var(--cbw-link-color, inherit);
  text-decoration: underline;
}

.cbw__consent-text a:hover { color: var(--pp-colors-grey-grey-600); }

/* ---------------------------------------------------------------- submit  (Button/fill/L) */
.cbw__submit-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cbw__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: var(--pp-sizing-56);
  padding: 0 var(--pp-spacing-24);
  border: 0;
  border-radius: var(--pp-borderradius-m);
  background: var(--pp-buttonfullactive);
  color: var(--pp-buttonfulltextcolor);
  font-size: var(--pp-fontsize-16);
  font-weight: var(--pp-fontweight-medium);
  line-height: var(--pp-lineheight-1-5);
  letter-spacing: var(--pp-letterspacing-0);
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.cbw__submit:hover   { background: var(--pp-buttonfullhover); box-shadow: var(--cbw-shadow-neu); }
.cbw__submit:active  { background: var(--pp-buttonfullpressed); box-shadow: none; }

/* gated: pdp unchecked OR name empty OR phone invalid OR request in flight / slots loading */
.cbw__submit[aria-disabled="true"],
.cbw__submit[aria-disabled="true"]:hover,
.cbw__submit[aria-disabled="true"]:active {
  background: var(--pp-buttonfulldisabled);
  box-shadow: none;
  cursor: not-allowed;
}

.cbw__submit:focus-visible {
  outline: var(--pp-borderwidth-2) solid var(--pp-buttonfullpressed);
  outline-offset: var(--pp-spacing-2);
}

/* panel[data-state] = idle | sending | success | rejected | error  (set by the script; hook for SITE styling / analytics) */
.cbw__panel[data-state="sending"] .cbw__submit { cursor: progress; }

/* status line (sending / error / rejected). Empty = zero height. */
.cbw__status {
  font-size: var(--pp-fontsize-14);
  font-weight: var(--pp-fontweight-medium);
  line-height: var(--pp-lineheight-1-6);
  color: var(--pp-colors-grey-grey-700);
}

.cbw__status:not(:empty) { margin-top: var(--pp-spacing-12); }
.cbw__status[data-state="error"]   { color: var(--pp-colors-red-red-700); }
.cbw__status[data-state="success"] { color: var(--pp-colors-green-green-700); }

.cbw__fallback {
  margin-top: var(--pp-spacing-4);
  font-size: var(--pp-fontsize-14);
  font-weight: var(--pp-fontweight-regular);
  line-height: var(--pp-lineheight-1-6);
}

.cbw__fallback a { color: inherit; text-decoration: underline; white-space: nowrap; }

/* honeypot: off-screen, not display:none (some bots skip display:none) */
.cbw__hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------------------------------------------------------------- success view */
.cbw__result:focus { outline: none; }

.cbw__result-title {
  font-size: var(--pp-fontsize-20);
  font-weight: var(--pp-fontweight-bold);
  line-height: var(--pp-lineheight-1-4);
  color: var(--pp-colors-green-green-700);
}

.cbw__result-text {
  font-size: var(--pp-fontsize-14);
  font-weight: var(--pp-fontweight-regular);
  line-height: var(--pp-lineheight-1-6);
}

.cbw__result .cbw__submit { align-self: flex-start; }

.cbw__panel[data-view="result"] .cbw__lead { display: none; }

/* ---------------------------------------------------------------- TIME SLOT
   Two panes in one section: the LINK pane (collapsed state) and the PICKER pane (expanded state). On expand the link
   row is replaced by the picker row (kit canon, +40 px); both animate with grid-template-rows 0fr<->1fr + opacity.
   Duration: ONE source of truth = --cbw-motion (200 ms per the disclosure contract). The script reads the computed
   transition-duration, so `prefers-reduced-motion` (transition: none -> 0s) gives an instant swap with no JS branch.
   overflow is clipped ONLY while data-anim is set, so focus rings are never cut at rest.
   data-worktime="office" (isWorktime true: starts as the link) | "off" (isWorktime false: never shows the link). */
.cbw__time { display: block; min-width: 0; }

.cbw__time-pane {
  display: grid;
  transition: grid-template-rows var(--cbw-motion) ease, opacity var(--cbw-motion) ease;
}

.cbw__time-pane--link   { grid-template-rows: 1fr; opacity: 1; }
.cbw__time-pane--picker { grid-template-rows: 0fr; opacity: 0; }

.cbw__time[data-open="true"] .cbw__time-pane--link   { grid-template-rows: 0fr; opacity: 0; }
.cbw__time[data-open="true"] .cbw__time-pane--picker { grid-template-rows: 1fr; opacity: 1; }

.cbw__time-inner { min-height: 0; min-width: 0; }
.cbw__time[data-anim] .cbw__time-inner { overflow: hidden; }

/* picker pane: select row, then (non-canon, OFFICE only) the way back, 24 px apart */
.cbw__time-inner--picker { display: flex; flex-direction: column; gap: var(--pp-spacing-24); }

/* trigger / collapse link = time_trigger: body_12_regular, black_800, underlined (house rule for links).
   Visual box stays 16 px high (kit); ::before widens the hit area to 24 px (WCAG 2.5.8) without moving layout. */
.cbw__time-link {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-size: var(--pp-fontsize-12);
  font-weight: var(--pp-fontweight-regular);
  line-height: var(--pp-lineheight-1-3);
  letter-spacing: var(--pp-letterspacing-0);
  color: var(--pp-colors-grey-black-800);
  text-decoration: underline;
  cursor: pointer;
}

.cbw__time-link::before { content: ""; position: absolute; inset: calc(-1 * var(--pp-spacing-4)) 0; }
.cbw__time-link:hover   { color: var(--pp-colors-grey-grey-600); }

.cbw__time-link:focus-visible {
  outline: var(--pp-borderwidth-2) solid var(--pp-buttonfullpressed);
  outline-offset: var(--pp-spacing-2);
}

/* loading the slots (first expand): the link stays, only the cursor / tone change (its label never changes) */
.cbw__time[data-busy] .cbw__time-link { color: var(--pp-colors-grey-grey-600); cursor: progress; }

/* slots unavailable / empty / rate-limited: link is inert (no second slots call per dialog open), note explains */
.cbw__time-link[aria-disabled="true"] { color: var(--pp-colors-grey-grey-700); cursor: not-allowed; }

.cbw__time-note {
  font-size: var(--pp-fontsize-12);
  font-weight: var(--pp-fontweight-regular);
  line-height: var(--pp-lineheight-1-3);
  color: var(--pp-colors-grey-grey-700);
}

.cbw__time-note:not(:empty) { margin-top: var(--pp-spacing-8); }
.cbw__time-note[data-state="error"] { color: var(--pp-colors-red-red-700); }

/* OFF-HOURS: there is no link, so the note (loading / unavailable) takes the link's slot with no extra top gap */
.cbw__time[data-worktime="off"] .cbw__time-note:not(:empty) { margin-top: 0; }

/* fieldset reset: the browser default border / padding / min-width would break the 424 px row */
.cbw__time-panel { min-width: 0; margin: 0; padding: 0; border: 0; }

/* visually hidden, still announced (legend) */
.cbw__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* picker row: Select/L day | "В" | Select/L time.  Kit: 194 + 12 + 13 + 12 + 194 = 425 on a 424 row -> 1fr auto 1fr, gap 12 */
.cbw__time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--pp-spacing-12);
}

.cbw__time-sep {
  font-size: var(--pp-fontsize-14);
  font-weight: var(--pp-fontweight-regular);
  line-height: var(--pp-lineheight-1-6);
  color: var(--pp-colors-grey-black-800);
}

/* Select/L/No title: 56 high, no extra fill (white card), 1px grey_600 stroke, radius S, padding 16, value body_14_medium grey_700.
   The chevron (kit icon expand_more, 24 px, grey_600) is a token-coloured CSS chevron: no data: URI, no CSP img-src needed. */
.cbw__select { position: relative; display: block; min-width: 0; }

.cbw__select::after {
  content: "";
  position: absolute;
  top: calc(50% - var(--pp-spacing-8));
  right: var(--pp-spacing-24);
  width: var(--pp-spacing-8);
  height: var(--pp-spacing-8);
  border: solid var(--pp-colors-grey-grey-600);
  border-width: 0 var(--pp-borderwidth-2) var(--pp-borderwidth-2) 0;
  transform: rotate(45deg);
  pointer-events: none;
}

.cbw__select select {
  display: block;
  width: 100%;
  height: var(--pp-sizing-56);
  margin: 0;
  padding: 0 var(--pp-spacing-40) 0 var(--pp-spacing-16);   /* 16 + 24 px chevron room */
  border: var(--pp-borderwidth-1) solid var(--pp-colors-grey-grey-600);
  border-radius: var(--pp-borderradius-s);
  background: var(--pp-colors-additional-white);
  color: var(--pp-colors-grey-grey-700);
  font-family: inherit;
  font-size: var(--pp-fontsize-14);
  font-weight: var(--pp-fontweight-medium);
  line-height: var(--pp-lineheight-1-6);
  letter-spacing: var(--pp-letterspacing-0);
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.cbw__select select:hover { border-color: var(--pp-elementborderactive); }

.cbw__select select:focus,
.cbw__select select:focus-visible {
  outline: var(--pp-borderwidth-1) solid var(--pp-elementborderpressed);
  border-color: var(--pp-elementborderpressed);
}

/* the fieldset is `disabled` while collapsing: keep the look steady for the fade-out (no UA greying) */
.cbw__select select:disabled { color: var(--pp-colors-grey-grey-700); opacity: 1; cursor: default; }

/* ---------------------------------------------------------------- narrow screens
   Penpot has no mobile frame for this modal: scale DOWN with existing kit steps only
   (padding 56 -> 24, header_44 -> header_28, header_20 -> header_16). */
@media (max-width: 640px) {
  .cbw__panel { padding: var(--pp-spacing-24); }

  .cbw__title {
    padding-right: var(--pp-sizing-40);   /* clear of the close button */
    font-size: var(--pp-fontsize-28);
    line-height: var(--pp-lineheight-1-4);
  }

  .cbw__lead { font-size: var(--pp-fontsize-16); line-height: var(--pp-lineheight-1-5); }
  .cbw__close { top: var(--pp-spacing-12); right: var(--pp-spacing-12); font-size: var(--pp-fontsize-28); }
  .cbw__submit-row { align-items: stretch; }
  .cbw__submit { width: 100%; }
}

/* Penpot has no mobile frame for the 424 px picker row (F5): below 480 px the two selects stack, "В" is dropped
   (it is aria-hidden anyway; each select carries its own aria-label). Same selects, same tokens. */
@media (max-width: 480px) {
  .cbw__time-row { grid-template-columns: minmax(0, 1fr); }
  .cbw__time-sep { display: none; }
}

/* ---------------------------------------------------------------- motion / print */
@media (prefers-reduced-motion: reduce) {
  .cbw-trigger,
  .cbw__submit,
  .cbw__check::before,
  .cbw__time-pane { transition: none; }
}

@media print {
  .cbw,
  .cbw-trigger { display: none; }
}
