/* 사이드바 네이버 스타일 실시간 날씨 위젯 — max-width 400px */
.hm_wx_widget {
  box-sizing: border-box;
  max-width: 400px;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.hm_wx_widget * {
  box-sizing: border-box;
}

.hm_wx_widget a {
  color: inherit;
  text-decoration: none;
}

.hm_wx_widget a:hover {
  text-decoration: underline;
}

.hm_wx_widget__head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #eee;
}

.hm_wx_widget__title_row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.hm_wx_widget__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.hm_wx_widget__link_more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #333;
  background: #f3f4f6;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.hm_wx_widget__link_more:hover {
  background: #e5e7eb;
}

.hm_wx_widget__tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px 2px;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.hm_wx_widget__tab {
  margin: 0;
  padding: 2px 4px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #6b7280;
  line-height: 1.35;
  cursor: pointer;
  border-radius: 6px;
  white-space: nowrap;
}

.hm_wx_widget__tab:hover {
  color: #111;
  background: #f3f4f6;
}

.hm_wx_widget__tab.is-on {
  color: #111;
  font-weight: 700;
  background: #eef2ff;
}

.hm_wx_widget__tab:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
}

.hm_wx_widget__tab_sep {
  font-size: 0.65rem;
  color: #d1d5db;
  user-select: none;
  padding: 0 1px;
  line-height: 1;
}

.hm_wx_widget__loc {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm_wx_widget__body {
  display: flex;
  gap: 10px;
  padding: 10px 12px 14px;
  align-items: flex-start;
}

.hm_wx_widget__now {
  flex: 1 1 48%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  text-align: center;
}

.hm_wx_widget__wx_row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 74px;
}

/* 래퍼가 가로로 불필요하게 넓어지지 않도록 레이아웃 박스 제거 → 자식 img만 flex 항목 */
.hm_wx_widget__icon_cell {
  display: contents;
}

.hm_wx_widget__icon {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  margin-left: 5px;
  align-self: flex-start;
}

.hm_wx_widget__wx_main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 0;
  padding-top: 13px;
  box-sizing: border-box;
  position: relative;
  min-height: 74px;
}

.hm_wx_widget__temp {
  font-size: 2.05rem;
  font-weight: 800;
  color: #111;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hm_wx_widget__temp sup {
  font-size: 0.55em;
  font-weight: 700;
  vertical-align: super;
}

.hm_wx_widget__cond {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  width: 100%;
  max-width: 100%;
  text-align: left;
  line-height: 1.35;
  position: absolute;
  left: 0;
  top: 47px;
  min-height: 0;
  word-break: keep-all;
}

.hm_wx_widget__minmax {
  margin: 0;
  font-size: 0.8125rem;
  color: #6b7280;
  width: 100%;
  text-align: center;
  line-height: 1.4;
}

.hm_wx_widget__mm_lbl {
  font-weight: 500;
  color: #6b7280;
  margin-right: 1px;
}

.hm_wx_widget__tmax {
  color: #2563eb;
  font-weight: 600;
}

.hm_wx_widget__feels {
  color: #dc2626;
  font-weight: 600;
}

.hm_wx_widget__sep {
  color: #9ca3af;
  font-weight: 400;
  margin: 0 2px;
}

/* PC 날씨페이지 왼쪽 카드와 동일 마크업(hm_info_city_aqi_*), 위젯용 축소·전용 색상 */
.hm_wx_widget .hm_wx_widget__aqi_bar.hm_info_city_aqi_bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  margin: 0;
  padding: 0.38rem 0.65rem 0.48rem;
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.hm_wx_widget .hm_wx_widget__aqi_bar .hm_info_city_aqi_num {
  display: flex;
  align-items: baseline;
  gap: 0.18em;
}

.hm_wx_widget .hm_wx_widget__aqi_bar .hm_info_city_aqi_val {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.hm_wx_widget .hm_wx_widget__aqi_bar .hm_info_city_aqi_unit {
  font-size: 0.58rem;
  font-weight: 600;
  opacity: 0.82;
}

.hm_wx_widget .hm_wx_widget__aqi_bar .hm_info_city_aqi_label {
  font-size: 0.65rem;
  font-weight: 600;
}

.hm_wx_widget .hm_wx_widget__aqi_bar .hm_info_city_aqi_label::before {
  content: "미세먼지 ";
}

html[data-hm-lang="en"] .hm_wx_widget .hm_wx_widget__aqi_bar .hm_info_city_aqi_label::before {
  content: "PM2.5 ";
}

.hm_wx_widget .hm_info_city_aqi_bar--good {
  background: #c8f5c8;
  color: #145214;
}

.hm_wx_widget .hm_info_city_aqi_bar--moderate {
  background: #cce8ff;
  color: #0a3d6b;
}

.hm_wx_widget .hm_info_city_aqi_bar--sensitive {
  background: #fff0a0;
  color: #6b4400;
}

.hm_wx_widget .hm_info_city_aqi_bar--unhealthy {
  background: #ffd8a8;
  color: #7a2800;
}

.hm_wx_widget .hm_info_city_aqi_bar--very-unhealthy {
  background: #ffb3b3;
  color: #8b0000;
}

.hm_wx_widget .hm_info_city_aqi_bar--hazardous {
  background: #7b1fa2;
  color: #fff;
}

.hm_wx_widget .hm_info_city_aqi_bar--unknown {
  background: #ebebeb;
  color: #888;
}

.hm_wx_widget__idx_section {
  flex: 1 1 52%;
  min-width: 0;
  padding-left: 6px;
  border-left: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  align-self: flex-start;
}

.hm_wx_widget .hm_wx_widget__idx_grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 8px 4px;
  padding: 2px 0 4px;
  margin: 0;
  flex-wrap: unset !important;
}

