:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: #111315;
  color: #f4f5f5;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

.dashboard {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  height: 100vh;
  min-height: 100vh;
  padding: 22px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 104px;
  padding: 0 4px 14px;
  border-bottom: 1px solid #393d40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: block;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: #bbc6ce;
}

.connection-status {
  padding: 3px 7px;
  border: 1px solid #a48a74;
  border-radius: 4px;
  color: #e2bb9b;
  font-size: 12px;
  white-space: nowrap;
}

.connection-status[hidden] {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.datetime {
  display: flex;
  align-items: baseline;
  gap: 24px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.date {
  color: #c2c7ca;
  font-size: 21px;
}

.clock {
  font-size: 68px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.045em;
}

.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr);
  gap: 16px;
  min-height: 0;
}

.card {
  min-width: 0;
  border: 1px solid #353a3d;
  border-radius: 14px;
  background: #1c2023;
}

.card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  color: #dce0e2;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.card-caption {
  color: #aeb6ba;
  font-size: 15px;
}

.radar-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.radar-map {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 8px;
  background: #323b40;
}

.radar-tile-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.radar-base-layer {
  z-index: 1;
}

.radar-rain-layer {
  z-index: 2;
}

.radar-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  pointer-events: none;
}

.radar-base-layer .radar-tile {
  filter: grayscale(1) brightness(0.64);
}

.radar-center {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #253036;
  box-shadow: 0 0 0 3px #253036;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.radar-center span {
  position: absolute;
  top: 16px;
  left: 10px;
  width: 105px;
  padding: 3px 5px;
  border-radius: 3px;
  background: rgba(17, 19, 21, 0.88);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.radar-legend {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  padding: 4px;
  border-radius: 4px;
  background: rgba(245, 245, 245, 0.94);
}

.radar-legend img {
  display: block;
  width: 80px;
  height: 196px;
}

.radar-error {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: none;
  width: max-content;
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 6px;
  background: rgba(17, 19, 21, 0.92);
  color: #f1c3a5;
  font-size: 17px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.radar-error.is-visible {
  display: block;
}

.radar-attribution {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 5px 8px;
  background: rgba(17, 19, 21, 0.86);
  color: #f1f2f2;
  font-size: 11px;
  text-align: right;
}

.radar-attribution a {
  color: inherit;
  text-decoration: underline;
}

.radar-status {
  display: block;
  margin-top: 10px;
  color: #c2c9cd;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.radar-status.is-error {
  color: #e2ad89;
}

.weather-summary {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.summary-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 24px;
}

.summary-content {
  padding-top: 8px;
}

.temperature {
  font-size: 60px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.unit {
  margin-left: 8px;
  font-size: 32px;
  font-weight: 400;
}

.detail {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  color: #bdc5ca;
  font-size: 21px;
}

.detail strong,
.forecast-temperatures strong {
  color: #f4f5f5;
  font-weight: 600;
}

.current-condition {
  margin-top: 5px;
  font-size: 22px;
  font-weight: 600;
}

.today-condition {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}

.forecast-temperatures {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  color: #bdc5ca;
  font-size: 19px;
  white-space: nowrap;
}

.precipitation {
  font-size: 18px;
}

.weather-status {
  margin-top: 7px;
  color: #aeb6ba;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.weather-status.is-error {
  color: #e2ad89;
}

.information-card {
  min-height: 126px;
  padding: 15px 24px 13px;
}

.warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 76px;
  margin-top: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.warning-list[hidden] {
  display: none;
}

.warning-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 3px 10px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.warning-level-50 {
  border-color: #c589c9;
  background: #5b315f;
  color: #fff;
}

.warning-level-40 {
  border-color: #ec9294;
  background: #612f34;
  color: #fff;
}

.warning-level-30 {
  border-color: #e8b181;
  background: #553d2f;
  color: #fff;
}

.warning-level-20 {
  border-color: #ddd083;
  background: #494630;
  color: #fff;
}

.information-card .warning-message {
  margin-top: 7px;
  color: #c2c9cd;
  font-size: 16px;
}

.information-card .warning-message.is-error,
.warning-footer .is-error {
  color: #e2ad89;
}

.warning-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 16px;
  margin-top: 5px;
  color: #aeb6ba;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.warning-footer a {
  color: #c7d3d9;
  text-decoration: underline;
}

.weather-credit {
  display: block;
  margin-top: 3px;
  color: #9da8ae;
  font-size: 13px;
}

@media (max-width: 900px) {
  .dashboard-header {
    align-items: flex-start;
  }

  .datetime {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 5px;
  }

  .clock {
    font-size: 58px;
  }

  .date {
    font-size: 17px;
  }

  .dashboard-main {
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr);
  }
}

@media (max-height: 760px) and (min-width: 651px) {
  .dashboard {
    gap: 12px;
    padding: 16px;
  }

  .dashboard-header {
    min-height: 82px;
    padding-bottom: 10px;
  }

  .clock {
    font-size: 56px;
  }

  .dashboard-main,
  .weather-summary {
    gap: 12px;
  }

  .summary-card {
    padding: 12px 18px;
  }

  .summary-content {
    padding-top: 0;
  }

  .temperature {
    font-size: 52px;
  }

  .current-condition,
  .today-condition {
    font-size: 20px;
  }

  .forecast-temperatures,
  .detail {
    font-size: 16px;
  }

  .information-card {
    min-height: 110px;
    padding: 12px 20px;
  }

  .radar-card {
    padding: 16px;
  }

  .radar-map {
    margin-top: 10px;
  }

  .warning-list {
    max-height: 66px;
  }
}

@media (max-width: 650px) {
  .dashboard {
    grid-template-rows: auto auto auto;
    gap: 12px;
    height: auto;
    padding: 14px;
  }

  .dashboard-header {
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 15px;
  }

  h1 {
    font-size: 16px;
  }

  .datetime {
    width: 100%;
    align-items: flex-start;
    text-align: left;
  }

  .dashboard-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .radar-card {
    min-height: 310px;
  }

  .radar-map {
    min-height: 260px;
  }

  .weather-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 12px;
  }

  .summary-card {
    min-height: 190px;
    padding: 18px;
  }

  .summary-card .card-heading {
    flex-wrap: wrap;
  }

  .temperature {
    font-size: 44px;
  }

  .unit {
    font-size: 22px;
  }

  .detail {
    margin-top: 10px;
    font-size: 16px;
  }

  .current-condition {
    font-size: 19px;
  }

  .today-condition {
    font-size: 22px;
  }

  .forecast-temperatures {
    flex-wrap: wrap;
    font-size: 16px;
  }

  .precipitation {
    font-size: 15px;
  }
}

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

  .summary-card {
    min-height: 165px;
  }
}
