:root {
  --ws-primary: #2b5eaa;
  --ws-on-primary: #ffffff;
  --ws-primary-container: #c7dbff;
  --ws-on-primary-container: #0c2c68;
  --ws-secondary: #425a7a;
  --ws-surface: #eef2f9;
  --ws-surface-variant: #e5ecf7;
  --ws-on-surface: #0a1324;
  --ws-on-surface-variant: #233149;
  --ws-outline: #98b4d1;
  --ws-success: #1d8a4d;
  --ws-warning: #b96c00;
  --ws-canvas-top: #d7e1f1;
  --ws-temp-min-bg: #e7f0ff;
  --ws-temp-min-stroke: #9cb8f0;
  --ws-temp-min-text: #1a4fb8;
  --ws-temp-max-bg: #ffedee;
  --ws-temp-max-stroke: #f2afb3;
  --ws-temp-max-text: #c02f36;
  --ws-wind-badge-start: #6c87b1;
  --ws-wind-badge-end: #4e6993;
  --ws-wind-badge-stroke: #66ffffff;
  --ws-alert-green-bg: #e8f6ed;
  --ws-alert-green-stroke: #8fc9a6;
  --ws-alert-green-text: #1c6b41;
  --ws-alert-yellow-bg: #fff7dc;
  --ws-alert-yellow-stroke: #f0d27a;
  --ws-alert-yellow-text: #8a6400;
  --ws-alert-orange-bg: #ffebdd;
  --ws-alert-orange-stroke: #f3b07d;
  --ws-alert-orange-text: #a94e00;
  --ws-alert-red-bg: #fee7e7;
  --ws-alert-red-stroke: #efa8a8;
  --ws-alert-red-text: #ab2222;
  --ws-dialog-surface: #eaf2ff;
  --ws-shadow: 0 10px 22px rgba(19, 46, 82, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--ws-on-surface);
  background: linear-gradient(
    180deg,
    var(--ws-canvas-top) 0%,
    var(--ws-surface-variant) 50%,
    var(--ws-surface) 100%
  );
}

body.dark-theme {
  --ws-primary: #8eb7ff;
  --ws-primary-container: #243a63;
  --ws-on-primary-container: #d6e5ff;
  --ws-surface: #131d2d;
  --ws-surface-variant: #1b2940;
  --ws-on-surface: #e8eefc;
  --ws-on-surface-variant: #adc0de;
  --ws-outline: #3b5272;
  --ws-canvas-top: #0f1725;
  --ws-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  background: linear-gradient(180deg, #0f1725 0%, #152338 50%, #1b2940 100%);
}

body.widget-mode .top-app-bar,
body.widget-mode .app-drawer,
body.widget-mode .drawer-backdrop {
  display: none !important;
}

body.widget-mode .app-shell {
  width: min(900px, 100vw);
  gap: 6px;
}

body.widget-mode #favoriteToggle {
  display: none;
}

.app-shell {
  width: min(1120px, 96vw);
  margin: 0 auto;
  display: grid;
  gap: 8px;
}

.panel {
  border-radius: 14px;
  border: 1px solid var(--ws-outline);
  background: linear-gradient(
    180deg,
    var(--ws-surface) 0%,
    var(--ws-surface-variant) 50%,
    var(--ws-surface-variant) 100%
  );
  box-shadow: var(--ws-shadow);
}

.top-app-bar {
  padding: 0 20px;
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 15;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #254a7f;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

body.dark-theme .top-app-bar {
  background: #1a3359;
}

.top-app-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.top-app-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #f7fbff;
  font: inherit;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.icon-btn .material-symbols-outlined,
.top-icon-btn .material-symbols-outlined {
  font-size: 36px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'opsz' 24;
}

.app-title {
  font-size: 1.08rem;
  color: #f7fbff;
  letter-spacing: 0.01em;
  font-weight: 500;
}

.top-icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #f7fbff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.top-icon-btn.is-favorite {
  color: #f3c536;
}

