/* myproposal — QA patch layer (loaded after the build CSS). Fixes layout, responsiveness and UI consistency. */

/* ---------- Global safety ---------- */
html{-webkit-text-size-adjust:100%}
body{overflow-x:clip}
img,svg,video,canvas{max-width:100%;height:auto}
svg[width][height]{height:auto}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed}
:where(a,button,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--ember);outline-offset:2px;border-radius:4px}
.container{min-width:0}
.grid>*,.stack>*{min-width:0}
h1,h2,h3,h4{overflow-wrap:anywhere}
p,li,td,th{overflow-wrap:break-word}
code,pre{overflow-wrap:anywhere}
pre{max-width:100%;overflow-x:auto}

/* Grid cards: never let auto rows stretch content apart (fixes jagged titles in step lists / stat cards) */
.how-steps li,.premium-slab,.premium-panel,.path-wrap,.podium__slot,.project-card>*,.stat,.kpi,.panel.stack,.panel--pad.stack{align-content:start}
.how-steps li{align-content:start;grid-template-rows:auto auto 1fr}

/* ---------- Tables: horizontal scroll instead of clipping on small screens ---------- */
.table-scroll{max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scrollbar-width:thin}
.table-scroll>table{min-width:100%}
.table-scroll>table.table,.table-scroll>table.ag-catalogue{min-width:520px}
.table-scroll>table.matrix{min-width:420px}
.matrix-wrap .table-scroll{overflow:visible}


/* ---------- Lists ---------- */
ol.plain-list{list-style:decimal;padding-left:18px}
ol.plain-list li{padding-left:4px}
ol.plain-list li:before{display:none}

/* ---------- Forms ---------- */
.stack>.toggle{display:flex;align-items:flex-start}
.stack>.toggle .track{flex:none;margin-top:1px}
.toggle+.toggle{margin-top:12px}
input,select,textarea{max-width:100%}
textarea{resize:vertical;min-height:96px}
input[type=number]{-moz-appearance:textfield}
select{text-overflow:ellipsis}

/* ---------- Header / mobile drawer ---------- */
.site-header__burger{cursor:pointer}
.site-drawer{max-height:calc(100dvh - 69px);max-height:calc(100vh - 69px);overflow-y:auto;overscroll-behavior:contain}
@supports (height:100dvh){.site-drawer{max-height:calc(100dvh - 69px)}}
html.nav-open,html.nav-open body{overflow:hidden}

/* ---------- Section heads on small screens ---------- */
@media (max-width:640px){
  .paths__head{flex-direction:column;align-items:flex-start;gap:8px}
  .paths__head .eyebrow{white-space:nowrap}
  .section-head--split{grid-template-columns:1fr;align-items:start}
  .section-head--split .btn{justify-self:start}
  .btn-row{flex-wrap:wrap}
  .btn-row>.btn{max-width:100%}
  html .preview-frame__bar{gap:8px;padding:10px 12px}
  html .preview-frame__bar .tag{flex:none;font-size:10px;padding:3px 7px}
  html .preview-frame__bar>*{min-width:0}
  html .preview-frame__url,html .preview-frame__bar code,html .preview-frame__bar span:not(.tag){overflow:hidden;text-overflow:ellipsis}
  .chat{height:min(600px,100vh - 90px)}
  @supports (height:100dvh){.chat{height:min(600px,100dvh - 90px)}}
  .chat__foot{flex-wrap:wrap;gap:6px 10px}
  .chat__human{white-space:nowrap}
  .chat__hours{flex:1 1 100%;text-align:left}
  .podium{grid-template-columns:1fr}
  .podium__slot--1,.podium__slot--2,.podium__slot--3{min-height:0}
  .how-steps{grid-template-columns:1fr}
}

/* ---------- Horizontal rails (demo product strips) ---------- */
.rail,.hm-rail,.st-rail,[class*="__rail"]{scrollbar-width:thin;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}

/* ---------- Chat widget ---------- */
.chatwidget{max-width:calc(100vw - 24px)}
.chat__list{overscroll-behavior:contain}
.chat__bubble{overflow-wrap:anywhere}

/* ---------- Reveal animation: never leave content invisible ---------- */
.reveal.in,.reveal.is-forced{opacity:1;transform:none}
@media print{.reveal{opacity:1!important;transform:none!important}}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion:reduce){
  *,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}

/* ---------- Touch targets ---------- */
@media (hover:none){
  .site-drawer a,.site-drawer__toggle,.chip,.tag-btn,.btn--text{min-height:44px}
  .chat__iconbtn{width:40px;height:40px}
}

/* ---------- Misc polish ---------- */
.skip{left:-9999px}
.skip:focus{left:8px;top:8px}
.toast-host{pointer-events:none}
.toast-host>*{pointer-events:auto}
.site-footer a{overflow-wrap:anywhere}
.empty,.muted{text-wrap:pretty}

/* ---------- Guide templates: keep the Copy button clear of the text ---------- */
html .template{padding-right:72px;overflow-wrap:anywhere}
html .template button{min-height:26px}
html .template button:hover{background:#f4f1ea33}
@media (max-width:640px){html .template{padding-right:16px;padding-top:44px}}
