/* TAIF V5 — Currency Management Bulk Editor Mobile Cards V2
   Base: Bulk Cards V1.
   Scope: mobile-only bulk editor window.
   Fixes thin/hidden cards and forces all four fields to equal size. */

@media (max-width: 860px){
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-scrollarea{
    overflow-x:hidden !important;
    overflow-y:auto !important;
    padding:8px 8px 96px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-sticky-stack,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-toolbar,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-list,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__row{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-grid-head{
    display:none !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-list{
    display:flex !important;
    flex-direction:column !important;
    gap:10px !important;
    padding:0 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card{
    min-height:190px !important;
    height:auto !important;
    padding:9px !important;
    border-radius:17px !important;
    border:1px solid rgba(37,99,235,.18) !important;
    background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%) !important;
    box-shadow:0 9px 22px rgba(15,23,42,.07) !important;
    overflow:visible !important;
    display:block !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card--usd{
    background:linear-gradient(180deg,#f4f8ff 0%,#ffffff 100%) !important;
    border-color:rgba(37,99,235,.26) !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__row{
    display:flex !important;
    flex-wrap:wrap !important;
    direction:rtl !important;
    align-items:stretch !important;
    gap:7px !important;
    overflow:visible !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    padding:0 !important;
    grid-template-columns:none !important;
    grid-template-areas:none !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell{
    box-sizing:border-box !important;
    min-width:0 !important;
    max-width:100% !important;
    width:auto !important;
    height:auto !important;
    min-height:0 !important;
    padding:0 !important;
    margin:0 !important;
    overflow:hidden !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
  }

  /* Header: flag + code + name */
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--flag{
    order:1 !important;
    flex:0 0 40px !important;
    width:40px !important;
    min-width:40px !important;
    height:38px !important;
    min-height:38px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--code{
    order:2 !important;
    flex:0 0 66px !important;
    width:66px !important;
    min-width:66px !important;
    height:38px !important;
    min-height:38px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--name{
    order:3 !important;
    flex:1 1 calc(100% - 120px) !important;
    min-width:0 !important;
    height:38px !important;
    min-height:38px !important;
    justify-content:flex-start !important;
    padding-inline:4px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--pair{
    display:none !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__flag{
    width:34px !important;
    height:34px !important;
    min-width:34px !important;
    min-height:34px !important;
    flex:0 0 34px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__code{
    width:100% !important;
    height:32px !important;
    min-height:32px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    border-radius:10px !important;
    font-size:11px !important;
    font-weight:900 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__name-wrap{
    width:100% !important;
    min-width:0 !important;
    display:block !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__name{
    width:100% !important;
    color:#0f172a !important;
    text-align:right !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    font-size:13px !important;
    font-weight:900 !important;
    line-height:1.1 !important;
  }

  /* Four equal fields: two rows, two columns */
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--buy{
    order:4 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--sell{
    order:5 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--ratio-buy{
    order:6 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--ratio-sell{
    order:7 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor :is(.currency-management-bulk-card__cell--buy,.currency-management-bulk-card__cell--sell,.currency-management-bulk-card__cell--ratio-buy,.currency-management-bulk-card__cell--ratio-sell){
    flex:0 0 calc(50% - 4px) !important;
    width:calc(50% - 4px) !important;
    min-width:calc(50% - 4px) !important;
    max-width:calc(50% - 4px) !important;
    min-height:64px !important;
    height:64px !important;
    display:grid !important;
    grid-template-rows:18px 38px !important;
    gap:4px !important;
    align-items:stretch !important;
    justify-content:stretch !important;
    padding:6px !important;
    border-radius:13px !important;
    border:1px solid rgba(148,163,184,.20) !important;
    background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.92) !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor :is(.currency-management-bulk-card__cell--buy,.currency-management-bulk-card__cell--sell,.currency-management-bulk-card__cell--ratio-buy,.currency-management-bulk-card__cell--ratio-sell)::before{
    content:attr(data-mobile-label) !important;
    display:block !important;
    min-width:0 !important;
    color:#64748b !important;
    font-size:9.4px !important;
    font-weight:900 !important;
    line-height:1.12 !important;
    text-align:center !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-input{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    height:38px !important;
    min-height:38px !important;
    padding:0 7px !important;
    border-radius:11px !important;
    font-size:12.2px !important;
    font-weight:900 !important;
    text-align:center !important;
    align-self:stretch !important;
    justify-self:stretch !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--buy .currency-management-bulk-input,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--ratio-buy .currency-management-bulk-input{
    color:#15803d !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--sell .currency-management-bulk-input,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--ratio-sell .currency-management-bulk-input{
    color:#dc2626 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-modal-actions,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-modal-actions--dock{
    position:absolute !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:8px !important;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px)) !important;
    margin:0 !important;
    background:#f3f7ff !important;
    border-top:1px solid rgba(148,163,184,.16) !important;
    box-shadow:0 -10px 28px rgba(15,23,42,.08) !important;
    z-index:14 !important;
  }
}

@media (max-width: 430px){
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card{
    min-height:184px !important;
    padding:8px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__row{
    gap:6px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--flag{
    flex-basis:38px !important;
    width:38px !important;
    min-width:38px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--code{
    flex-basis:60px !important;
    width:60px !important;
    min-width:60px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__cell--name{
    flex-basis:calc(100% - 110px) !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor :is(.currency-management-bulk-card__cell--buy,.currency-management-bulk-card__cell--sell,.currency-management-bulk-card__cell--ratio-buy,.currency-management-bulk-card__cell--ratio-sell){
    flex-basis:calc(50% - 3px) !important;
    width:calc(50% - 3px) !important;
    min-width:calc(50% - 3px) !important;
    max-width:calc(50% - 3px) !important;
    height:62px !important;
    min-height:62px !important;
    padding:5px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor :is(.currency-management-bulk-card__cell--buy,.currency-management-bulk-card__cell--sell,.currency-management-bulk-card__cell--ratio-buy,.currency-management-bulk-card__cell--ratio-sell)::before{
    font-size:8.8px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-input{
    height:36px !important;
    min-height:36px !important;
    font-size:11.7px !important;
  }
}
