/* One layout for desktop and phones. Overrides the 1200px desktop lock. */

body,
#toptb,
#hd,
#hd .wp,
.dz_btm_layer,
.dz_wide .wp,
.wp {
  min-width: 0 !important;
}
.dz_wide .wp,
.wp {
  width: auto !important;
  max-width: 1200px !important;
  box-sizing: border-box;
}
img,
video {
  max-width: 100%;
  height: auto;
}
.t_f,
.pcb,
.kmcon {
  overflow-wrap: anywhere;
}
.t_f img,
.pcb img,
.t_f video {
  max-width: 100% !important;
  height: auto !important;
}
.t_f iframe,
.pcb iframe {
  max-width: 100%;
}
.t_f pre,
.t_f table,
.blockcode,
.blockcode ol {
  max-width: 100%;
}
.t_f pre,
.blockcode {
  overflow-x: auto;
}

/* AdSense: reserve a slot, then drop it if Google returns nothing */
.a_h,
.a_f,
.a_pb,
.a_pt {
  box-sizing: border-box;
  max-width: 1200px;
  margin: 12px auto;
  overflow: hidden;
}
.a_h,
.a_f {
  min-height: 100px;
}
.a_pb,
.a_pt {
  min-height: 120px;
  margin: 14px 0;
}
.a_h ins.adsbygoogle,
.a_f ins.adsbygoogle,
.a_pb ins.adsbygoogle,
.a_pt ins.adsbygoogle {
  min-height: 90px;
}
.a_h:has(ins[data-ad-status="unfilled"]),
.a_f:has(ins[data-ad-status="unfilled"]),
.a_pb:has(ins[data-ad-status="unfilled"]),
.a_pt:has(ins[data-ad-status="unfilled"]) {
  display: none !important;
  min-height: 0 !important;
  margin: 0 !important;
}
.dz_footc_nav a[href*="showmobile"],
.dz_footc_nav a[href*="mobile=yes"],
.dz_footc_nav a[href*="showmobile"] + .pipe,
.dz_footc_nav a[href*="mobile=yes"] + .pipe {
  display: none !important;
}

