/* #region zone:disaster.style.panel — แผงข้อมูลเดียว: หัวบอกฝนที่บ้าน การ์ดตอนนี้ และหัวข้อ 6 แถว */
/* The one panel (bottom sheet below 1024px, left column above). Its head is the home headline (also the
   phone peek); the body starts with the now card, then the six topic rows. Spacing: 8 / 12 / 16 / 20 / 24. */
#app .hazard-sheet {
  background: var(--glass-strong);
  border: 0;
  box-shadow: var(--glass-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: var(--u-radius-dialog) var(--u-radius-dialog) 0 0;
}
#app[data-sheet-layout='side'] .hazard-sheet {
  border-radius: var(--r-panel);
}
#app .hazard-sheet .grip {
  width: 40px;
  height: 5px;
  border-radius: var(--u-radius-pill);
  background: var(--text);
  opacity: 0.18;
}
#app .focus-head {
  gap: var(--u-space-1) var(--u-space-3);
  padding: 0 20px 14px;
  border-bottom: 0;
}
#app[data-sheet-layout='side'] .focus-head {
  padding-top: 20px;
}
#app .focus-title {
  font-size: var(--u-text-xl);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
#app .focus-meta {
  color: var(--muted);
  font-size: var(--u-text-sm);
}
#app[data-browse] .focus-exit {
  display: none;
}
#app .focus-exit {
  border: 0;
  border-radius: var(--u-radius-pill);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
}
#app .sheet-body {
  gap: 20px;
  padding: var(--u-space-1) var(--u-space-4) 20px;
}
#app .sheet-quick {
  gap: var(--u-space-2);
}
/* #endregion */

/* #region zone:disaster.style.panel.now — การ์ด "ตอนนี้ที่บ้าน": อุณหภูมิใหญ่ สถานะ 3 ช่อง ปุ่มเดียว */
#app .now-card {
  display: grid;
  gap: var(--u-space-4);
  padding: 20px;
  border-radius: var(--u-radius-card);
  background: var(--card);
  color: var(--text);
  animation: now-in 260ms var(--ease-out) both;
}
#app .now-card[hidden] {
  display: none;
}
#app .now-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--u-space-4);
}
#app .now-temp {
  margin: 0;
  font-size: var(--weather-text-temperature);
  font-weight: 250;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
#app .now-say {
  display: grid;
  gap: 2px;
  min-width: 0;
}
#app .now-condition {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
#app .now-place,
#app .now-body {
  margin: 0;
  color: var(--muted);
  font-size: var(--u-text-sm);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#app .now-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--u-space-2);
  margin: 0;
}
#app .now-stat {
  display: grid;
  align-content: start;
  gap: var(--u-space-1);
  min-width: 0;
  padding: var(--u-space-3);
  border-radius: 16px;
  background: var(--glass-strong);
}
#app .now-stat dt {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--u-text-xs);
  font-weight: 500;
}
#app .now-stat[data-tone] dt::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mono-dot-warn);
}
#app .now-stat[data-tone='alert'] dt::before {
  background: var(--mono-dot-alert);
}
#app .now-stat dd {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
#app .now-stat dd small {
  color: var(--muted);
  font-size: var(--u-text-xs);
  font-weight: 500;
}
#app .now-stat:last-child dd {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#app .now-coverage {
  margin: 0;
  color: var(--muted);
  font-size: var(--u-text-xs);
  line-height: 1.5;
}
#app .now-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--u-space-2);
  justify-self: start;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--u-radius-pill);
  background: var(--glass-strong);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  transition:
    transform var(--t-fast) var(--ease-out),
    opacity var(--t-fast) var(--ease-out);
}
#app .now-action.primary {
  background: var(--text);
  color: var(--glass-strong);
}
#app .now-action:hover {
  opacity: 0.82;
}
#app .now-skeleton {
  height: 56px;
  border-radius: 16px;
  background: var(--glass-strong);
  animation: now-pulse 1.1s ease-in-out infinite alternate;
}
#app .now-skeleton.short {
  height: 44px;
  width: 60%;
}
@keyframes now-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes now-pulse {
  to {
    opacity: 0.45;
  }
}
@media (max-width: 359px) {
  #app .now-stats {
    grid-template-columns: 1fr 1fr;
  }
  #app .now-stat:last-child {
    grid-column: 1 / -1;
  }
}
/* #endregion */

