/* Apex home: basic mobile / narrow layout (overrides fixed 1200px legacy shell) */
@media (max-width: 980px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    min-width: 0 !important;
    overflow-x: hidden;
  }

  .headerbox,
  .BigBox,
  .bodybox {
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden;
  }

  .header,
  .headerbox .brann_img ul,
  .box,
  .outing,
  .footer .foo,
  #headdivbox .brann_img ul {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .header {
    height: auto !important;
    padding: 8px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .header > a {
    float: none !important;
  }

  .header ul {
    float: none !important;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
  }

  .header ul li {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Collapse mega-menus on small screens; keep top-level tap targets */
  .header ul #HKcai ul,
  .header ul .Fastkai ul,
  .header ul #HKcai:hover #hkheader,
  .header ul .Fastkai:hover #hkheader,
  .header ul .Fastkai:hover .faheader {
    display: none !important;
  }

  .box {
    margin: 10px 0 !important;
    padding: 0 8px;
    overflow: visible !important;
  }

  .page-hero {
    padding: 12px 14px 10px;
    margin-bottom: 10px;
  }

  .page-h1 {
    font-size: 18px;
  }

  .page-lead {
    font-size: 13px;
  }

  .box .box_firstl,
  .box .box_firstr {
    float: none !important;
    width: 100% !important;
    margin: 0 0 12px !important;
  }

  .box .box_firstl .kjsp {
    height: auto !important;
    padding: 12px !important;
  }

  .box .box_firstl .kjsp .kjspl,
  .box .box_firstl .kjsp .kjspr {
    float: none !important;
    width: 100% !important;
  }

  .box .box_firstl .kjsp .kjspl img {
    max-width: 100%;
    height: auto;
  }

  .box .box_firstl .tmzs .topic {
    float: none !important;
    width: 100% !important;
    height: auto !important;
  }

  .box .box_firstl .tmzs ul {
    display: flex;
    flex-wrap: wrap;
    height: auto !important;
    gap: 4px 12px;
  }

  .box .box_firstl .tmzs ul li {
    float: none !important;
    margin: 0 !important;
  }

  .box .box_firstl .tmzs_tb {
    height: auto !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .box .box_firstl .tmzs_tb canvas,
  #c1 {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .box .yctj,
  .box .zjxs,
  .box .ltrt {
    float: none !important;
    width: 100% !important;
    margin: 0 0 12px !important;
    height: auto !important;
    min-height: 0;
  }

  .box .ltrt ul li,
  .box .ltrt ul li a {
    box-sizing: border-box;
  }

  .box .yctk .yctk_topic .h1label {
    float: none !important;
    width: 100% !important;
  }

  .box .yctk .yctk_topic .spanlabel {
    float: none !important;
    width: 100%;
  }

  .box .yctk .yctk_more {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .box .yctk .yctk_more ul {
    width: max-content !important;
  }

  .box .yctk .drawlist ul {
    width: 100% !important;
    height: auto !important;
    overflow-x: auto;
  }

  .box .propTable {
    height: auto !important;
    overflow-x: auto;
  }

  .box .propTable .propKinds {
    display: flex;
    flex-wrap: wrap;
    height: auto !important;
  }

  .fiveEl_div,
  .box .propTable table {
    width: 100% !important;
    max-width: 100%;
  }

  .footer .foo {
    padding: 12px 10px;
  }

  .footer .footer1 ul {
    float: none !important;
    width: 100% !important;
  }

  .footer .footer1 .erwm {
    float: none !important;
    margin-top: 12px;
  }
}

@media (max-width: 640px) {
  .page-h1 {
    font-size: 16px;
  }

  .header ul li a {
    padding: 0 8px !important;
    font-size: 13px;
  }

  .box .box_firstl .kjsp .kjspr .numbox #jnumber li {
    transform: scale(0.9);
    transform-origin: left center;
  }
}
