/* PM2.5 / AQI widget — The World Ready */

/* —— Share bar (page-level, same pattern as travel/situation pages) â€”â€” */
.weather-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--twro-line, rgba(255, 255, 255, 0.14));
  border-radius: 12px;
  background: var(--twro-ink2, rgba(255, 255, 255, 0.04));
}

.weather-share-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--twro-mute, #8aa0bc);
  margin-right: 4px;
}

.weather-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--twro-line, rgba(255, 255, 255, 0.14));
  background: var(--twro-ink3, rgba(255, 255, 255, 0.06));
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.weather-share-btn:hover {
  border-color: var(--twro-gold, #e8c05a);
  background: var(--twro-quote-bg, rgba(232, 192, 90, 0.08));
}

.weather-share-btn.is-copied {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

.weather-share-btn svg,
.weather-share-btn .news-share-svg {
  width: 18px;
  height: 18px;
}

.weather-share-btn .news-share-icon--ok {
  display: none;
}

.weather-share-btn.is-copied .news-share-icon--default {
  display: none;
}

.weather-share-btn.is-copied .news-share-icon--ok {
  display: inline-flex;
}

html[data-twro-theme="light"] .weather-share,
html[data-twro-theme="read"] .weather-share {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-twro-theme="light"] .weather-share-btn,
html[data-twro-theme="read"] .weather-share-btn {
  background: #fff;
  border-color: #e2e8f0;
}

.pm25-loading,
.pm25-error {
  padding: 16px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--twro-mute, #8aa0bc);
}

.pm25-error a {
  color: var(--twro-gold-light, #ffe9a8);
}

.pm25-full {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* —— Tabs —— */
.pm25-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pm25-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--twro-line, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.04);
  color: var(--twro-cream, #f4efe6);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pm25-tab.is-active,
.pm25-tab:hover {
  border-color: rgba(232, 192, 90, 0.45);
  background: rgba(232, 192, 90, 0.12);
  color: var(--twro-gold-light, #ffe9a8);
}

/* â€”â€” Cards â€”â€” */
.pm25-card {
  padding: 16px 18px;
  border-radius: var(--twro-radius, 16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--pm25-color, #22c55e) 12%, transparent), transparent 55%),
    linear-gradient(160deg, rgba(42, 74, 114, 0.55), rgba(30, 53, 88, 0.9));
  box-shadow: var(--twro-shadow, 0 6px 24px rgba(8, 24, 48, 0.22));
  border-left: 4px solid var(--pm25-color, #22c55e);
}

.pm25-card__head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--twro-cream);
  font-weight: 700;
}

.pm25-card__city {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--twro-mute);
  line-height: 1.35;
}

.pm25-card__aqi {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--pm25-color, #22c55e);
  font-family: var(--twro-mono, monospace);
}

.pm25-card__level {
  margin-top: 4px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--pm25-color);
}

.pm25-stale {
  margin-left: 8px;
  font-size: 0.72rem;
  color: var(--twro-mute);
  font-weight: 600;
}

.pm25-card__advice {
  margin: 10px 0 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--twro-mute);
}

.pm25-card__thai {
  margin: 8px 0 0;
  font-size: 0.78rem;
}

.pm25-thai-ok { color: #4ade80; }
.pm25-thai-warn { color: #fb923c; }

/* â€”â€” Hero (selected station) â€”â€” */
.pm25-card--hero {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 24px 32px;
  align-items: center;
  padding: 24px 28px;
  border-left-width: 5px;
  background:
    radial-gradient(circle at 18% 50%, color-mix(in srgb, var(--pm25-color, #22c55e) 22%, transparent), transparent 42%),
    linear-gradient(160deg, rgba(42, 74, 114, 0.65), rgba(22, 40, 68, 0.95));
}

.pm25-hero-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.pm25-hero-gauge__ring {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.08), transparent 60%),
    rgba(8, 18, 34, 0.45);
  border: 5px solid var(--pm25-color, #22c55e);
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--pm25-color, #22c55e) 18%, transparent),
    inset 0 0 24px rgba(0, 0, 0, 0.25);
}

.pm25-card--hero .pm25-card__aqi {
  font-size: 3.4rem;
  letter-spacing: -0.02em;
}

.pm25-hero-gauge__unit {
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--twro-mute);
  text-transform: uppercase;
}

.pm25-card--hero .pm25-card__level {
  font-size: 1.05rem;
}

.pm25-hero-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pm25-card--hero .pm25-card__head h3 {
  font-size: 1.25rem;
}

.pm25-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 14px 0 4px;
}

.pm25-stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pm25-stat__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--twro-mute);
}

.pm25-stat__value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--twro-cream);
  font-family: var(--twro-mono, monospace);
  line-height: 1.2;
}

