/* Balance layer (2026-11-26, Impeccable layout/polish). Loaded last.
   Changes spacing, hierarchy and button roles only; ids, inputs, handlers and copy are untouched. */
@media screen {

/* 1. Button roles: one filled colour (--cta) for actions that lead to a request.
   Former accent-filled .btn-y buttons become accent outlines, so CTA no longer competes with a second fill. */
.btn-y:not(#kf-add):not(.btn-cta) {background:transparent;border:1px solid var(--accent);color:var(--accent);box-shadow:none}
.btn-y:not(#kf-add):not(.btn-cta):hover {background:var(--y-06);box-shadow:none}
.btn-y,.btn-y:hover,.btn-cta,.btn-cta:hover {box-shadow:none}
.kf-sl.kf-side .btn-y:not(#kf-add) {color:var(--accent)}

/* 2. Pinned action bar: one row instead of two.
   Back on the left; the current task (confirm and continue) is the single filled button on the right.
   While stages remain, the locked "Step N" button is a quiet outline beside it. */
#kf.studio-kf .studio-actions {flex-wrap:nowrap;align-items:center;gap:12px;min-height:0;padding:14px 32px}
#kf.studio-kf .studio-actions .studio-prev {order:1;flex:none}
#kf.studio-kf .studio-actions .studio-next {order:2;margin-left:auto}
#kf.studio-kf .studio-actions .flow-local-actions {order:3;flex:0 1 auto;flex-wrap:wrap;justify-content:flex-end;gap:6px 12px;margin:0;padding:0;border:0}
#kf.studio-kf .studio-actions .flow-local-actions .assembly-field-error {order:-1;flex-basis:100%;text-align:right}
#kf.studio-kf .studio-actions .flow-continue:not(:disabled) {background:var(--cta);border-color:var(--cta);color:var(--cta-ink);font-weight:650;padding-inline:20px}
#kf.studio-kf .studio-actions .flow-continue:not(:disabled):hover {background:var(--cta-hover);border-color:var(--cta-hover)}
#kf.studio-kf .studio-actions:has(.flow-local-actions:not([hidden])) .studio-next {min-width:0;flex:0 0 auto;padding-inline:16px;background:transparent;border:1px solid var(--studio-border);color:var(--muted)}
#kf.studio-kf .studio-actions .studio-prev:disabled {opacity:1;background:transparent;color:var(--muted)}
#kf.studio-kf .studio-actions :is(.flow-continue,.studio-next) {white-space:nowrap}
/* Narrow settings column (tablet and the 25/75 split below 1100px): Back becomes a 44px icon with the same name. */
@media (max-width:1100px) {
  #kf.studio-kf .studio-actions .studio-prev {min-width:44px;width:44px;padding:0;font-size:0;gap:0}
  #kf.studio-kf .studio-actions .studio-prev svg {width:20px;height:20px}
}

/* 3. The stage heading receives programmatic focus for screen readers; it is not a control,
   so it should not look like a framed input. Interactive elements keep the global ring. */
#kf.studio-kf .flow-title[tabindex="-1"]:focus,#kf.studio-kf .flow-title[tabindex="-1"]:focus-visible {outline:none!important}

/* 4. Settings get the height the second action row used to take; preview keeps its 25% column. */
@media (min-width:621px) {
  #kf.studio-kf {grid-template-rows:76px minmax(0,600px) auto}
}

/* 5. TZ upload: same family as the rest of the tools, not a second gold frame above the configurator. */
#konfigurator .kf-tz-top {border-color:var(--line);background:var(--surface);padding:10px 12px;gap:8px 16px}
#konfigurator .kf-tz-top span {color:var(--fg-2)}

/* Sticky header: the 80%-black smudge under the inner row is replaced by the existing hairline. */
header.site.hx > .in,html.hx-sm header.site.hx > .in {box-shadow:none}

/* 6. Hero: left-aligned path, lighter lede, visual aligned with the headline, less dead space. */
.hero.kfh > .crumbs {align-self:stretch;width:100%;padding-bottom:24px}
.kfh .crumbs ol {justify-content:flex-start}
.hero.kfh .body {align-items:start}
@media (min-width:1100px) {
  .hero.kfh .hero-door {align-self:start;margin-top:4px;height:480px;min-height:480px}
  .hero-door-image {height:376px}
}
.kfh .sub {font-weight:450;color:var(--fg-2);margin-top:20px}
.kfh .pros {margin:22px 0 26px}
.kfh .kfh-kpi {margin-top:8px}
.kfh-kpi .tile,.kfh-kpi .tile.yt {padding-block:22px 20px}

/* 7. Field labels read in the body face; mono stays for codes, articles and card tags. */
:is(#kf-sum,#kf-ready,#kf-mood,#kp) .f > label,
:is(#kf-sum,#kf-ready,#kf-mood) label[for] {font:600 12px/1.4 var(--sans);letter-spacing:0;text-transform:none;color:var(--fg)}
:is(#kf-sum,#kf-ready,#kp) .hint {font-family:var(--sans);letter-spacing:0}
#kp fieldset.f > legend {font:600 12px/1.4 var(--sans);letter-spacing:0;text-transform:none;color:var(--fg)}
#kp .subm small,#kp .links-sm {font-family:var(--sans);letter-spacing:0;font-size:12px}
.kf-quick-b .btn {min-height:44px}

/* 8. Summary: code, quantity and "Add to request" lead; exports form an even grid, not a ragged row. */
/* On every width the card with quantity and "Add to request" comes before the long parameter list. */
.kf-sum > .kf-sl.kf-side {order:-1}
.kf-sl.kf-side .kf-qrow {grid-template-columns:minmax(0,1fr)}
.kf-sl.kf-side .kf-qrow .kf-qbtns {display:flex}
.kf-sl.kf-side .kf-qrow .btn {margin-top:0}
.kf-sl.kf-side #kf-add {flex:1 1 auto;width:100%;min-height:48px;font-size:13px}
.kf-sl.kf-side .kf-acts {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding-top:4px}
.kf-sl.kf-side .kf-acts .btn {width:100%;min-height:44px;padding:8px 10px;justify-content:center;text-align:center}
.kf-sl.kf-side .kf-acts .kf-lnk {grid-column:1/-1;justify-self:start;min-height:44px;color:var(--muted)}
@media (min-width:1100px) and (min-height:860px) {
  .kf-sum {align-items:start}
  .kf-sum > .kf-sl.kf-side {position:sticky;top:calc(var(--header-h) + 16px)}
}

/* 9. Mood board: actions first, text links (clear, logo) after them. */
.kf-mood-hd .kf-acts .kf-lnk {order:2}
.kf-mood-hd .kf-acts #kf-mood-clear {order:3}

/* 10. Request section: the short left column stays beside the long form; the contact card loses its side bar. */
#kp .body {align-items:start}
@media (min-width:1025px) and (min-height:760px) {
  #kp .intro {position:sticky;top:calc(var(--header-h) + 32px)}
}
#kp .lead-mgr {border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
:root:not([data-theme="light"]):not([data-theme="mineral"]) #kp .lead-mgr {background:var(--bg)}

/* 11a. Theme switch on tablets/small laptops: one row (the note stays for screen readers). */
@media (min-width:601px) and (max-width:1250px) {
  .theme-options {flex-wrap:nowrap;min-width:0;overflow-x:auto;scrollbar-width:none}
  .design-switch-note {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
/* 11. Theme switch on phones: one row, scrolls sideways inside itself, 44px targets. */
@media (max-width:600px) {
  .design-switch {flex-direction:row;align-items:center;min-height:0;padding:4px 8px;gap:0}
  .design-switch-title {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .theme-options {display:flex;flex-wrap:nowrap;width:100%;gap:2px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
  .theme-options::-webkit-scrollbar {display:none}
  .theme-option {flex:0 0 auto;min-height:44px;padding:6px 10px;font-size:12px}
}

/* 11b. The fixed phone bar (КП / Позвонить) must not cover a field reached with Tab. */
@media (max-width:767px) {
  html {scroll-padding-bottom:72px}
}

/* 12. Phone action bar: Back as a 44px icon (its name stays "Назад"), confirm takes the remaining width. */
@media (max-width:620px) {
  #kf.studio-kf .studio-actions {gap:8px;padding:10px 12px max(10px,env(safe-area-inset-bottom))}
  #kf.studio-kf .studio-actions .studio-next {min-width:0;padding-inline:12px;font-size:12px;gap:6px}
  #kf.studio-kf .studio-actions .flow-local-actions {flex:1 1 auto;min-width:0}
  #kf.studio-kf .studio-actions .flow-local-actions .flow-continue {width:100%;font-size:12px;padding-inline:10px;gap:6px}
  #kf.studio-kf .studio-actions:has(.flow-local-actions:not([hidden])) .studio-next {padding-inline:10px}
  .kf-sl.kf-side .kf-acts {grid-template-columns:repeat(2,minmax(0,1fr))}
  .kfh .crumbs {padding-bottom:16px}
}
@media (max-width:360px) {
  #kf.studio-kf .studio-actions .flow-local-actions .flow-continue svg {display:none}
  #kf.studio-kf .studio-actions:has(.flow-local-actions:not([hidden])) .studio-next {min-width:44px;justify-content:center}
  #kf.studio-kf .studio-actions:has(.flow-local-actions:not([hidden])) .studio-next span {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
}
