/* Offline mirror: restore the original profile background assets. */
#pet_head_content .pet_birth {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_head_birth.jpg') !important;
}

.img_large #pet_head_content .pet_detail_data_container .pet_birth {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_head_birth.jpg');
}

#pet_head_content .pet_area {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_head_area.jpg') !important;
}

.img_large #pet_head_content .pet_detail_data_container .pet_area {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_head_area.jpg');
}

#pet_head_content .pet_view {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_head_view.jpg') !important;
}

.img_large #pet_head_content .pet_detail_data_container .pet_view {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_head_view.jpg');
}

#pet_head_content .pet_owner {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_head_owner.jpg') !important;
}

.img_large #pet_head_content .pet_detail_data_container .pet_owner {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_head_owner.jpg');
}

.result_item_07_wrap_02 .no_result_item_wrap {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_logo_bg.png') !important;
}

.owner_result_wrap {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/circle_bar_bg.jpg') !important;
}

.pet_prof_detail .pet_character_01 {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_character_01.jpg') !important;
}

.pet_prof_detail .pet_character_03 {
  background-image: url('../../mirror-assets/prof_dogs_sc1087_pet151100/pet_character_03.jpg') !important;
}

/* Keep the offline X share control identical to the rendered widget. */
.page_sns_wrap .fst {
  height: 26.1875px;
}

.page_sns_wrap .offline_share_x {
  align-items: center;
  background: #000;
  border-radius: 9999px;
  box-sizing: border-box;
  color: #fff;
  display: inline-flex !important;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  gap: 3px;
  height: 20px;
  letter-spacing: normal;
  line-height: 18px;
  overflow: hidden;
  padding: 1px 12px;
  text-decoration: none;
  vertical-align: top;
  width: 77px;
}

.page_sns_wrap .offline_share_x * {
  letter-spacing: normal;
}

.page_sns_wrap .offline_share_x .offline_share_mark {
  display: block;
  flex: 0 0 auto;
  height: 14px;
  width: 14px;
}