.pm25-stat__value small {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--twro-mute);
}

.pm25-stat__value--sm {
  font-size: 0.92rem;
  font-family: inherit;
  font-weight: 700;
}

.pm25-card--hero .pm25-card__advice {
  margin-top: 10px;
  font-size: 0.92rem;
  max-width: 42rem;
}

/* â€”â€” History chart â€”â€” */
.pm25-chart {
  margin-top: 14px;
  padding: 12px 12px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pm25-chart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--twro-cream);
}

.pm25-chart__sub {
  font-weight: 600;
  color: var(--twro-mute);
  font-size: 0.72rem;
}

.pm25-chart__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.pm25-chart__grid {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.pm25-chart__xlabel,
.pm25-chart__ylabel {
  fill: var(--twro-mute, #8aa0bc);
  font-size: 9px;
  font-family: var(--twro-mono, monospace);
}

.pm25-chart__dot {
  stroke: rgba(8, 18, 34, 0.6);
  stroke-width: 1.5;
}

.pm25-chart__note {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--twro-mute);
}

.pm25-chart--compact {
  margin-top: 10px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.14);
}

.pm25-mini-card .pm25-chart--compact {
  margin: 0;
  width: 100%;
  max-width: none;
  padding: 6px 8px;
}

/* â€”â€” Nationwide by-region section â€”â€” */
.pm25-regions-head {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pm25-regions-head__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--twro-cream);
}

.pm25-regions-head__sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--twro-mute);
}

/* â€”â€” Thailand map (traced from real boundary coordinates) â€”â€” */
.pm25-map {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(160deg, rgba(28, 52, 88, 0.6), rgba(12, 26, 46, 0.9));
}

.pm25-thmap {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
}

.pm25-thmap__outline {
  fill: rgba(120, 170, 255, 0.14);
  stroke: rgba(180, 205, 255, 0.5);
  stroke-width: 2;
  stroke-linejoin: round;
}

.pm25-thmap__wire {
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  opacity: 0.75;
}

.pm25-thmap__dot {
  stroke: rgba(8, 18, 34, 0.7);
  stroke-width: 1.5;
}

.pm25-thmap__prov-dot {
  stroke: rgba(8, 18, 34, 0.65);
  stroke-width: 1;
}

.pm25-thmap__prov-label {
  font-size: 9.5px;
  font-weight: 700;
  fill: rgba(230, 238, 250, 0.95);
  font-family: var(--twro-font, inherit);
  paint-order: stroke;
  stroke: rgba(8, 18, 34, 0.85);
  stroke-width: 2.4px;
  stroke-linejoin: round;
}

.pm25-thmap__pin-box {
  fill: rgba(10, 22, 40, 0.88);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
}

.pm25-thmap__pin-bar {
  opacity: 0.95;
}

.pm25-thmap__pin-label {
  font-size: 11px;
  font-weight: 800;
  fill: var(--twro-cream, #f4efe6);
  font-family: var(--twro-font, inherit);
}

.pm25-thmap__pin-temp {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--twro-mono, monospace);
}