@media (max-width: 1100px) {
  .tvb-hero-official {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden;
  }
  .wp {
    margin-left: 12px !important;
    margin-right: 12px !important;
  }
  #wp .wp {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .dz_btm_layer.dz_nav {
    max-width: none !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

@media (max-width: 860px) {
  html,
  body {
    overflow-x: hidden;
  }
  h1, h2, h3,
  .bm_h,
  .xs1,
  .xs2 {
    white-space: normal !important;
    height: auto !important;
  }
  #pt,
  #pt .y,
  #pt .z,
  #an,
  #an li,
  #an li span {
    float: none !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
  }
  .google-auto-placed,
  ins.adsbygoogle,
  iframe[id^="aswift_"],
  iframe[id^="google_ads_iframe"] {
    max-width: 100% !important;
  }
  .dz_btm_layer,
  .dz_btm_layer.dz_nav {
    height: auto !important;
    min-height: 0 !important;
    flex-wrap: wrap !important;
    row-gap: 0 !important;
  }
  .dz_nav .dz_nav_logo,
  .dz_layer_dl,
  .header-right {
    height: 52px !important;
  }
  .dz_layer_nav {
    order: 3;
    flex: 1 0 100% !important;
    width: 100% !important;
    height: 44px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  .dz_layer_nav ul {
    width: max-content;
    min-width: 100%;
    height: 44px !important;
    flex-wrap: nowrap !important;
  }
  .header-searcher .search-input {
    width: 112px !important;
  }
  .ct2 .mn,
  .ct2 .sd,
  .dz_wide .ct2 .mn,
  .dz_wide .ct2 .sd,
  .ct2_a .mn,
  .ct3_a .mn,
  .ct3_a .sd,
  .dz_wide .ct2_a .mn,
  .dz_wide .ct3_a .mn,
  .appl {
    float: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  #sd_bdl,
  .dz_bdl {
    display: none !important;
  }
  #chart,
  #chart .chart,
  #chart .y {
    float: none !important;
    width: auto !important;
    white-space: normal !important;
  }
  #category_grid,
  #category_grid table,
  #category_grid tbody,
  #category_grid tr,
  #category_grid td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  #category_grid .slidebox_grid,
  #category_grid .module {
    width: 100% !important;
    max-width: 100% !important;
  }
  #ct.ct2,
  .boardnav #ct {
    margin-left: 0 !important;
  }
  .forumportal_listc li .kmimg_onebox,
  .forumportal_listb li .kmimg_onebox {
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }
  .dz_list_top {
    overflow-x: auto;
    white-space: nowrap;
  }
  .plhin,
  .plhin > tbody,
  .plhin > tbody > tr,
  table.posthead,
  table.posthead > tbody,
  table.posthead > tbody > tr,
  #postlist > table,
  #postlist > table > tbody,
  #postlist > table > tbody > tr {
    display: block;
    width: 100% !important;
  }
  .plhin td.pls,
  .plhin td.plc,
  .posthead td.pls,
  .posthead td.plc,
  td.pls,
  td.plc {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  #postlist .pls,
  .posthead .pls,
  .plhin .pls,
  .plhin td.pls,
  .posthead td.pls {
    width: 100% !important;
    max-width: 100% !important;
    border-right: 0 !important;
    border-radius: 0 !important;
  }
  .plhin td.pls:empty,
  td.pls:empty,
  .ad .pls,
  .ad .plc {
    display: none !important;
  }
  .posthead .pls {
    padding: 10px 12px 0 !important;
    text-align: left !important;
  }
  .posthead .plc,
  .vwthd {
    padding: 8px 12px 10px !important;
  }
  .vwthd div.y {
    float: none !important;
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin: 0 0 6px !important;
  }
  h1.ts,
  .vwthd h1 {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1.45 !important;
    white-space: normal !important;
  }
  .vwthd .xg1 {
    display: block !important;
    margin-top: 6px;
    white-space: nowrap !important;
  }
  .plhin td.pls {
    padding: 0 !important;
  }
  .plhin .favatar {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 12px 12px 0 !important;
    border: 0 !important;
    box-sizing: border-box;
  }
  .plhin .favatar > .pi {
    order: 2;
    flex: 1 1 auto;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .plhin .favatar > div:has(.avatar) {
    order: 1;
    flex: 0 0 44px;
    width: 44px !important;
  }
  .plhin .pls .avatar,
  .plhin .avtm,
  .plhin .pls .avatar img,
  .plhin .avtm img {
    float: none !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .plhin .pls .xl,
  .plhin .pls .tns,
  .plhin .pls dl,
  .plhin .pls .pil,
  .plhin .pls p,
  .pls .o {
    display: none !important;
  }
  .plhin .plc > .pi {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    height: auto !important;
    margin: 0 !important;
    padding: 8px 12px 4px !important;
  }
  .plhin .plc > .pi > strong {
    order: 1;
  }
  .plhin .plc > .pi > .pti {
    order: 2;
    flex: 1 1 180px;
    min-width: 0;
  }
  .plhin .plc .authi {
    line-height: 1.7 !important;
    height: auto !important;
  }
  #fj {
    order: 3;
    float: none !important;
    display: flex !important;
    align-items: center;
    gap: 6px;
    flex: 1 0 100%;
    width: auto !important;
    margin: 2px 0 6px !important;
  }
  #fj label,
  #fj input,
  #fj a {
    float: none !important;
    position: static !important;
  }
  #fj input.p_fre {
    width: 52px !important;
    height: 28px !important;
    margin: 0 !important;
  }
  .pcb {
    margin-right: 0 !important;
    padding: 0 12px !important;
  }
  #pt,
  .bm_h,
  #pgt,
  .pgs {
    overflow-x: auto;
  }
  #f_pst,
  #f_pst .tedt,
  #f_pst .area,
  #fastpostmessage,
  .tedt .area {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .fwinmask,
  .m_c,
  #fwin_dialog .m_c {
    max-width: calc(100vw - 16px) !important;
    box-sizing: border-box;
  }
  .nfl,
  .nfl .f_c {
    width: auto !important;
  }
  .dz_rnav {
    left: auto !important;
    right: 10px !important;
    bottom: 12px;
  }
  .dz_rnav a:not(.dz_rtop) {
    display: none !important;
  }
  .dz_footc_nav,
  .dz_footc_copy {
    padding-left: 12px;
    padding-right: 12px;
  }
  .a_h,
  .a_f {
    min-height: 80px;
    margin-left: 12px;
    margin-right: 12px;
  }
}

@media (max-width: 640px) {
  .header-searcher {
    display: none !important;
  }
  .dz_nav_logo .boardlogo,
  #boardlogo {
    max-width: 132px !important;
  }
  .bm,
  .bm_c,
  .bm_h {
    box-sizing: border-box;
  }
  .pg a,
  .pg strong,
  .pgb a {
    margin-bottom: 6px;
  }
}