.hm_wx_widget .hm_wx_widget__idx_grid .hm_wx_idx_item {
  flex: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 2px 1px;
  text-align: center;
  border: none;
  min-width: 0;
}

.hm_wx_widget .hm_wx_idx_ring {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hm_wx_widget .hm_wx_idx_ring svg {
  position: absolute;
  top: 0;
  left: 0;
}

.hm_wx_widget .hm_wx_idx_face {
  font-size: 15px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.hm_wx_widget .idx--good     { color: #22c55e; }
.hm_wx_widget .idx--good     .hm_wx_idx_face::before { content: '😊'; }

.hm_wx_widget .idx--moderate { color: #f59e0b; }
.hm_wx_widget .idx--moderate .hm_wx_idx_face::before { content: '😐'; }

.hm_wx_widget .idx--high     { color: #f97316; }
.hm_wx_widget .idx--high     .hm_wx_idx_face::before { content: '😟'; }

.hm_wx_widget .idx--vhigh    { color: #ef4444; }
.hm_wx_widget .idx--vhigh    .hm_wx_idx_face::before { content: '😰'; }

.hm_wx_widget .idx--danger   { color: #7c3aed; }
.hm_wx_widget .idx--danger   .hm_wx_idx_face::before { content: '🚨'; }

.hm_wx_widget .idx--na       { color: #cbd5e1; }
.hm_wx_widget .idx--na       .hm_wx_idx_face::before { content: '😶'; }

.hm_wx_widget .hm_wx_idx_status {
  font-size: 10px;
  font-weight: 700;
  color: currentColor;
  line-height: 1.2;
}

.hm_wx_widget .hm_wx_idx_label {
  font-size: 9px;
  color: #475569;
  line-height: 1.25;
  font-weight: 500;
}

.hm_wx_widget--empty .hm_wx_widget__body {
  padding: 16px 14px;
}

.hm_wx_widget__nodata {
  margin: 0;
  font-size: 0.8125rem;
  color: #6b7280;
  text-align: center;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget {
  background: #111827;
  border-color: #293241;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__head {
  border-bottom-color: #293241;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__title,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__temp {
  color: #e5e7eb;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__link_more {
  background: #0f172a;
  border-color: #293241;
  color: #cbd5e1;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__link_more:hover {
  background: #1f2937;
  border-color: #3b4454;
  color: #fff;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__tab {
  color: #94a3b8;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__tab:hover {
  color: #e5e7eb;
  background: #1f2937;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__tab.is-on {
  color: #e5e7eb;
  background: rgba(124, 140, 255, 0.18);
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__tab_sep {
  color: #566176;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__cond {
  color: #cbd5e1;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__minmax,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__mm_lbl,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__sep,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__nodata {
  color: #94a3b8;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__tmax {
  color: #93c5fd;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__feels {
  color: #f87171;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget__idx_section {
  border-left-color: #293241;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget .hm_wx_idx_label {
  color: #94a3b8;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_wx_widget .hm_info_city_aqi_bar--unknown {
  background: #1f2937;
  color: #94a3b8;
}

@media (prefers-color-scheme: dark) {
  body:not(.hm-mobile) .hm_wx_widget {
    background: #111827;
    border-color: #293241;
  }

  body:not(.hm-mobile) .hm_wx_widget__head {
    border-bottom-color: #293241;
  }

  body:not(.hm-mobile) .hm_wx_widget__title,
  body:not(.hm-mobile) .hm_wx_widget__temp {
    color: #e5e7eb;
  }

  body:not(.hm-mobile) .hm_wx_widget__link_more {
    background: #0f172a;
    border-color: #293241;
    color: #cbd5e1;
  }

  body:not(.hm-mobile) .hm_wx_widget__link_more:hover {
    background: #1f2937;
    border-color: #3b4454;
    color: #fff;
  }

  body:not(.hm-mobile) .hm_wx_widget__tab {
    color: #94a3b8;
  }

  body:not(.hm-mobile) .hm_wx_widget__tab:hover {
    color: #e5e7eb;
    background: #1f2937;
  }

  body:not(.hm-mobile) .hm_wx_widget__tab.is-on {
    color: #e5e7eb;
    background: rgba(124, 140, 255, 0.18);
  }

  body:not(.hm-mobile) .hm_wx_widget__tab_sep {
    color: #566176;
  }

  body:not(.hm-mobile) .hm_wx_widget__cond {
    color: #cbd5e1;
  }

  body:not(.hm-mobile) .hm_wx_widget__minmax,
  body:not(.hm-mobile) .hm_wx_widget__mm_lbl,
  body:not(.hm-mobile) .hm_wx_widget__sep,
  body:not(.hm-mobile) .hm_wx_widget__nodata {
    color: #94a3b8;
  }

  body:not(.hm-mobile) .hm_wx_widget__tmax {
    color: #93c5fd;
  }

  body:not(.hm-mobile) .hm_wx_widget__feels {
    color: #f87171;
  }

  body:not(.hm-mobile) .hm_wx_widget__idx_section {
    border-left-color: #293241;
  }

  body:not(.hm-mobile) .hm_wx_widget .hm_wx_idx_label {
    color: #94a3b8;
  }

  body:not(.hm-mobile) .hm_wx_widget .hm_info_city_aqi_bar--unknown {
    background: #1f2937;
    color: #94a3b8;
  }
}