.pm25-thmap__pin-meta {
  font-size: 8.5px;
  font-weight: 600;
  fill: var(--twro-mute, #8aa0bc);
  font-family: var(--twro-font, inherit);
}

.pm25-thmap__cluster-name {
  font-size: 8px;
  font-weight: 600;
  fill: rgba(226, 232, 240, 0.92);
  font-family: var(--twro-font, inherit);
}

.pm25-thmap__cluster-temp {
  font-size: 8px;
  font-weight: 800;
  fill: rgba(195, 209, 230, 0.95);
  font-family: var(--twro-mono, monospace);
}

.pm25-map__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pm25-map__note {
  margin: 0;
  font-size: 0.74rem;
  color: var(--twro-mute);
}

.pm25-map__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pm25-share-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(232, 192, 90, 0.4);
  background: rgba(232, 192, 90, 0.12);
  color: var(--twro-gold-light, #ffe9a8);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pm25-share-btn:hover:not(:disabled) {
  background: rgba(232, 192, 90, 0.22);
  border-color: rgba(232, 192, 90, 0.6);
}

.pm25-share-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.pm25-share-btn--ghost {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--twro-cream, #f4efe6);
}

.pm25-share-btn--ghost:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.pm25-thmap-wrap {
  position: relative;
}

.pm25-thmap-wrap .pm25-thmap {
  cursor: zoom-in;
}

/* â€”â€” Lightbox (click-to-zoom viewer) â€”â€” */
.pm25-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6, 12, 22, 0.92);
  backdrop-filter: blur(2px);
}

.pm25-lightbox__toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.pm25-lightbox__btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f4efe6;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.pm25-lightbox__btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.pm25-lightbox__pct {
  font-size: 0.78rem;
  min-width: 56px;
}

.pm25-lightbox__close {
  border-color: rgba(239, 68, 68, 0.4);
}

.pm25-lightbox__stage {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}

.pm25-lightbox__stage:active {
  cursor: grabbing;
}

.pm25-lightbox__canvas {
  width: min(92vw, 900px);
  will-change: transform;
  transition: transform 0.05s linear;
}

.pm25-lightbox__canvas svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: default;
}

.pm25-lightbox__hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.74rem;
  color: rgba(244, 239, 230, 0.65);
  text-align: center;
  padding: 0 16px;
}

@media (max-width: 640px) {
  .pm25-lightbox__hint {
    display: none;
  }
}

