/*
 * KEDAICDID R320 — unified centered layout for tablet screens.
 * Fixes the R231 + R319 width/margin collision by giving every tablet
 * content group a measured width and automatic, equal side margins.
 * Desktop (>1200px) and phone (<=700px) styles remain unchanged.
 */
@media (min-width:701px) and (max-width:1200px) {
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] {
    --kcd-r320-gutter:clamp(18px,3vw,32px);
    --kcd-r320-content-max:1180px;
    min-width:0!important;
    max-width:100%!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order {
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0 auto!important;
    padding:0 0 30px!important;
    box-sizing:border-box!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order .kcd-order-shell {
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0 auto!important;
    padding:0!important;
    box-sizing:border-box!important;
  }

  /* Shared alignment for tabs, category tiles, account grids and product/form layout. */
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order .kcd-order-shell > .kcd-order-tabs,
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order .kcd-order-shell > :is(.kcd-category-grid,.ref-account-grid,.kcd-order-layout) {
    width:calc(100% - clamp(36px,6vw,64px))!important;
    max-width:var(--kcd-r320-content-max)!important;
    min-width:0!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding-left:0!important;
    padding-right:0!important;
    box-sizing:border-box!important;
    transform:none!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order .kcd-order-shell > .kcd-order-tabs {
    margin-top:20px!important;
    margin-bottom:16px!important;
    display:flex!important;
    flex-wrap:wrap!important;
    justify-content:center!important;
    gap:10px!important;
  }

  /* Keep the back link aligned with the same centered content edge. */
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .hc-back,
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order .kcd-order-shell > .kcd-account-back {
    position:relative!important;
    inset:auto!important;
    display:inline-flex!important;
    width:max-content!important;
    max-width:calc(100vw - clamp(36px,6vw,64px))!important;
    margin:16px 0 16px max(var(--kcd-r320-gutter),calc((100vw - var(--kcd-r320-content-max))/2))!important;
    transform:none!important;
    box-sizing:border-box!important;
  }

  /* Main order area: one centered column, with the product grid inside it. */
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-order-layout {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"catalog" "format"!important;
    align-items:stretch!important;
    justify-items:stretch!important;
    gap:clamp(16px,2vw,22px)!important;
    width:calc(100% - clamp(36px,6vw,64px))!important;
    max-width:var(--kcd-r320-content-max)!important;
    min-width:0!important;
    margin:18px auto 26px!important;
    padding:0!important;
    box-sizing:border-box!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-order-layout > *,
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-order-layout :is(.kcd-catalog-panel,.kcd-format-panel) {
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-catalog-panel {
    grid-area:catalog!important;
    order:1!important;
    padding:0!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-format-panel {
    grid-area:format!important;
    order:2!important;
    position:static!important;
    inset:auto!important;
    top:auto!important;
    padding:clamp(18px,2.4vw,26px)!important;
    overflow:visible!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-product-grid {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:stretch!important;
    justify-items:stretch!important;
    gap:clamp(10px,1.5vw,16px)!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-product-grid > *,
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-product-card {
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    overflow-wrap:anywhere!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-product-card {
    width:100%!important;
    margin-left:0!important;
    margin-right:0!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-format-fields {
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:13px clamp(12px,1.6vw,18px)!important;
    box-sizing:border-box!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-format-fields > *,
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-format-panel :is(input,textarea,select,button) {
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  /* Center supporting pages to the same visual grid as catalog and services. */
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #akun .game-tabs,
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #akun .ref-account-grid,
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #lacak :is(#track-input-box,#track-result-box),
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #testimoni :is(#v10-testi-access,#testi-container,#loadMoreBtn),
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #sosmed #social-media-list,
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #cara-order :is(.kcd-cara-v69-flow,.kcd-cara-v69-help,.kcd-v69-caption),
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #syarat :is(.kcd-terms-v69-tabs,.kcd-terms-v69-detail),
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #faq :is(.kcd269-faq-tabs,.kcd265-questions,.kcd265-faq) {
    width:calc(100% - clamp(36px,6vw,64px))!important;
    max-width:var(--kcd-r320-content-max)!important;
    min-width:0!important;
    margin-left:auto!important;
    margin-right:auto!important;
    box-sizing:border-box!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #testimoni #testi-container,
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #testimoni #loadMoreBtn {
    justify-self:center!important;
  }

  /* Keep the footer brand and link groups centered within the same page grid. */
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #footer-sosmed .footer-grid,
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #footer-sosmed .f-bottom {
    width:100%!important;
    max-width:var(--kcd-r320-content-max)!important;
    margin-left:auto!important;
    margin-right:auto!important;
    box-sizing:border-box!important;
  }

  /* The activity toast is centered on tablets, not pinned to a lower corner. */
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #popup-notification {
    position:fixed!important;
    top:calc(env(safe-area-inset-top,0px) + 8px)!important;
    right:auto!important;
    bottom:auto!important;
    left:50%!important;
    width:min(240px,calc(100vw - 40px))!important;
    max-width:240px!important;
    box-sizing:border-box!important;
    transform:translate3d(-50%,-18px,0)!important;
  }

  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #popup-notification.show {
    transform:translate3d(-50%,0,0)!important;
  }
}

/* Larger touch tablets: keep content centered even when the desktop header fits. */
@media (min-width:1101px) and (max-width:1200px) and (hover:none) and (pointer:coarse) {
  html:root:root:root:root:root:root:root:root:root:root:root:root:root:root [data-kedaicdid-legacy-root] #order.kcd-inline-order .kcd-order-layout {
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"catalog" "format"!important;
  }
}