.location-bar {
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-meta {
  min-width: 0;
  flex: 1;
}

.favorite-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--ws-outline);
  border-radius: 50%;
  background: var(--ws-surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}

.favorite-btn img {
  width: 20px;
  height: 20px;
}

h1 {
  margin: 0;
  line-height: 1.1;
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--ws-on-surface);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2,
h3 {
  margin: 0;
}

.muted {
  margin: 0;
  color: var(--ws-on-surface-variant);
  font-size: 0.85rem;
}

.location-cover {
  width: 96px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid var(--ws-outline);
  overflow: hidden;
  flex: 0 0 auto;
}

.location-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.action-btn {
  border: 1px solid var(--ws-outline);
  border-radius: 999px;
  background: var(--ws-surface-variant);
  color: var(--ws-on-surface);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 7px 11px;
  cursor: pointer;
}

.action-btn.active {
  background: var(--ws-primary-container);
  color: var(--ws-primary);
  border-color: var(--ws-primary);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(14, 32, 53, 0.4);
}

.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: min(326px, 88vw);
  background: linear-gradient(
    180deg,
    var(--ws-surface) 0%,
    var(--ws-surface-variant) 100%
  );
  border-right: 1px solid var(--ws-outline);
  box-shadow: 4px 0 20px rgba(13, 35, 59, 0.18);
  transform: translateX(-105%);
  transition: transform 180ms ease;
  z-index: 20;
  display: grid;
  align-content: start;
}

.app-drawer.open {
  transform: translateX(0);
}

.drawer-header-premium {
  padding: 8px 10px 10px;
  min-height: 220px;
  display: grid;
  align-content: end;
  gap: 6px;
  background:
    linear-gradient(180deg, rgba(28, 70, 126, 0.92) 0%, rgba(31, 84, 149, 0.88) 62%, rgba(38, 99, 168, 0.84) 100%),
    url('./assets/drawable/bg_nav_right_header.webp');
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid #7aa0cc;
}

.drawer-logo {
  width: 202px;
  max-height: 92px;
  max-width: 100%;
  height: auto;
  display: block;
  justify-self: center;
  object-fit: contain;
}

.drawer-support {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(16, 48, 90, 0.55);
  color: #ffffff;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 11px;
  cursor: pointer;
  margin-left: 8px;
}

.drawer-support .material-symbols-outlined {
  font-size: 14px;
  line-height: 1;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'opsz' 20;
}

.drawer-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--ws-outline);
  color: #182a46;
  background: #e3eaf5;
}

.drawer-nav {
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(227, 234, 245, 0.96) 0%, rgba(227, 234, 245, 0.96) 100%),
    url('./assets/drawable/bg_nav_right_body.webp');
  background-size: cover;
}

body.dark-theme .drawer-nav {
  background: #16253b;
}

.drawer-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #b9cae0;
  border-radius: 0;
  background: transparent;
  color: #1a2f52;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 500;
  text-align: left;
  padding: 12px 14px 12px 18px;
  cursor: pointer;
}

body.dark-theme .drawer-item {
  border-bottom-color: #314867;
  color: #c6d6ee;
}

.drawer-item-icon {
  font-size: 23px;
  width: 24px;
  height: 24px;
  line-height: 1;
  flex: 0 0 24px;
  color: #2f405d;
}

body.dark-theme .drawer-item-icon {
  color: #a8bddc;
}

.drawer-item.active {
  background: #d5e2f4;
  color: #1e4f95;
  font-weight: 800;
}

.drawer-item.active .drawer-item-icon {
  color: #1e4f95;
}

body.dark-theme .drawer-item.active {
  background: #203550;
  color: #9cc2ff;
}

body.dark-theme .drawer-item.active .drawer-item-icon {
  color: #9cc2ff;
}

.tabs-panel {
  padding: 4px 6px;
}

