/* REDICO Bento: phone/tablet portrait corrections. Load after global/home/pages.
   Explicit template adapters preserve menu, AI, hidden fields and widget state. */
@layer redicoBento {
  @media (max-width: 768px) {
    html[data-rx-bento] { --rb-gutter:16px !important; --rb-space:16px !important; }
    html[data-rx-bento] body { font-size:16px !important; line-height:1.5 !important; }

    /* One centered content column; nested cards supply their own inner padding. */
    html[data-rx-bento] #home-content { --rb-home-gap:16px; padding-bottom:100px !important; }
    html[data-rx-bento] #home-content > section {
      width:calc(100% - 32px) !important; max-width:100% !important;
      margin-inline:auto !important; margin-bottom:40px !important;
    }
    html[data-rx-bento] #home-content #rxh { padding-top:16px !important; }
    html[data-rx-bento] body:not(.home)>:is(.rx-wrap,.redico-page-wrap),
    html[data-rx-bento] body:not(.home) :is(.rxk-sec,.rts-page__in,.rc-wrap,.rd-wrap) {
      width:100% !important; padding-inline:16px !important;
    }
    html[data-rx-bento] body:not(.home) :is(.rxh-uni-host,#gr-hero) {
      width:100% !important; margin:16px auto 24px !important; padding-inline:16px !important;
    }
    html[data-rx-bento] body:not(.home) :is(.rx-wrap,.redico-page-wrap,.rts-page__in)>.rxh-uni-host { padding-inline:0 !important; }
    html[data-rx-bento] body:not(.home) .rx-enc-wrap { width:100% !important; padding:16px 16px 32px !important; }
    html[data-rx-bento] body:not(.home) .rx-enc-hero .rx-full-hero-inner { padding:0 !important; }

    /* Homepage: all content sections stack at the same breakpoint. */
    html[data-rx-bento] #rxh .rxhm-hero-inner,
    html[data-rx-bento] #rxh .rb-home-resources,
    html[data-rx-bento] #rxh .hm-hero-bottom,
    html[data-rx-bento] #rxh-form form,
    html[data-rx-bento] #rxh .rxhm-sample ul,
    html[data-rx-bento] #rxh .rxhm-files,
    html[data-rx-bento] #home-services .rxhm-grid,
    html[data-rx-bento] #home-cases .hm-cases-grid,
    html[data-rx-bento] #home-dashboard .rx-dash-grid,
    html[data-rx-bento] #home-dashboard .rx-dash-row,
    html[data-rx-bento] #home-process [data-hm-group="stages"],
    html[data-rx-bento] #home-scenarios .rx-scn-grid,
    html[data-rx-bento] #tests > div:nth-child(2),
    html[data-rx-bento] #home-faq .rxhm-faq,
    html[data-rx-bento] #enciklopediya .rx-hub-grid,
    html[data-rx-bento] #redico-business-audiences .rdi-b2b-home-grid,
    html[data-rx-bento] #home-all-services .rxhm-details > div,
    html[data-rx-bento] #home-compare :is(.rx-cmp-grid,.rx-map-vs,.rx-map-list,.rx-map-story),
    html[data-rx-bento] #accreditation .rxhm-proof,
    html[data-rx-bento] #home-reviews .rx-2col-g,
    html[data-rx-bento] #telegram > .rx-2col-g,
    html[data-rx-bento] #home-client-companies .hm-client-list {
      grid-template-columns:minmax(0,1fr) !important; gap:16px !important;
      min-width:0 !important; max-width:100% !important;
    }
    html[data-rx-bento] #rxh :is(.rb-home-search-card,.rxhm-hero-inner > div:first-child),
    html[data-rx-bento] #rxh-form,
    html[data-rx-bento] #home-services .rxhm-card:nth-child(n),
    html[data-rx-bento] #home-cases .hm-case:nth-child(n),
    html[data-rx-bento] #rxh-form form > .rb-home-form-options {
      grid-column:auto !important; grid-row:auto !important;
      width:100% !important; min-width:0 !important; max-width:100% !important;
    }
    html[data-rx-bento] #rxh :is(.rb-home-search-card,.rxhm-hero-inner > div:first-child),
    html[data-rx-bento] #rxh-form { padding:24px 20px !important; }
    html[data-rx-bento] #rxh .rxhm-title { font-size:clamp(28px,7vw,36px) !important; line-height:1.2 !important; }
    html[data-rx-bento] #rxh .rxhm-hero-actions { display:grid !important; grid-template-columns:minmax(0,1fr) !important; gap:12px !important; }
    html[data-rx-bento] #rxh .rxhm-hero-actions a { width:100% !important; }
    html[data-rx-bento] #enciklopediya :is(.rx-hsearch,.rx-hcta) { flex-direction:column !important; align-items:stretch !important; gap:12px !important; }
    html[data-rx-bento] #enciklopediya .rx-hsearch :is(input,button) { width:100% !important; min-width:0 !important; }
    html[data-rx-bento] #rx-tnved-form .rb-home-search-row { grid-template-columns:minmax(0,1fr) !important; }
    html[data-rx-bento] #rx-tnved-form .rb-home-find { grid-column:1 !important; grid-row:2 !important; min-height:48px !important; width:100% !important; }
    html[data-rx-bento] #rx-tnved-count { grid-column:1 !important; grid-row:3 !important; }

    /* Encyclopedia, code/product articles, services, registry and contacts. */
    html[data-rx-bento] body:not(.home) #rxh.rxh-uni .rxh-uni-grid,
    html[data-rx-bento] body:not(.home) :is(.rc-hero-grid,.rd-hero-grid,.rx-enc-hub-hero-grid,.rx-enc-compact-grid,.rx-reg-hero,.rx-enc-layout,
      .rx-cards,.rx-hub-grid,.rx-kod-grid,.rxtr-grid,.rx-part-g,.rx-team-g,.rx-vak-g,.rx-obu-g,.rxk-tiles,.rxk-trust,.p4-grid,.rx-test-grid,.rx-steps,
      .rx-enc-nums,.rx-reg-2col,.rx-reg-3col,.rx-2col,.rx-2col-g,.rx-kont-grid,.rx-kont-row,.c032-2col,.rx-module .grid2,.rxo-stats,
      .rx-hero-resources>div,.rx-context-tools>div,.rx-enc-grid,.rx-enc-rgrid,.rx-enc-tgrid,.rx-cat-grid,.rx-mid-see-grid,.rx-calc .rx-cats) {
      grid-template-columns:minmax(0,1fr) !important; gap:16px !important;
      min-width:0 !important; max-width:100% !important;
    }
    html[data-rx-bento] body:not(.home) :is(.rxh-uni-grid,.rc-hero-grid,.rd-hero-grid,.rx-enc-hub-hero-grid,.rx-enc-compact-grid,.rx-enc-layout,.rx-enc-nums) > * {
      min-width:0 !important; max-width:100% !important; grid-column:auto !important; grid-row:auto !important;
    }
    html[data-rx-bento] body:not(.home) #rxh.rxh-uni .rxh-uni-main,
    html[data-rx-bento] body:not(.home) :is(.rx-enc-compact-copy,.rc-hero-grid>div:first-child,.rd-hero-grid>div:first-child,.rx-enc-hub-hero-grid>div:first-child,.rx-lead-card) {
      padding:24px 20px !important;
    }
    html[data-rx-bento] body:not(.home) :is(#rxh.rxh-uni,.rx-enc-hero,.rc-hero,.rd-hero,.rl-hero) h1 { font-size:clamp(28px,7vw,36px) !important; line-height:1.2 !important; }
    html[data-rx-bento] body:not(.home) .rx-enc-side { position:static !important; max-height:none !important; }
    html[data-rx-bento] body:not(.home) .rx-enc-nums { margin-block:16px !important; }
    html[data-rx-bento] body:not(.home) .rx-enc-num { width:100% !important; min-width:0 !important; padding:20px !important; }
    html[data-rx-bento] body:not(.home) :is(.rxk-req-row,.rx-cta,.rx-module .layout) { flex-direction:column !important; align-items:stretch !important; gap:16px !important; }
    html[data-rx-bento] body:not(.home) .rxk-req-row { grid-template-columns:minmax(0,1fr) !important; }
    html[data-rx-bento] body:not(.home) .rx-module nav { position:static !important; width:100% !important; }
    html[data-rx-bento] body:not(.home) #rx-orig-form { grid-template-columns:minmax(0,1fr) !important; }

    /* Registry search and filters: data rows stay readable without page overflow. */
    html[data-rx-bento] body:not(.home) .rts { padding:18px 16px !important; }
    html[data-rx-bento] body:not(.home) #rxh .rb-registry-hero-search { padding:16px !important; }
    html[data-rx-bento] body:not(.home) #rxh .rb-registry-resources > div,
    html[data-rx-bento] body:not(.home) .rts__bar { grid-template-columns:minmax(0,1fr) !important; }
    html[data-rx-bento] body:not(.home) .rts__bar:not([hidden]) { display:grid !important; }
    html[data-rx-bento] body:not(.home) :is(.rts__input,.rts__field,.rts__go,.rts__facets,.rr-sort,.sg-filters) { width:100% !important; min-width:0 !important; max-width:100% !important; }
    html[data-rx-bento] body:not(.home) .rts__results > * { padding:18px 16px !important; min-width:0 !important; }
    html[data-rx-bento] body:not(.home) .rx-reg-top { padding:18px 16px !important; gap:12px !important; flex-wrap:wrap !important; }
    html[data-rx-bento] body:not(.home) :is(.rx-reg-row,.rx-reg-group) { padding:16px !important; grid-template-columns:minmax(0,1fr) !important; }
    html[data-rx-bento] body:not(.home) .rx-reg-top .rx-input { width:100% !important; flex:1 1 100% !important; }
    html[data-rx-bento] body:not(.home) .rts-code { padding-inline:16px !important; }

    /* Standalone landing templates use their own scoped class family. */
    html[data-rx-bento] #rl-page.rl { padding-inline:16px !important; }
    html[data-rx-bento] #rl-page.rl :is(.rl-hero-in,.rl-cta-in,.rl-g3,.rl-g2,.rl-steps,.rl-links,.rl-check,.rl-errs,.rl-split) { grid-template-columns:minmax(0,1fr) !important; gap:16px !important; }
    html[data-rx-bento] #rl-page.rl .rl-fact { flex-direction:column !important; align-items:flex-start !important; }

    /* Readable main copy. Secondary/legal labels also remain at 16px on phones. */
    html[data-rx-bento] #home-content :is(p,li,dd,address),
    html[data-rx-bento] body:not(.home) :is(.rx-prose,.rx-section,.rxtr,.rxk-sec,.rx-enc-main,.rx-module,.rx-enc-hero) :is(p,li,dd),
    html[data-rx-bento] body:not(.home) .rx-lead-card :is(p,small,label,legend,.rx-common-consent,.rx-common-consent span,.rx-common-help,.rx-common-note),
    html[data-rx-bento] #rxh-form :is(label,legend,small,.rxhm-opt,.rxhm-reply-note,.rxhm-consent) {
      font-size:16px !important; line-height:1.5 !important; overflow-wrap:break-word !important;
    }
    html[data-rx-bento] #rxh .rxhm-hero-lead,
    html[data-rx-bento] #home-content :is(.rxhm-lead,.rx-cmp-lead,.rx-scn-lead) { font-size:18px !important; line-height:1.5 !important; }
    html[data-rx-bento] body:not(.home) #rxh.rxh-uni .rxh-uni-main p:not(.rx-lead-card *, .rx-ai *) { font-size:16px !important; line-height:1.5 !important; }

    /* Form fields only: hidden controls, radio dots and navigation icons are excluded. */
    html[data-rx-bento] :is(#rxh-form,.rx-lead-card,.rx-form,.rx-foot-cta,.rx-modal,.rl-form,.rx-kont-card) :is(form,fieldset) { min-width:0 !important; max-width:100% !important; }
    html[data-rx-bento] :is(#rxh-form,.rx-lead-card,.rx-form,.rx-foot-cta,.rx-modal,.rl-form,.rx-kont-card,.rts,.rx-reg-top) :is(input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="color"]):not([hidden]):not([aria-hidden="true"]):not([name="rx_hp"]):not(.rx-hp),select,textarea) {
      width:100% !important; min-width:0 !important; max-width:100% !important; min-height:48px !important;
      font-size:16px !important; line-height:1.5 !important; box-sizing:border-box !important;
    }
    html[data-rx-bento] :is(#rxh-form,.rx-lead-card,.rx-form,.rx-foot-cta,.rx-modal,.rl-form,.rx-kont-card) textarea { min-height:120px !important; resize:vertical !important; }
    html[data-rx-bento] :is(#rxh-form,.rx-lead-card,.rx-form,.rx-foot-cta,.rx-modal,.rl-form,.rx-kont-card) :is(button[type="submit"],input[type="submit"],.rx-submit,.rx-foot-btn,.rx-modal-btn) {
      width:100% !important; min-height:48px !important; white-space:normal !important;
      font-size:16px !important; line-height:1.4 !important; padding:13px 16px !important;
    }
    html[data-rx-bento] body:not(.home) .rx-lead-card .rx-shared-reply,
    html[data-rx-bento] #rxh-form .rxhm-reply { min-width:0 !important; margin-block:12px !important; flex-direction:column !important; grid-template-columns:minmax(0,1fr) !important; }
    html[data-rx-bento] body:not(.home) .rx-lead-card .rx-shared-reply label,
    html[data-rx-bento] #rxh-form .rxhm-reply > label {
      display:flex !important; align-items:center !important; gap:12px !important;
      width:100% !important; min-height:48px !important; padding:12px !important;
      margin:8px 0 !important; font-size:16px !important; line-height:1.5 !important;
    }
    html[data-rx-bento] body:not(.home) .rx-lead-card .rx-common-consent,
    html[data-rx-bento] #rxh-form .rxhm-consent {
      min-height:48px !important; padding-block:12px !important; gap:12px !important;
      align-items:flex-start !important; font-size:16px !important; line-height:1.5 !important;
    }
    html[data-rx-bento] :is(#rxh-form,.rx-lead-card,.rx-form,.rx-foot-cta,.rx-modal,.rl-form) :is(input[type="checkbox"],input[type="radio"]),
    html[data-rx-bento] #rxh-form .rxhm-consent input {
      width:22px !important; height:22px !important; min-width:22px !important; min-height:22px !important;
      flex:0 0 22px !important; margin:1px 0 0 !important;
    }
    html[data-rx-bento] :is(#rxh-form,.rx-lead-card,.rx-form,.rl-form) input[type="file"] { padding:8px !important; overflow:hidden !important; }
    html[data-rx-bento] :is(#rxh-form,.rx-lead-card,.rx-form,.rl-form) input[type="file"]::file-selector-button {
      min-height:44px; max-width:100%; padding:10px 12px; margin-right:8px;
      font:inherit; white-space:normal; cursor:pointer;
    }
    html[data-rx-bento] :is(#rxh-form,.rx-lead-card) :is(.rb-home-form-options,.rb-page-form-options)>summary { min-height:48px !important; padding-block:12px !important; font-size:16px !important; }

    /* The existing footer form and requisites follow the same phone rhythm. */
    html[data-rx-bento] :is(.rx-foot-cta,.rx-foot-cols,.rx-foot-req-grid) { grid-template-columns:minmax(0,1fr) !important; gap:24px !important; }
    html[data-rx-bento] .rx-foot-cta > * { min-width:0 !important; max-width:100% !important; }

    /* Overflow is constrained to actual data tables, never masked on the body. */
    html[data-rx-bento] :is(.rx-tblwrap,.rx-enc-tw,.rx-stable-table-scroll,.rxo-tw,.hm-table) { max-width:100% !important; min-width:0 !important; overflow-x:auto !important; overscroll-behavior-x:contain; }
    html[data-rx-bento] body:not(.home) :is(.rx-prose,.rx-section,.rx-module,.rxtr) > table,
    html[data-rx-bento] body:not(.home) .rx-enc-sec > table { display:block !important; max-width:100% !important; overflow-x:auto !important; }
  }
}
@layer redicoBento {
 @media(max-width:768px) {
  html[data-rx-bento] .rx-ai .rx-ai__form {display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;}
  html[data-rx-bento] .rx-ai .rx-ai__form :is(textarea,.rx-ai__send) {grid-column:1!important;width:100%!important;min-width:0!important;max-width:100%!important;}
 }
}
