/* MiKO Mobile Header V8 — authoritative final layout for <=1024px */
@media (max-width:1024px){
  body.home .miko-news-tools{
    display:grid!important;
    grid-template-columns:72px 92px minmax(0,1fr)!important;
    grid-template-rows:44px 52px!important;
    grid-template-areas:
      "menu member mode"
      "field field field"!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    margin:0!important;
    padding:7px!important;
    gap:6px!important;
    align-items:center!important;
    border:1px solid #d7e3ef!important;
    border-radius:20px!important;
    background:#fff!important;
    box-shadow:0 8px 22px rgba(22,62,108,.07)!important;
    overflow:hidden!important;
  }
  body.home .miko-news-search[data-miko-search]{display:contents!important}
  body.home .miko-mobile-menu{grid-area:menu!important;display:flex!important}
  body.home .miko-member-account{grid-area:member!important;display:flex!important}
  body.home .miko-search-mode{grid-area:mode!important;display:grid!important}
  body.home .miko-search-field-row{grid-area:field!important;display:grid!important}
  body.home .miko-reward-header-btn,
  body.home .miko-saved-news-toggle,
  body.home .miko-notification-header-btn{display:none!important}

  body.home .miko-mobile-menu,
  body.home .miko-member-account{
    width:100%!important;
    min-width:0!important;
    height:40px!important;
    min-height:40px!important;
    padding:0 5px!important;
    margin:0!important;
    border:1px solid #e1e9f2!important;
    border-radius:12px!important;
    background:#fff!important;
    box-shadow:none!important;
    flex-direction:column!important;
    justify-content:center!important;
    align-items:center!important;
    gap:2px!important;
    color:#173a63!important;
    overflow:hidden!important;
  }
  body.home .miko-mobile-menu .miko-menu-bars{width:22px!important;height:16px!important;flex:0 0 16px!important}
  body.home .miko-member-account>svg{width:20px!important;height:20px!important;flex:0 0 20px!important}
  body.home .miko-mobile-menu-label,
  body.home .miko-member-account-label{
    display:block!important;
    max-width:100%!important;
    margin:0!important;
    font-size:8.5px!important;
    line-height:1!important;
    font-weight:800!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body.home .miko-mobile-menu .screen-reader-text{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
  }

  body.home .miko-search-mode{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:40px!important;
    grid-template-columns:1fr 1fr!important;
    gap:3px!important;
    padding:3px!important;
    margin:0!important;
    border:1px solid #d2dfec!important;
    border-radius:12px!important;
    background:#eef4fa!important;
    box-shadow:none!important;
    overflow:hidden!important;
  }
  body.home .miko-search-mode button{
    width:100%!important;
    min-width:0!important;
    height:32px!important;
    margin:0!important;
    padding:0 5px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;
    border:0!important;
    border-radius:9px!important;
    overflow:hidden!important;
  }
  body.home .miko-search-mode button.is-active{
    background:#fff!important;
    box-shadow:0 2px 8px rgba(27,70,118,.08)!important;
  }
  body.home .miko-search-mode button span{
    width:21px!important;
    height:21px!important;
    min-width:21px!important;
    flex:0 0 21px!important;
    border-radius:6px!important;
    font-size:10px!important;
  }
  body.home .miko-search-mode button b{
    min-width:0!important;
    max-width:100%!important;
    font-size:9.5px!important;
    line-height:1!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  body.home .miko-search-field-row{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:52px!important;
    grid-template-columns:30px minmax(0,1fr) 42px!important;
    align-items:center!important;
    gap:4px!important;
    margin:0!important;
    padding:4px 4px 4px 10px!important;
    border:1px solid #c8d8e8!important;
    border-radius:16px!important;
    background:#f9fbfe!important;
    box-shadow:inset 0 1px 0 #fff,0 3px 10px rgba(22,66,114,.04)!important;
    overflow:hidden!important;
  }
  body.home .miko-search-leading{display:grid!important;place-items:center!important;width:24px!important;height:24px!important}
  body.home .miko-search-leading svg{width:19px!important;height:19px!important}
  body.home .miko-search-field-row input{
    width:100%!important;
    min-width:0!important;
    height:40px!important;
    margin:0!important;
    padding:0 6px!important;
    border:0!important;
    outline:0!important;
    background:transparent!important;
    font-size:11.5px!important;
    font-weight:700!important;
    color:#17385f!important;
    text-overflow:ellipsis!important;
  }
  body.home .miko-search-submit{
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    margin:0!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    border:0!important;
    border-radius:11px!important;
    background:#086cf0!important;
    color:#fff!important;
    box-shadow:0 5px 12px rgba(8,108,240,.22)!important;
  }
}

@media (max-width:430px){
  body.home .miko-news-tools{
    grid-template-columns:64px 82px minmax(0,1fr)!important;
    grid-template-rows:42px 50px!important;
    padding:6px!important;
    gap:5px!important;
    border-radius:18px!important;
  }
  body.home .miko-mobile-menu,
  body.home .miko-member-account{height:38px!important;min-height:38px!important}
  body.home .miko-search-mode{height:38px!important;padding:3px!important}
  body.home .miko-search-mode button{height:30px!important;padding:0 4px!important;gap:3px!important}
  body.home .miko-search-mode button span{width:19px!important;height:19px!important;min-width:19px!important;flex-basis:19px!important}
  body.home .miko-search-mode button b{font-size:9px!important}
  body.home .miko-search-field-row{
    height:50px!important;
    grid-template-columns:26px minmax(0,1fr) 38px!important;
    padding:4px 4px 4px 8px!important;
  }
  body.home .miko-search-field-row input{height:38px!important;font-size:10.5px!important}
  body.home .miko-search-submit{width:36px!important;min-width:36px!important;height:36px!important}
}

@media (max-width:390px){
  body.home .miko-news-tools{
    grid-template-columns:60px 76px minmax(0,1fr)!important;
    grid-template-rows:40px 48px!important;
    padding:5px!important;
    gap:4px!important;
  }
  body.home .miko-mobile-menu,
  body.home .miko-member-account{height:36px!important;min-height:36px!important}
  body.home .miko-mobile-menu-label,
  body.home .miko-member-account-label{font-size:8px!important}
  body.home .miko-search-mode{height:36px!important;padding:2px!important}
  body.home .miko-search-mode button{height:30px!important;padding:0 3px!important;gap:2px!important}
  body.home .miko-search-mode button span{width:18px!important;height:18px!important;min-width:18px!important;flex-basis:18px!important}
  body.home .miko-search-mode button b{font-size:8.5px!important}
  body.home .miko-search-field-row{
    height:48px!important;
    grid-template-columns:24px minmax(0,1fr) 36px!important;
    padding:3px 3px 3px 7px!important;
  }
  body.home .miko-search-leading,
  body.home .miko-search-leading svg{width:17px!important;height:17px!important}
  body.home .miko-search-field-row input{height:36px!important;font-size:10px!important}
  body.home .miko-search-submit{width:34px!important;min-width:34px!important;height:34px!important}
}

@media (max-width:360px){
  body.home .miko-news-tools{
    grid-template-columns:56px 70px minmax(0,1fr)!important;
    grid-template-rows:38px 46px!important;
    padding:4px!important;
    gap:3px!important;
    border-radius:16px!important;
  }
  body.home .miko-mobile-menu,
  body.home .miko-member-account{
    height:34px!important;
    min-height:34px!important;
    padding-left:3px!important;
    padding-right:3px!important;
  }
  body.home .miko-mobile-menu-label,
  body.home .miko-member-account-label{font-size:7.5px!important}
  body.home .miko-search-mode{height:34px!important;padding:2px!important;border-radius:10px!important}
  body.home .miko-search-mode button{height:28px!important;padding:0 2px!important;gap:2px!important}
  body.home .miko-search-mode button span{width:17px!important;height:17px!important;min-width:17px!important;flex-basis:17px!important}
  body.home .miko-search-mode button b{font-size:8px!important}
  body.home .miko-search-field-row{
    height:46px!important;
    grid-template-columns:22px minmax(0,1fr) 34px!important;
    padding:3px 3px 3px 6px!important;
    border-radius:14px!important;
  }
  body.home .miko-search-leading,
  body.home .miko-search-leading svg{width:16px!important;height:16px!important}
  body.home .miko-search-field-row input{height:34px!important;font-size:9.5px!important;padding-left:2px!important;padding-right:2px!important}
  body.home .miko-search-submit{width:32px!important;min-width:32px!important;height:32px!important;border-radius:9px!important}
}

/* MiKO Tablet/iPad Header V9 — authoritative 768–1024px two-row layout */
@media (min-width:768px) and (max-width:1024px){
  body.home .miko-news-header{
    position:relative!important;
    width:100%!important;
    padding:10px 0 8px!important;
    overflow:visible!important;
    background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)!important;
    border-bottom:1px solid #edf2f6!important;
    box-shadow:none!important;
  }

  body.home .miko-news-nav-wrap{
    display:grid!important;
    grid-template-columns:84px 130px minmax(250px,1fr) 130px 84px!important;
    grid-template-rows:58px 48px!important;
    grid-template-areas:
      "menu leftgap brand rightgap member"
      "mode mode field field field"!important;
    align-items:center!important;
    justify-items:stretch!important;
    width:min(calc(100% - 28px),996px)!important;
    max-width:996px!important;
    min-height:0!important;
    height:auto!important;
    margin:0 auto!important;
    padding:9px 10px 10px!important;
    gap:8px 0!important;
    border:1px solid #dce7f0!important;
    border-radius:20px!important;
    background:
      radial-gradient(circle at 50% -35%,rgba(67,151,213,.07),transparent 42%),
      linear-gradient(180deg,#ffffff 0%,#f9fcff 100%)!important;
    box-shadow:0 8px 24px rgba(34,72,102,.065),inset 0 1px 0 #fff!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }

  body.home .miko-news-brand{
    grid-area:brand!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    height:58px!important;
    margin:0!important;
    padding:0!important;
    align-self:center!important;
    justify-self:center!important;
  }
  body.home .miko-news-brand img{
    content:url("https://mikothai.com/wp-content/uploads/2026/09/MiKO-NEWS-Mobile-Logo.png")!important;
    display:block!important;
    width:148px!important;
    max-width:100%!important;
    max-height:52px!important;
    height:auto!important;
    margin:0 auto!important;
    object-fit:contain!important;
    animation:none!important;
    transform:none!important;
    filter:drop-shadow(0 3px 8px rgba(25,75,116,.08))!important;
  }
  body.home .miko-news-brand span,
  body.home .miko-news-brand::before,
  body.home .miko-news-brand::after{display:none!important}

  body.home .miko-news-mainnav{
    position:fixed!important;
  }

  body.home .miko-news-tools,
  body.home .miko-news-search[data-miko-search]{
    display:contents!important;
  }

  body.home .miko-mobile-menu{
    grid-area:menu!important;
    justify-self:start!important;
  }
  body.home .miko-member-account{
    grid-area:member!important;
    justify-self:end!important;
  }

  body.home .miko-mobile-menu,
  body.home .miko-member-account{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    width:74px!important;
    min-width:74px!important;
    max-width:74px!important;
    height:42px!important;
    min-height:42px!important;
    margin:0!important;
    padding:0 8px!important;
    gap:6px!important;
    border:1px solid #dce7f0!important;
    border-radius:12px!important;
    background:#fff!important;
    color:#173a5c!important;
    box-shadow:0 3px 10px rgba(40,77,106,.055)!important;
    overflow:hidden!important;
    transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,color .18s ease!important;
  }
  body.home .miko-mobile-menu:hover,
  body.home .miko-mobile-menu:focus-visible,
  body.home .miko-member-account:hover,
  body.home .miko-member-account:focus-visible{
    color:#176fa9!important;
    border-color:#b7d8ef!important;
    box-shadow:0 7px 16px rgba(43,100,143,.09)!important;
    transform:translateY(-1px)!important;
    outline:none!important;
  }
  body.home .miko-mobile-menu .miko-menu-bars{
    width:21px!important;
    min-width:21px!important;
    height:16px!important;
    flex:0 0 21px!important;
  }
  body.home .miko-mobile-menu .miko-menu-bars i{
    display:block!important;
    width:100%!important;
    height:2px!important;
    margin:2px 0!important;
    border-radius:99px!important;
    background:currentColor!important;
  }
  body.home .miko-header-avatar{
    display:block!important;
    width:28px!important;
    height:28px!important;
    min-width:28px!important;
    max-width:28px!important;
    flex:0 0 28px!important;
    border-radius:50%!important;
    overflow:hidden!important;
    box-shadow:0 0 0 2px #fff,0 0 0 3px #dce8f2!important;
  }
  body.home .miko-header-avatar img,
  body.home .miko-header-avatar-img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
  }
  body.home .miko-member-account>svg{
    width:22px!important;
    height:22px!important;
    min-width:22px!important;
    flex:0 0 22px!important;
  }
  body.home .miko-mobile-menu-label,
  body.home .miko-member-account-label{
    display:block!important;
    min-width:0!important;
    max-width:38px!important;
    margin:0!important;
    color:inherit!important;
    font-size:9px!important;
    line-height:1!important;
    font-weight:850!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body.home .miko-member-account.is-logged-in .miko-member-account-label{
    font-size:0!important;
  }
  body.home .miko-member-account.is-logged-in .miko-member-account-label::after{
    content:"โปรไฟล์"!important;
    font-size:9px!important;
  }
  body.home .miko-member-account.is-logged-in .miko-member-account-label small{display:none!important}

  body.home .miko-reward-header-btn,
  body.home .miko-saved-news-toggle,
  body.home .miko-notification-header-btn{
    display:none!important;
  }

  body.home .miko-search-mode{
    grid-area:mode!important;
    align-self:center!important;
    justify-self:stretch!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:46px!important;
    margin:0 8px 0 0!important;
    padding:3px!important;
    gap:3px!important;
    border:1px solid #d8e4ee!important;
    border-radius:13px!important;
    background:#eef4f9!important;
    box-shadow:inset 0 1px 0 #fff!important;
    overflow:hidden!important;
  }
  body.home .miko-search-mode button{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    height:38px!important;
    margin:0!important;
    padding:0 8px!important;
    gap:6px!important;
    border:0!important;
    border-radius:10px!important;
    background:transparent!important;
    color:#526b82!important;
    box-shadow:none!important;
    font-size:10px!important;
    font-weight:850!important;
    overflow:hidden!important;
  }
  body.home .miko-search-mode button.is-active{
    background:#fff!important;
    color:#176fa9!important;
    box-shadow:0 3px 9px rgba(42,98,140,.08)!important;
  }
  body.home .miko-search-mode button span{
    width:22px!important;
    height:22px!important;
    min-width:22px!important;
    flex:0 0 22px!important;
    display:grid!important;
    place-items:center!important;
    border-radius:7px!important;
    background:#fff!important;
    color:#526b82!important;
    box-shadow:inset 0 0 0 1px #d7e2ec!important;
    font-size:10px!important;
    font-weight:900!important;
  }
  body.home .miko-search-mode button.is-active span{
    background:#1777c8!important;
    color:#fff!important;
    box-shadow:none!important;
  }
  body.home .miko-search-mode button b{
    display:inline-block!important;
    min-width:0!important;
    color:inherit!important;
    font-size:10px!important;
    line-height:1!important;
    font-weight:850!important;
    white-space:nowrap!important;
  }

  body.home .miko-search-field-row{
    grid-area:field!important;
    align-self:center!important;
    display:grid!important;
    grid-template-columns:28px minmax(0,1fr) 40px!important;
    align-items:center!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:46px!important;
    margin:0!important;
    padding:3px 3px 3px 9px!important;
    gap:4px!important;
    border:1px solid #d3e1ec!important;
    border-radius:13px!important;
    background:#fff!important;
    box-shadow:0 3px 10px rgba(37,77,107,.045),inset 0 1px 0 #fff!important;
    overflow:hidden!important;
  }
  body.home .miko-search-leading{
    display:grid!important;
    place-items:center!important;
    width:24px!important;
    height:24px!important;
    color:#698198!important;
  }
  body.home .miko-search-leading svg{
    width:18px!important;
    height:18px!important;
  }
  body.home .miko-search-field-row input{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    height:38px!important;
    margin:0!important;
    padding:0 6px!important;
    border:0!important;
    outline:0!important;
    background:transparent!important;
    color:#193a58!important;
    font-size:11.5px!important;
    font-weight:700!important;
    text-overflow:ellipsis!important;
  }
  body.home .miko-search-field-row input::placeholder{
    color:#8a9caf!important;
    opacity:1!important;
  }
  body.home .miko-search-submit{
    display:grid!important;
    place-items:center!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-radius:10px!important;
    background:linear-gradient(145deg,#2b87c9,#176da8)!important;
    color:#fff!important;
    box-shadow:0 4px 11px rgba(31,114,173,.18)!important;
  }
  body.home .miko-search-submit svg{
    width:17px!important;
    height:17px!important;
  }

  body.home .miko-breaking-wrap{
    width:min(calc(100% - 28px),996px)!important;
    margin:8px auto 10px!important;
  }
}