/* pws-watch: dashboard native app WebView surface rules. */

.ios-tabbar {
  display: none;
}

body.surface-app {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(238, 243, 242, 0.96)),
    var(--surface);
  -webkit-font-smoothing: antialiased;
}

body.surface-app .shell {
  width: 100%;
  max-width: 820px;
  padding:
    max(10px, env(safe-area-inset-top))
    12px
    max(22px, env(safe-area-inset-bottom));
}

body.surface-app header {
  position: sticky;
  z-index: 40;
  top: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: -1px -12px 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(23, 32, 42, 0.08);
  background: rgba(245, 247, 248, 0.88);
  backdrop-filter: blur(18px);
}

body.surface-app .brand {
  gap: 8px;
  min-width: 0;
}

body.surface-app .brand-copy {
  min-width: 0;
}

body.surface-app .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 8px 16px rgba(23, 32, 42, 0.12);
}

body.surface-app h1 {
  font-size: 18px;
}

body.surface-app .subhead {
  max-width: none;
  margin-top: 2px;
  overflow: visible;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: clip;
  white-space: normal;
}

body.surface-app .toolbar {
  gap: 6px;
}

body.surface-app .icon-button,
body.surface-app .primary-button {
  min-height: 34px;
  border-radius: 999px;
}

body.surface-app .icon-button,
body.surface-app .primary-button.icon-only {
  width: 36px;
  min-width: 36px;
}

body.surface-app .settings {
  position: sticky;
  z-index: 35;
  top: 51px;
  grid-template-columns: minmax(0, 1fr) 118px;
  margin: 0 -2px 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.08);
  backdrop-filter: blur(16px);
}

body.surface-app .settings label,
body.surface-app .tracking-setting,
body.surface-app .email-setting {
  font-size: 10px;
  letter-spacing: 0.03em;
}

body.surface-app input,
body.surface-app select {
  min-height: 34px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

body.surface-app .ios-tabbar {
  position: sticky;
  z-index: 34;
  top: 119px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  margin: 0 0 10px;
  padding: 3px;
  border: 1px solid rgba(23, 32, 42, 0.08);
  border-radius: 12px;
  background: rgba(229, 235, 236, 0.76);
  backdrop-filter: blur(16px);
}

body.surface-app .ios-tabbar button {
  min-width: 0;
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

body.surface-app .ios-tabbar button.active {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(23, 32, 42, 0.12);
}

body.surface-app [data-ios-panel][hidden] {
  display: none !important;
}

body.surface-app .hero-grid,
body.surface-app .analysis-grid,
body.surface-app .spatial-grid,
body.surface-app .history-grid,
body.surface-app .lower-grid {
  display: block;
  margin-top: 0;
}

body.surface-app .analysis-head {
  display: none;
}

body.surface-app .panel {
  border-radius: 18px;
  box-shadow:
    0 14px 30px rgba(23, 32, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.surface-app .user-stations {
  align-content: start;
}

body.surface-app .station-tab-panel,
body.surface-app .user-stations-list,
body.surface-app .user-station-row {
  align-self: start;
}

body.surface-app .user-stations-list {
  align-content: start;
}

body.surface-app .user-station-row {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "station actions"
    "status actions";
  align-items: center;
  min-height: 56px;
}

body.surface-app .user-station-row > strong {
  grid-area: station;
}

body.surface-app .station-row-status {
  grid-area: status;
}

body.surface-app .station-row-actions {
  grid-area: actions;
  align-self: center;
  justify-content: flex-end;
}

body.surface-app #currentPanel {
  min-height: calc(100vh - 206px);
  grid-template-columns: minmax(112px, 1fr) auto;
  grid-template-areas:
    "station temp"
    "brief brief"
    "dial dial"
    "metrics metrics";
  align-content: start;
  gap: 12px;
  padding: 16px;
}

body.surface-app #currentPanel::before {
  width: 0;
}

body.surface-app .current-top {
  grid-area: station;
  min-width: 0;
}

body.surface-app .station-name {
  font-size: clamp(16px, 4.8vw, 22px);
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.surface-app .station-meta {
  font-size: 12px;
}

body.surface-app .freshness {
  min-height: 24px;
  padding: 0 9px;
  font-size: 10px;
}

body.surface-app .temp-stack {
  display: contents;
}

body.surface-app .temp-row {
  grid-area: temp;
  justify-self: end;
  gap: 8px;
}

body.surface-app .temp {
  font-size: clamp(54px, 17vw, 82px);
}

body.surface-app .weather-visual {
  width: clamp(50px, 14vw, 66px);
  border-radius: 18px;
}

body.surface-app .weather-brief {
  grid-area: brief;
  font-size: 12px;
  line-height: 1.34;
}

body.surface-app .dial-module {
  grid-area: dial;
  align-content: start;
}

body.surface-app .weather-renderer-tabs {
  justify-self: center;
  width: min(100%, 320px);
}

body.surface-app .weather-renderer-tabs button {
  flex: 1 1 0;
}

body.surface-app .atmo-dial {
  width: min(230px, 68vw);
  margin: 2px auto 0;
  justify-self: center;
}

body.surface-app .glance-panel {
  width: min(100%, 356px);
  justify-self: center;
}

body.surface-app .metrics {
  grid-area: metrics;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.surface-app .metric {
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(23, 32, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

body.surface-app .metric-value {
  font-size: 19px;
}

body.surface-app .chart-panel {
  min-height: calc(100vh - 206px);
  padding: 14px;
}

body.surface-app .chart-head {
  display: grid;
}

body.surface-app .segments {
  flex-wrap: nowrap;
  justify-content: start;
  overflow-x: auto;
  scrollbar-width: none;
}

body.surface-app .segments::-webkit-scrollbar {
  display: none;
}

body.surface-app .segments button {
  flex: 0 0 auto;
  min-width: 74px;
}

body.surface-app canvas {
  min-height: 320px;
}

body.surface-app .history-panel {
  min-height: calc(100vh - 206px);
  padding: 14px;
}

body.surface-app .history-head {
  display: grid;
  align-items: start;
}

body.surface-app .history-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  justify-content: stretch;
}

body.surface-app .history-date-control {
  grid-column: 1 / -1;
}

body.surface-app .history-kpis,
body.surface-app .history-strips {
  grid-template-columns: 1fr;
}

body.surface-app .history-strip {
  grid-template-columns: 1fr;
  min-height: 104px;
}

body.surface-app .history-strip-range {
  grid-column: 1;
}

body.surface-app .map-panel {
  min-height: calc(100vh - 206px);
}

body.surface-app .mini-panel {
  margin-bottom: 10px;
}

body.surface-app .page-footer {
  justify-content: center;
  margin-top: 10px;
  border: 0;
  color: var(--muted);
  font-size: 11px;
}

body.surface-app .page-footer span:first-child {
  display: none;
}