.pm25-regions {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.pm25-region {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pm25-region__title {
  margin: 0;
  padding-left: 12px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--twro-gold-light, #ffe9a8);
  border-left: 3px solid rgba(232, 192, 90, 0.55);
}

.pm25-region__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* à¸à¸²à¸£à¹Œà¸”à¸ˆà¸±à¸‡à¸«à¸§à¸±à¸”à¸ªà¹„à¸•à¸¥à¹Œ gradient glass (à¸˜à¸µà¸¡à¸ªà¸µà¸•à¸²à¸¡à¸ªà¸–à¸²à¸™à¸° AQI) â€” à¸„à¸‡à¸—à¸µà¹ˆà¸—à¸±à¹‰à¸‡ dark/light theme */
.pm25-province {
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(168deg,
      color-mix(in srgb, var(--pm25-color, #22c55e) 52%, rgba(56, 84, 138, 0.55)),
      color-mix(in srgb, var(--pm25-color, #22c55e) 12%, rgba(30, 48, 86, 0.62)) 78%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(8, 24, 48, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pm25-province:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(8, 24, 48, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.pm25-province__split {
  display: flex;
  align-items: stretch;
  min-height: 96px;
}

.pm25-province__dark {
  flex: 1.15 1 0;
  min-width: 0;
  color: #fff;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.pm25-province__temp-big {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  font-family: var(--twro-mono, monospace);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.pm25-province__city {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm25-province__light {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pm25-province__ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.1);
}

.pm25-province__ring-value {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  font-family: var(--twro-mono, monospace);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.pm25-province__ring-unit {
  margin-top: 1px;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
}

.pm25-province__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.pm25-province__foot-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.pm25-province__level {
  padding: 6px 12px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.pm25-province__stale {
  margin-left: 6px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: none;
  color: rgba(255, 255, 255, 0.55);
}

.pm25-ico {
  font-size: 0.9em;
}

/* —— Mini (homepage) —— */
.pm25-mini-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--pm25-color, #22c55e) 16%, transparent), transparent 65%),
    rgba(13, 26, 46, 0.55);
  border-left: 4px solid var(--pm25-color, #22c55e);
  box-shadow: var(--twro-shadow, 0 6px 20px rgba(8, 24, 48, 0.2));
}

.pm25-mini-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pm25-mini-ring {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--pm25-color, #22c55e);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.1), transparent 60%),
    rgba(8, 18, 34, 0.45);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pm25-color, #22c55e) 16%, transparent);
}

.pm25-mini-ring__value {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--pm25-color, #22c55e);
  font-family: var(--twro-mono, monospace);
}

.pm25-mini-ring__unit {
  margin-top: 2px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--twro-mute, #8aa0bc);
}

.pm25-mini-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pm25-mini-level {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--twro-cream, #f4efe6);
}

.pm25-mini-stats {
  font-size: 0.78rem;
  color: var(--twro-mute, #8aa0bc);
}

.portal-fresh-widget--pm25 {
  margin-bottom: 0;
}

.pm25-source {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--twro-mute);
  line-height: 1.5;
}

.pm25-source a {
  color: var(--twro-gold-light);
}

/* —— Legend —— */
.weather-page .pm25-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.weather-page .pm25-legend div {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

/* â€”â€” Responsive â€”â€” */
@media (max-width: 720px) {
  .pm25-card--hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 20px 18px;
    gap: 18px;
  }

  .pm25-hero-body {
    width: 100%;
  }

  .pm25-card--hero .pm25-card__head {
    text-align: center;
  }

  .pm25-hero-stats {
    grid-template-columns: 1fr;
  }

  .pm25-card--hero .pm25-card__advice,
  .pm25-card--hero .pm25-card__thai {
    text-align: left;
  }

  .pm25-hero-gauge__ring {
    width: 128px;
    height: 128px;
  }

  .pm25-card--hero .pm25-card__aqi {
    font-size: 2.8rem;
  }

  .pm25-region__grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
}

/* —— Light theme —— */
html[data-twro-theme="light"] .pm25-card,
html[data-twro-theme="read"] .pm25-card,
html[data-twro-theme="light"] .pm25-mini-card,
html[data-twro-theme="read"] .pm25-mini-card {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--pm25-color, #22c55e) 10%, #fff), #fff 55%);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-twro-theme="light"] .pm25-card--hero,
html[data-twro-theme="read"] .pm25-card--hero {
  background:
    radial-gradient(circle at 18% 50%, color-mix(in srgb, var(--pm25-color, #22c55e) 16%, transparent), transparent 42%),
    #fff;
}

html[data-twro-theme="light"] .pm25-hero-gauge__ring,
html[data-twro-theme="read"] .pm25-hero-gauge__ring,
html[data-twro-theme="light"] .pm25-mini-ring,
html[data-twro-theme="read"] .pm25-mini-ring {
  background: #f8fafc;
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--pm25-color, #22c55e) 14%, transparent),
    inset 0 0 12px rgba(15, 23, 42, 0.04);
}

html[data-twro-theme="light"] .pm25-mini-ring,
html[data-twro-theme="read"] .pm25-mini-ring {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pm25-color, #22c55e) 14%, transparent);
}

/* ค่าตัวเลขบนพื้นอ่อน — ผสมสีเข้ม (เหลือง #eab308 เดิม contrast ไม่พอ) */
html[data-twro-theme="light"] .pm25-mini-ring__value,
html[data-twro-theme="read"] .pm25-mini-ring__value,
html[data-twro-theme="light"] .pm25-hero-gauge__value,
html[data-twro-theme="read"] .pm25-hero-gauge__value {
  color: color-mix(in srgb, var(--pm25-color, #22c55e) 42%, #0f172a);
}

html[data-twro-theme="light"] .pm25-stat,
html[data-twro-theme="read"] .pm25-stat {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-twro-theme="light"] .pm25-chart,
html[data-twro-theme="read"] .pm25-chart {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-twro-theme="light"] .pm25-chart__head,
html[data-twro-theme="read"] .pm25-chart__head {
  color: #1e293b;
}

html[data-twro-theme="light"] .pm25-chart__grid,
html[data-twro-theme="read"] .pm25-chart__grid {
  stroke: rgba(15, 23, 42, 0.1);
}

html[data-twro-theme="light"] .pm25-chart__xlabel,
html[data-twro-theme="read"] .pm25-chart__xlabel,
html[data-twro-theme="light"] .pm25-chart__ylabel,
html[data-twro-theme="read"] .pm25-chart__ylabel {
  fill: #64748b;
}

html[data-twro-theme="light"] .pm25-card__head h3,
html[data-twro-theme="read"] .pm25-card__head h3,
html[data-twro-theme="light"] .pm25-mini-level,
html[data-twro-theme="read"] .pm25-mini-level,
html[data-twro-theme="light"] .pm25-stat__value,
html[data-twro-theme="read"] .pm25-stat__value {
  color: #1e293b;
}

html[data-twro-theme="light"] .pm25-tab,
html[data-twro-theme="read"] .pm25-tab {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
  color: #1e293b;
}

html[data-twro-theme="light"] .weather-page .pm25-legend div,
html[data-twro-theme="read"] .weather-page .pm25-legend div {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.08);
  color: #1e293b;
}

html[data-twro-theme="light"] .pm25-regions-head__title,
html[data-twro-theme="read"] .pm25-regions-head__title {
  color: #1e293b;
}

html[data-twro-theme="light"] .pm25-map,
html[data-twro-theme="read"] .pm25-map {
  background: linear-gradient(160deg, #f1f5f9, #fff);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-twro-theme="light"] .pm25-thmap__outline,
html[data-twro-theme="read"] .pm25-thmap__outline {
  fill: rgba(37, 99, 235, 0.08);
  stroke: rgba(37, 99, 235, 0.35);
}

html[data-twro-theme="light"] .pm25-thmap__pin-box,
html[data-twro-theme="read"] .pm25-thmap__pin-box {
  fill: #fff;
  stroke: rgba(15, 23, 42, 0.12);
}

html[data-twro-theme="light"] .pm25-thmap__pin-label,
html[data-twro-theme="read"] .pm25-thmap__pin-label {
  fill: #1e293b;
}

html[data-twro-theme="light"] .pm25-thmap__pin-meta,
html[data-twro-theme="read"] .pm25-thmap__pin-meta {
  fill: #475569;
}

html[data-twro-theme="light"] .pm25-thmap__cluster-name,
html[data-twro-theme="read"] .pm25-thmap__cluster-name {
  fill: #1e293b;
}

html[data-twro-theme="light"] .pm25-thmap__cluster-temp,
html[data-twro-theme="read"] .pm25-thmap__cluster-temp {
  fill: #334155;
}

html[data-twro-theme="light"] .pm25-thmap__prov-label,
html[data-twro-theme="read"] .pm25-thmap__prov-label {
  fill: rgba(30, 41, 59, 0.92);
  stroke: rgba(255, 255, 255, 0.9);
}

html[data-twro-theme="light"] .pm25-share-btn,
html[data-twro-theme="read"] .pm25-share-btn {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.15);
  color: #92650f;
}

html[data-twro-theme="light"] .pm25-region__title,
html[data-twro-theme="read"] .pm25-region__title {
  color: #92650f;
  border-left-color: rgba(146, 101, 15, 0.4);
}


/* —— Read theme: PM2.5 mini ให้เข้ากับ magazine sidebar —— */
html[data-twro-theme="read"] .pm25-mini-card {
  border-radius: 0;
  border: 1px solid #e5e5e5;
  border-left: 4px solid var(--pm25-color, #2e7d32);
  background: #fff;
  box-shadow: none;
}

html[data-twro-theme="read"] .pm25-mini-ring {
  background: #fafafa;
  border-color: var(--pm25-color, #2e7d32);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pm25-color, #2e7d32) 18%, transparent);
}

html[data-twro-theme="read"] .pm25-mini-level {
  color: var(--pm25-color, #2e7d32);
}

html[data-twro-theme="read"] .pm25-mini-stats,
html[data-twro-theme="read"] .pm25-mini-ring__unit {
  color: #666;
}

html[data-twro-theme="read"] .pm25-chart--compact {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 0;
}

html[data-twro-theme="read"] .pm25-chart--compact .pm25-chart__grid {
  stroke: rgba(15, 23, 42, 0.08);
}

html[data-twro-theme="read"] body.twro-portal--home .portal-fresh-widget--pm25 .pm25-mini-card {
  margin: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-top: 1px solid #e5e5e5;
}