/* #region zone:disaster.style.panel.topics — หัวข้อ 6 แถว: ไอคอน ชื่อ สถานะ สวิตช์ (สูงเท่ากันทุกแถว) */
#app .rail .rail-body {
  padding: 0;
}
/* Warnings came from GDACS, which the page no longer shows; the tab strip stays in the DOM for switchTab(). */
#app .rail .rail-tabs {
  display: none;
}
#app
  .rail
  .flood-evidence-tools:not(:has(#flood-report-button:not([hidden]), #flood-report-form:not([hidden]))) {
  display: none;
}
#app .topic-list {
  display: grid;
  margin: 0;
}
#app .topic-list-title {
  margin: 0 0 var(--u-space-1);
  padding: 0 var(--u-space-1);
  color: var(--muted);
  font-size: var(--u-text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
#app .topic-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 56px;
  align-items: center;
  gap: var(--u-space-3);
  min-height: 68px;
  padding: var(--u-space-3) var(--u-space-1);
  cursor: pointer;
}
#app .topic-row + .topic-row {
  border-top: 1px solid var(--card-line);
}
#app .topic-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  transition:
    background-color var(--t-med) var(--ease-out),
    color var(--t-med) var(--ease-out);
}
#app .topic-row[data-on='true'] .topic-icon {
  background: var(--text);
  color: var(--glass-strong);
}
#app .topic-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
#app .topic-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
#app .topic-status {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--u-text-sm);
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#app .topic-row[data-tone='stale'] .topic-status {
  color: var(--mono-amber-ink);
}
#app .topic-row[data-tone='error'] .topic-status {
  color: var(--mono-red-ink);
}
#app .topic-row[data-tone='loading'] .topic-status {
  animation: now-pulse 0.9s ease-in-out infinite alternate;
}
#app .topic-row[data-tone='off'] {
  cursor: default;
}
#app .topic-row[data-tone='off'] :is(.topic-icon, .topic-name) {
  opacity: 0.45;
}
#app :is(.topic-key, .topic-trials) {
  border-radius: 16px;
  background: var(--card);
}
#app :is(.topic-key, .topic-trials) > summary {
  padding: 10px var(--u-space-4);
  font-size: 14px;
}
#app :is(.topic-key, .topic-trials) .legend-detail,
#app :is(.topic-key, .topic-trials) .gistda-extra {
  display: grid;
  gap: var(--u-space-2);
  padding: 0 var(--u-space-4) var(--u-space-4);
  color: var(--muted);
  font-size: var(--u-text-sm);
  line-height: 1.55;
}
#app .rail-pane:not([hidden]) {
  display: grid;
  gap: var(--u-space-3);
}
/* Member flood reports belong to the flood topic: shown inside its key, hidden while flooding is off. */
#app .rail > .flood-evidence-tools {
  display: none;
}
#app .topic-key .flood-evidence-tools {
  display: grid;
  gap: var(--u-space-2);
  padding: 0 var(--u-space-4) var(--u-space-4);
}
#app .gistda-period {
  gap: var(--u-space-2);
}
#app .topic-trials .layer-row {
  column-gap: var(--u-space-2);
}
#app .gistda-period button {
  min-height: 44px;
  padding: var(--u-space-2) 14px;
  border: 0;
  border-radius: var(--u-radius-pill);
  background: var(--glass-strong);
  color: var(--text);
  font-weight: 600;
}
#app .gistda-period button[aria-pressed='true'] {
  background: var(--text);
  color: var(--glass-strong);
}
/* #endregion */

/* #region zone:disaster.style.panel.weather-field — ตัวเลือกอุณหภูมิ/ลม ข้างแถบสี และแถบเวลาฝน */
#app .field-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
#app .sheet-body .legend-panel {
  display: grid;
  gap: var(--u-space-3);
  padding: var(--u-space-4);
  border-radius: 20px;
  background: var(--card);
}
#app .sheet-body .legend-panel[hidden] {
  display: none;
}
#app .instrument-strip {
  border: 0;
  border-radius: 20px;
  background: var(--card);
}
#app[data-sheet-layout='side'] > .instrument-strip {
  background: var(--glass-strong);
  box-shadow: var(--glass-shadow);
}
#app .instrument-play {
  border: 0;
  border-radius: 50%;
  background: var(--text);
  color: var(--glass-strong);
}
#app .dock-btn {
  border: 0;
  border-radius: 50%;
  background: var(--glass-strong);
  color: var(--text);
}
#app .sheet-body .forecast-card {
  border: 0;
  border-radius: var(--u-radius-card);
  background: var(--card);
}
#app .rail-sources {
  border-top: 1px solid var(--card-line);
}
@media (prefers-reduced-motion: reduce) {
  #app .now-card,
  #app .now-skeleton,
  #app .topic-row[data-tone='loading'] .topic-status {
    animation: none;
  }
  #app :is(.topic-icon, .now-action) {
    transition: none;
  }
}
/* #endregion */