.page_sns_wrap .offline_share_x > span {
  display: inline-block !important;
  height: 18px;
  line-height: 18px;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

/* === H5: pet profile detail (PC untouched above 767px) === */
@media (max-width: 767px) {
  body.prof_page,
  body.latest_layout_page,
  body.pet_page_detail {
    min-width: 0 !important;
  }

  body.latest_layout_page .page_content_wrap,
  body.latest_layout_page .page_content_container,
  body.latest_layout_page .content_container,
  body.latest_layout_page .content_inner_container,
  body.latest_layout_page .content_inner_container_03,
  body.latest_layout_page #pet_head_content {
    width: 100% !important;
    max-width: 100%;
    float: none !important;
  }

  /* —— Menus —— */
  body.latest_layout_page .common_page_menus .box,
  body.latest_layout_page .prof_menus .box {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.latest_layout_page .common_page_menus .scrolling_menu,
  body.latest_layout_page .common_page_menus .menus {
    flex-wrap: nowrap;
    min-width: max-content;
    gap: 16px;
  }

  body.latest_layout_page .prof_content_header .title {
    font-size: 1.5rem;
  }

  /* —— Cover hero —— */
  body.latest_layout_page #pet_head_content .pet_head_cover {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    min-height: 180px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
  }

  body.latest_layout_page #pet_head_content,
  body.latest_layout_page .img_large #pet_head_content {
    background-size: cover !important;
  }

  body.latest_layout_page #pet_head_content .cover_img {
    position: absolute;
    inset: 0;
    margin-top: 0 !important;
    width: 100%;
    height: 100%;
  }

  body.latest_layout_page #pet_head_content .cover_img img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none !important;
    object-fit: cover;
    object-position: center center;
  }

  body.latest_layout_page #pet_head_content .pet_head_btn_container {
    right: 10px;
    top: 10px;
    z-index: 2;
  }

  body.latest_layout_page #pet_head_content .btn_protect {
    right: 10px !important;
    bottom: 48px !important;
    width: auto !important;
    min-width: 160px;
    max-width: calc(100% - 20px);
    padding: 0 12px;
    z-index: 2;
  }

  body.latest_layout_page #pet_head_content .pet_tagged_btn {
    right: 10px !important;
    bottom: 12px !important;
    width: auto !important;
    min-width: 160px;
    max-width: calc(100% - 20px);
    padding: 0 12px;
    z-index: 2;
  }

  /* —— Head data: avatar + name + meta —— */
  body.latest_layout_page #pet_head_content .pet_head_data_container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 0;
    padding: 0 0 12px;
  }

  body.latest_layout_page #pet_head_content .pet_head_left,
  body.latest_layout_page #pet_head_content .pet_head_right,
  body.latest_layout_page #pet_head_content .pet_head_inner_left,
  body.latest_layout_page #pet_head_content .pet_prof_area {
    float: none !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
  }

  body.latest_layout_page #pet_head_content .pet_head_left {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    margin-top: -48px !important;
    padding: 0 12px;
    position: relative;
    z-index: 3;
  }

  body.latest_layout_page #pet_head_content .pet_head_inner_left {
    flex: 0 0 96px;
    width: 96px !important;
    margin: 0 !important;
  }

  body.latest_layout_page #pet_head_content .pet_pics_area {
    width: 96px;
    height: 96px;
    overflow: hidden;
    background: #fff;
  }

  body.latest_layout_page #pet_head_content .pet_pics_area img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  body.latest_layout_page #pet_head_content .pet_prof_area {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    margin: 0 !important;
    padding-bottom: 4px;
  }

  body.latest_layout_page #pet_head_content .pet_prof_area .title {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  body.latest_layout_page #pet_head_content .pet_head_right {
    padding: 0 12px;
  }

  body.latest_layout_page #pet_head_content .pet_detail_data_container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px !important;
  }

  body.latest_layout_page #pet_head_content .pet_detail_data_container li {
    float: none !important;
    margin-right: 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
  }

  body.latest_layout_page .pet_detail_data_container {
    float: none !important;
    width: 100% !important;
  }

  /* —— Tabs —— */
  body.latest_layout_page #pet_prof_tab.tab_btn_wrap,
  body.latest_layout_page .tab_btn_wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-right: 0 !important;
    width: 100%;
  }

  body.latest_layout_page .tab_btn_wrap li {
    float: none !important;
    flex: 1 1 calc(50% - 6px);
    width: auto !important;
    min-width: 0;
    margin-left: 0 !important;
    box-sizing: border-box;
    font-size: 12px;
    height: 36px !important;
    line-height: 36px !important;
  }

  /* —— Main + sidebar —— */
  body.latest_layout_page .main_content_column,
  body.latest_layout_page .sub_content_column {
    float: none !important;
    width: 100% !important;
    max-width: 100%;
  }

  body.latest_layout_page .side_ads_wrap,
  body.latest_layout_page [id^="PC_"],
  body.latest_layout_page .header_ads_wrap,
  body.latest_layout_page #PC_wide {
    display: none !important;
  }

  body.latest_layout_page .prof_comment_container p {
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }

  body.latest_layout_page .page_sns_wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  body.latest_layout_page .page_sns_wrap li {
    float: none !important;
    margin-left: 0 !important;
  }

  body.latest_layout_page .page_sns_wrap > li[style*="width: 157px"] {
    width: auto !important;
    max-width: 100%;
  }

  /* Personality graph: stack pairs on narrow screens */
  body.latest_layout_page .pet_personality_graph,
  body.latest_layout_page .pet_health_table {
    width: 100%;
    display: block;
  }

  body.latest_layout_page .pet_personality_graph tbody,
  body.latest_layout_page .pet_personality_graph tr,
  body.latest_layout_page .pet_health_table tbody,
  body.latest_layout_page .pet_health_table tr {
    display: block;
    width: 100%;
  }

  body.latest_layout_page .pet_personality_graph th,
  body.latest_layout_page .pet_personality_graph td,
  body.latest_layout_page .pet_health_table th,
  body.latest_layout_page .pet_health_table td {
    display: block;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    padding: 6px 0 !important;
  }

  body.latest_layout_page .pet_personality_graph .graph_bar {
    width: 100% !important;
    max-width: 100%;
  }

  body.latest_layout_page .pet_health_table th {
    font-weight: 700;
    padding-bottom: 2px !important;
  }

  body.latest_layout_page .pet_health_table td {
    padding-top: 0 !important;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px !important;
  }

  /* Character chips: full-width rows */
  body.latest_layout_page .pet_prof_detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
    letter-spacing: normal !important;
  }

  body.latest_layout_page .pet_prof_detail li,
  body.latest_layout_page .pet_prof_detail .inline {
    display: block !important;
    float: none !important;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    margin-right: 0 !important;
    letter-spacing: normal !important;
  }

  /* Sidebar gallery / owner */
  body.latest_layout_page .sub_content_column {
    margin-top: 24px;
  }

  body.latest_layout_page .side_gallery_wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.latest_layout_page .side_gallery_wrap .img_container {
    float: none !important;
    flex: 0 0 calc(50% - 4px);
    width: calc(50% - 4px) !important;
    margin: 0 !important;
  }

  body.latest_layout_page .side_gallery_wrap img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  body.latest_layout_page .owner_area,
  body.latest_layout_page .owner_result_wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background-position: right 12px center !important;
  }

  body.latest_layout_page .owner_result_wrap .info_container {
    width: auto !important;
    max-width: calc(100% - 100px);
  }

  body.latest_layout_page .result_item_07 {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    box-sizing: border-box;
  }

  body.latest_layout_page .result_item_07_wrap {
    margin-left: 0 !important;
  }

  body.latest_layout_page .result_item_05_wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  body.latest_layout_page .result_item_05 {
    float: none !important;
    margin: 0 !important;
  }

  body.latest_layout_page .prof_page_title_img img {
    max-width: 160px;
    height: auto !important;
    width: auto !important;
  }

  /* Photos only — leave CSS sprites alone */
  body.latest_layout_page #pet_head_content img:not(.ui_img):not(.mask),
  body.latest_layout_page .main_content_column img:not(.ui_img),
  body.latest_layout_page .sub_content_column img:not(.ui_img) {
    max-width: 100%;
    height: auto;
  }

  body.latest_layout_page #pet_head_content .cover_img img {
    height: 100% !important;
    max-width: none !important;
  }
}

@media (max-width: 380px) {
  body.latest_layout_page .tab_btn_wrap li {
    flex: 1 1 100%;
  }

  body.latest_layout_page #pet_head_content .pet_head_left {
    margin-top: -40px !important;
  }

  body.latest_layout_page #pet_head_content .pet_head_inner_left,
  body.latest_layout_page #pet_head_content .pet_pics_area {
    flex-basis: 80px;
    width: 80px !important;
    height: 80px;
  }
}