.page-panel {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.page-head {
  display: grid;
  gap: 3px;
}

.page-body {
  display: grid;
  gap: 8px;
}

.page-card {
  border: 1px solid var(--ws-outline);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, #eef3fb 0%, #e4edf9 100%);
}

.page-card h3,
.page-card p {
  margin: 0;
}

.page-card .muted {
  margin-top: 3px;
}

.page-list {
  display: grid;
  gap: 8px;
}

.page-link {
  text-decoration: none;
  color: inherit;
}

.page-link .page-card strong {
  color: #1f3763;
}

body.dark-theme .page-card {
  background: linear-gradient(180deg, #18283f 0%, #1d2f4a 100%);
}

body.dark-theme .page-link .page-card strong {
  color: #d5e5ff;
}

.iframe-wrap {
  width: 100%;
  min-height: 66vh;
  border: 1px solid #9ab3d2;
  border-radius: 12px;
  overflow: hidden;
  background: #dfe7f5;
}

.iframe-wrap iframe {
  width: 100%;
  min-height: 66vh;
  border: 0;
  background: #fff;
}

body.dark-theme .iframe-wrap {
  border-color: #4d6485;
  background: #111e31;
}

body.dark-theme .iframe-wrap iframe {
  background: #0f1725;
}

.inline-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-controls input,
.inline-controls select {
  border: 1px solid #9ab3d2;
  border-radius: 10px;
  background: #f3f7ff;
  color: #0d1f3f;
  padding: 7px 9px;
  font: inherit;
}

body.dark-theme .inline-controls input,
body.dark-theme .inline-controls select {
  border-color: #4f6687;
  background: #142238;
  color: #deebff;
}

.forecast-bottom-bar {
  position: sticky;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 12;
  box-shadow: 0 10px 22px rgba(23, 47, 84, 0.25);
}

.bottom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.bottom-controls label {
  font-weight: 700;
  color: #21385d;
  white-space: nowrap;
}

.bottom-step-input {
  width: 82px;
  min-width: 82px;
  text-align: center;
}

body.dark-theme .bottom-controls label {
  color: #dce8ff;
}

.station-toolbar {
  display: grid;
  gap: 8px;
}

.station-toolbar input,
.station-toolbar select {
  border: 1px solid #8ba9cd;
  border-radius: 12px;
  background: linear-gradient(180deg, #f4f8ff 0%, #eaf2fe 100%);
  color: #183257;
  padding: 9px 11px;
  font: inherit;
  font-weight: 600;
}

body.dark-theme .station-toolbar input,
body.dark-theme .station-toolbar select {
  border-color: #4f6687;
  background: linear-gradient(180deg, #142238 0%, #1a2a43 100%);
  color: #deebff;
}

.station-toolbar .inline-controls {
  justify-content: space-between;
}

.station-summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.83rem;
}

.station-live-card {
  border: 1px solid var(--ws-outline);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, var(--ws-surface) 0%, var(--ws-surface-variant) 100%);
  display: grid;
  gap: 8px;
}

.station-live-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.station-live-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.station-live-temp {
  margin: 0;
  text-align: right;
  font-size: 1.28rem;
  font-weight: 800;
  color: #2a67c6;
  white-space: nowrap;
}

.station-live-perceived {
  margin: 2px 0 0;
  text-align: right;
  font-size: 0.82rem;
  color: var(--ws-on-surface-variant);
}

.station-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.station-badge {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.74rem;
  font-weight: 700;
}

.station-badge.live {
  background: #1d8a4d;
  color: #fff;
}

.station-badge.recent {
  background: #2b5eaa;
  color: #fff;
}

.station-badge.stale {
  background: #b96c00;
  color: #fff;
}

.station-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.station-chart-card {
  margin-top: 10px;
  border: 1px solid var(--ws-outline);
  border-radius: 10px;
  padding: 8px;
  background: linear-gradient(180deg, #f0f5ff 0%, #e3edf9 100%);
}

body.dark-theme .station-chart-card {
  background: linear-gradient(180deg, #18283f 0%, #1c2d47 100%);
}

.station-chart-card h3 {
  margin: 0 0 6px;
  font-size: 0.88rem;
}

.station-chart-wrap {
  height: 130px;
  border: 1px solid #99b4d4;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

body.dark-theme .station-chart-wrap {
  border-color: #4f6687;
  background: #122036;
}

.station-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.station-metric {
  border: 1px solid var(--ws-outline);
  border-radius: 10px;
  padding: 6px;
  text-align: center;
}

.station-metric p {
  margin: 0;
  font-size: 0.73rem;
  color: var(--ws-on-surface-variant);
}

.station-metric strong {
  display: block;
  margin-top: 2px;
  font-size: 0.86rem;
}

.station-archive-empty {
  display: grid;
  gap: 8px;
}

.station-archive-head {
  display: grid;
  gap: 10px;
}

.station-archive-head-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.station-archive-station {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ws-on-surface);
}

.station-archive-range-scroll {
  overflow-x: auto;
  padding-bottom: 2px;
}

.station-archive-range-group {
  display: inline-flex;
  gap: 8px;
  min-width: max-content;
}

.station-archive-custom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.station-archive-custom input {
  border: 1px solid #8ba9cd;
  border-radius: 12px;
  background: linear-gradient(180deg, #f4f8ff 0%, #eaf2fe 100%);
  color: #183257;
  padding: 9px 11px;
  font: inherit;
  font-weight: 600;
}

.station-archive-progress {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: #d5e0f2;
}

.station-archive-progress-bar {
  width: 36%;
  height: 100%;
  border-radius: 999px;
  background: #2a67c6;
  animation: stationArchiveLoad 0.9s ease-in-out infinite alternate;
}

@keyframes stationArchiveLoad {
  0% { transform: translateX(-10%); }
  100% { transform: translateX(150%); }
}

.station-archive-content {
  display: grid;
  gap: 10px;
}

.station-archive-metric-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.station-archive-metric-tabs .action-btn {
  white-space: nowrap;
}

.station-archive-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.station-archive-stats span {
  border: 1px solid var(--ws-outline);
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f5ff 0%, #e3edf9 100%);
  padding: 7px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ws-on-surface);
}

.station-archive-chart-wrap {
  height: 360px;
  border: 1px solid #99b4d4;
  border-radius: 10px;
  background: #ffffff;
  padding: 6px;
}

.station-archive-chart-wrap canvas,
.atmo-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.station-archive-error {
  display: grid;
  gap: 8px;
}

body.dark-theme .station-archive-custom input {
  border-color: #4f6687;
  background: linear-gradient(180deg, #142238 0%, #1a2a43 100%);
  color: #deebff;
}

body.dark-theme .station-archive-progress {
  background: #20344f;
}

body.dark-theme .station-archive-stats span {
  background: linear-gradient(180deg, #18283f 0%, #1c2d47 100%);
}

body.dark-theme .station-archive-chart-wrap {
  border-color: #4f6687;
  background: #122036;
}

.atmo-hero {
  display: grid;
  gap: 8px;
}

.atmo-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.atmo-station-name {
  margin: 3px 0 0;
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--ws-on-surface);
}

.atmo-kpi-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.atmo-risk {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
}

.atmo-risk.risk-1 { color: #1d8a4d; }
.atmo-risk.risk-2 { color: #2a67c6; }
.atmo-risk.risk-3 { color: #b96c00; }
.atmo-risk.risk-4 { color: #c02f36; }
.atmo-risk.risk-5 { color: #9c1b2f; }

.atmo-chart-wrap {
  margin-top: 6px;
  height: 260px;
  border: 1px solid #99b4d4;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.atmo-level-head,
.atmo-level-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 8px;
}

.atmo-level-head {
  margin-top: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ws-on-surface-variant);
}

.atmo-level-list {
  margin-top: 4px;
  display: grid;
  gap: 4px;
}

.atmo-level-row {
  padding: 5px 0;
  border-bottom: 1px solid rgba(122, 151, 185, 0.35);
  font-size: 0.83rem;
  color: var(--ws-on-surface);
}

.atmo-level-row span:last-child {
  text-align: right;
}

.atmo-history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.atmo-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ws-on-surface-variant);
  font-size: 0.82rem;
}

.atmo-history-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.atmo-history-row {
  width: 100%;
  border: 1px solid var(--ws-outline);
  border-radius: 10px;
  background: linear-gradient(180deg, #eef3fb 0%, #e4edf9 100%);
  color: var(--ws-on-surface);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: 8px;
  padding: 9px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.atmo-history-row.active {
  border-color: var(--ws-primary);
  box-shadow: 0 0 0 1px rgba(42, 103, 198, 0.22) inset;
}

.atmo-history-row span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  font-size: 0.8rem;
}

.atmo-history-row strong {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atmo-history-row small {
  color: var(--ws-on-surface-variant);
}

body.dark-theme .atmo-chart-wrap {
  border-color: #4f6687;
  background: #122036;
}

body.dark-theme .atmo-history-row {
  background: linear-gradient(180deg, #18283f 0%, #1c2d47 100%);
}

body.dark-theme .atmo-history-row.active {
  box-shadow: 0 0 0 1px rgba(142, 183, 255, 0.34) inset;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.tab-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ws-surface-variant);
  color: var(--ws-on-surface-variant);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  padding: 6px 11px;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--ws-primary-container);
  color: var(--ws-primary);
  border-color: var(--ws-outline);
}

.state-msg {
  min-height: 20px;
  color: var(--ws-on-surface-variant);
  font-size: 0.9rem;
  padding-left: 4px;
}

.state-msg:empty {
  display: none;
  min-height: 0;
  padding-left: 0;
}

.hidden {
  display: none !important;
}

.forecast-day {
  display: grid;
  gap: 8px;
}

.alerts-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(136px, 27%);
  gap: 6px;
}

.alerts-row.no-river {
  grid-template-columns: 1fr;
}

.alerts-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alert-card {
  border-radius: 14px;
  border: 1px solid;
  padding: 8px;
  cursor: pointer;
}

.alert-card p,
.alert-card small {
  margin: 0;
}

.river-card {
  background: var(--ws-surface-variant);
  padding: 6px;
  display: grid;
  gap: 4px;
}

.river-value {
  margin: 0;
  text-align: center;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ws-primary);
}

.day-summary,
.sea-wind-panel,
.hourly-panel {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.small-label {
  margin: 0;
  color: var(--ws-on-surface-variant);
  font-size: 0.76rem;
}

.sun-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sun-row p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.86rem;
  color: var(--ws-on-surface-variant);
}

.sun-row strong {
  color: var(--ws-on-surface);
}

.mini-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: 0 0 auto;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.hero-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.hero-text {
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
  color: var(--ws-on-surface-variant);
}

.hero-temp {
  margin: 4px 0 0;
  color: var(--ws-primary);
  font-size: 1.13rem;
  font-weight: 800;
}

.hero-minmax {
  display: grid;
  grid-template-columns: repeat(2, minmax(68px, 1fr));
  gap: 4px;
  width: 144px;
}

.temp-chip {
  border-radius: 10px;
  border: 1px solid;
  padding: 4px;
  text-align: center;
}

.temp-chip.min {
  background: var(--ws-temp-min-bg);
  border-color: var(--ws-temp-min-stroke);
}

.temp-chip.max {
  background: var(--ws-temp-max-bg);
  border-color: var(--ws-temp-max-stroke);
}

.temp-chip p,
.temp-chip strong,
.temp-chip small {
  margin: 0;
  display: block;
}

.temp-chip p {
  font-size: 0.7rem;
  font-weight: 700;
}

.temp-chip.min p,
.temp-chip.min strong {
  color: var(--ws-temp-min-text);
}

.temp-chip.max p,
.temp-chip.max strong {
  color: var(--ws-temp-max-text);
}

.temp-chip small {
  color: var(--ws-on-surface-variant);
  font-size: 0.7rem;
}

.metric-grid {
  display: grid;
  gap: 8px;
}

.metric-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  border: 1px solid var(--ws-outline);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    var(--ws-surface) 0%,
    var(--ws-surface-variant) 50%,
    var(--ws-surface-variant) 100%
  );
  padding: 8px;
}

.metric-card.center {
  text-align: center;
}

.metric-line {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-value {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--ws-on-surface);
}

.small-weather-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.gust-icon {
  width: 30px;
  height: 30px;
  margin: 2px auto 0;
}

body:not(.dark-theme) .gust-icon {
  filter: drop-shadow(0 0 1px rgba(20, 37, 62, 0.65));
}

.progress-wrap {
  margin-top: 6px;
  height: 4px;
  border-radius: 999px;
  background: var(--ws-surface-variant);
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--ws-primary);
  transition: width 220ms ease;
}

.sea-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.sea-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.sea-main p {
  margin: 0;
}

.sea-head > p {
  margin: 0;
  font-size: 0.86rem;
  white-space: nowrap;
}

.sea-head strong {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--ws-on-primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  background: linear-gradient(315deg, var(--ws-wind-badge-start), var(--ws-wind-badge-end));
  border: 1px solid var(--ws-wind-badge-stroke);
}

.hourly-list {
  display: grid;
  gap: 6px;
}

.hour-row {
  border: 2px solid var(--ws-outline);
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    #e8effb 0%,
    #d9e4f8 52%,
    #d2def4 100%
  );
  padding: 8px;
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.hour-row-top,
.hour-row-main,
.hour-row-bottom {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.hour-row-main {
  flex-wrap: nowrap;
}

.hour-row-bottom {
  justify-content: flex-start;
}

.hour-chip {
  border-radius: 999px;
  border: 1px solid var(--ws-outline);
  background: var(--ws-primary-container);
  color: var(--ws-primary);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 9px;
}

.hour-notice {
  flex: 1;
  min-width: 120px;
  color: var(--ws-warning);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hour-alert-right {
  margin-left: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.hour-alert-label {
  color: var(--ws-warning);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hour-alert-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.hour-alert-icons img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.hour-main-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.hour-main-text {
  min-width: 0;
}

.hour-main-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ws-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hour-main-text .muted {
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hour-main-right {
  text-align: right;
  flex: 0 0 auto;
  min-width: fit-content;
}

.hour-main-right .hour-temp {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
}

.hour-main-right .muted {
  margin-top: 1px;
  white-space: nowrap;
}

.hour-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: 0 0 auto;
}

.hour-metrics-bar {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(125, 154, 188, 0.52);
  background: linear-gradient(180deg, #cfdbed 0%, #c4d3e8 100%);
  padding: 3px 5px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.hour-metric-pill {
  min-width: 0;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #1d3048;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.hour-metric-pill strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.hour-metric-pill img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: 0 0 auto;
}

.hour-metric-pill.rain {
  justify-content: flex-start;
}

.hour-metric-pill.wind {
  justify-content: center;
  border: 1px solid rgba(112, 139, 173, 0.6);
  background: rgba(226, 236, 249, 0.96);
}

body:not(.dark-theme) .hour-metric-pill.wind img {
  filter: brightness(0) saturate(100%) invert(18%) sepia(22%) saturate(830%) hue-rotate(176deg) brightness(91%) contrast(91%);
}

.hour-metric-pill.wind .mini-icon {
  width: 16px;
  height: 16px;
}

.hour-wind-arrow {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #223a5c;
  transform-origin: 50% 50%;
}

.hour-metric-pill.gust {
  justify-content: flex-end;
}

.zoom-viewer {
  width: 100%;
  min-height: 260px;
  border-radius: 12px;
  border: 1px solid #9ab3d2;
  background: #f7faff;
  overflow: hidden;
  position: relative;
  touch-action: none;
  cursor: grab;
}

.zoom-viewer.is-zoomed {
  cursor: move;
}

.zoom-image {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: center center;
  transition: transform 0.08s linear;
  user-select: none;
  -webkit-user-drag: none;
}

.zoom-reset {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid #8ca9cd;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a355c;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  display: none;
}

.zoom-viewer.is-zoomed .zoom-reset {
  display: inline-flex;
}

.zoom-hint {
  font-size: 0.78rem;
  color: var(--ws-on-surface-variant);
}

body.dark-theme .zoom-viewer {
  border-color: #4f6687;
  background: #13243a;
}

body.dark-theme .zoom-reset {
  border-color: #5f78a0;
  background: rgba(20, 34, 56, 0.92);
  color: #e4eeff;
}

body.dark-theme .hour-row {
  border-color: #4f6687;
  background: linear-gradient(
    180deg,
    #1b2d47 0%,
    #1a2a43 52%,
    #16243a 100%
  );
}

body.dark-theme .hour-main-text strong {
  color: #e7efff;
}

body.dark-theme .hour-main-text .muted,
body.dark-theme .hour-main-right .muted {
  color: #c5d7f3;
}

body.dark-theme .hour-main-right .hour-temp {
  color: #52d38b;
}

body.dark-theme .hour-metrics-bar {
  border-color: rgba(124, 151, 189, 0.55);
  background: linear-gradient(180deg, #203553 0%, #1a2b45 100%);
}

body.dark-theme .hour-metric-pill {
  color: #e6efff;
}

body.dark-theme .hour-metric-pill.wind {
  border-color: rgba(130, 162, 200, 0.45);
  background: rgba(231, 239, 255, 0.16);
}

body.dark-theme .hour-wind-arrow {
  color: #e7efff;
}

.dialog {
  border: 1px solid var(--ws-outline);
  border-radius: 14px;
  padding: 0;
  width: min(700px, 95vw);
  background: var(--ws-dialog-surface);
  color: var(--ws-on-surface);
}

.dialog::backdrop {
  background: rgba(17, 35, 53, 0.44);
}

.dialog-body {
  margin: 0;
  padding: 14px;
  display: grid;
  gap: 8px;
  color: inherit;
}

.dialog-body h3 {
  margin: 0;
  color: var(--ws-on-surface);
}

.dialog-body .muted {
  color: var(--ws-on-surface-variant);
}

#locationSearch {
  border: 1px solid var(--ws-outline);
  border-radius: 14px;
  background: var(--ws-surface);
  padding: 10px;
  font: inherit;
}

body.dark-theme #locationSearch {
  background: #142238;
  color: #deebff;
}

.location-list {
  max-height: 380px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.location-item {
  font: inherit;
  border: 1px solid var(--ws-outline);
  border-radius: 14px;
  background: var(--ws-surface-variant);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.location-item strong,
.location-item small {
  display: block;
}

.location-item strong {
  font-size: 0.98rem;
  color: var(--ws-on-surface);
}

.location-item small {
  color: var(--ws-on-surface-variant);
  font-size: 0.78rem;
  margin-top: 2px;
}

.hour-detail-summary {
  border: 1px solid var(--ws-outline);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    var(--ws-surface) 0%,
    var(--ws-surface-variant) 50%,
    var(--ws-surface-variant) 100%
  );
  padding: 10px;
}

.hour-detail-summary p {
  margin: 0;
  color: var(--ws-on-surface-variant);
}

.hour-detail-summary .metric-value {
  margin-top: 4px;
  color: var(--ws-on-surface);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-cell {
  border: 1px solid var(--ws-outline);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    var(--ws-surface) 0%,
    var(--ws-surface-variant) 50%,
    var(--ws-surface-variant) 100%
  );
  padding: 8px;
}

.detail-cell p {
  margin: 0;
}

.detail-cell p:first-child {
  color: var(--ws-on-surface-variant);
}

.detail-cell p:last-child {
  color: var(--ws-on-surface);
  font-weight: 800;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
}

.install-app-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(8, 18, 31, 0.56);
  display: grid;
  place-items: center;
  padding: 16px;
}

.install-app-modal {
  width: min(430px, 100%);
  border-radius: 14px;
  border: 1px solid var(--ws-outline);
  background: linear-gradient(180deg, #eef3fb 0%, #e4edf9 100%);
  box-shadow: var(--ws-shadow);
  padding: 14px;
  display: grid;
  gap: 9px;
}

.install-app-title {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 800;
  color: var(--ws-on-surface);
}

.install-app-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ws-on-surface-variant);
  font-size: 0.82rem;
}

body.dark-theme .install-app-modal {
  background: linear-gradient(180deg, #18283f 0%, #1d2f4a 100%);
}

body.dark-theme .dialog {
  background: #18283f;
  color: #e8eefc;
}

body.dark-theme .hour-detail-summary,
body.dark-theme .detail-cell {
  border-color: #4f6687;
  background: linear-gradient(180deg, #1b2d47 0%, #16243a 100%);
}

body.dark-theme .dialog-body .muted,
body.dark-theme .hour-detail-summary p,
body.dark-theme .detail-cell p:first-child {
  color: #bfd2f0;
}

body.dark-theme .hour-detail-summary .metric-value,
body.dark-theme .detail-cell p:last-child,
body.dark-theme .dialog-body h3 {
  color: #e8f0ff;
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.settings-card {
  padding: 12px;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.settings-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--ws-on-surface);
}

.settings-switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid #8aa6c9;
  background: #dce6f6;
  transition: 0.2s ease;
}

.settings-switch span::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: 0.2s ease;
}

.settings-switch input:checked + span {
  background: #2a67c6;
  border-color: #2a67c6;
}

.settings-switch input:checked + span::before {
  transform: translateX(24px);
}

body.dark-theme .settings-switch span {
  border-color: #58739a;
  background: #1a2a43;
}

body.dark-theme .settings-switch span::before {
  background: #d8e6ff;
}

@media (max-width: 860px) {
  .top-app-bar {
    padding: 0 12px;
    min-height: 66px;
  }

  .top-app-actions {
    justify-content: flex-end;
  }

  .app-title {
    font-size: 0.95rem;
  }

  .icon-btn,
  .top-icon-btn {
    width: 40px;
    height: 40px;
  }

  .icon-btn .material-symbols-outlined,
  .top-icon-btn .material-symbols-outlined {
    font-size: 30px;
  }

  .location-cover {
    width: 84px;
    height: 58px;
  }

  .hero-minmax {
    width: 144px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hour-metrics-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 999px;
  }

  .hour-metric-pill {
    font-size: 0.78rem;
    padding: 0 6px;
  }

  .station-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .atmo-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .atmo-history-row {
    grid-template-columns: 1fr;
  }

  .station-archive-custom {
    grid-template-columns: 1fr;
  }

  .station-archive-chart-wrap {
    height: 300px;
  }
}

@media (max-width: 420px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .hour-main-text strong {
    font-size: 0.9rem;
  }

  .atmo-kpi-grid {
    grid-template-columns: 1fr;
  }

  .atmo-level-head,
  .atmo-level-row {
    grid-template-columns: 1.3fr 0.9fr 0.9fr 1fr;
    gap: 6px;
    font-size: 0.75rem;
  }
}
