html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body {
  background: transparent;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.widget-container {
  width: 100%;
  margin: 0 auto;
  background: #181818;
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
  padding: 0 0.75em 0.75em 0.75em;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  overflow: hidden;
}

@supports (width: 1cqi) {
  .widget-container {
    container-type: inline-size;
    font-size: clamp(12px, 4cqi, 24px);
  }
}

.widget-top-section {
  width: calc(100% + 1.5em);
  margin-left: -0.75em;
  margin-right: -0.75em;
  overflow: hidden;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

.widget-logo-row {
  width: 100%;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  background-color: #181818;
  background-image: url('banner.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% 100%;
  aspect-ratio: 800 / 149;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.125em;
  overflow: hidden;
}

.widget-current-bg {
  position: relative;
  background-image: url('trees.png'), linear-gradient(to top, #6ec6f5 70%, #b3e0ff 100%);
  border-radius: 0 0 1em 1em;
  overflow: hidden;
  height: 8.1em;
  background-size: 100% auto, cover;
  background-position: center bottom, center;
  background-repeat: no-repeat, no-repeat;
}

.widget-current {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 5.25em 1fr;
  column-gap: 0.75em;
  align-items: start;
  padding: 1.15em 1em 0.75em 0.95em;
  box-sizing: border-box;
}

.widget-current-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5em;
  height: 5em;
  margin-top: -0.55em;
}

.widget-current-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.3em 0.45em rgba(0, 0, 0, 0.55)) drop-shadow(0 0 0.4em rgba(0, 0, 0, 0.28));
}

.widget-current-main {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  margin-top: 0.45em;
  min-width: 0;
  padding-right: 14.5em;
}

.widget-current-summary {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  width: 100%;
}

.widget-current-temp {
  font-size: 1.8em;
  font-weight: bold;
  color: #ffe066;
  text-shadow: 0 2px 8px #000, 0 1px 0 #333;
  white-space: nowrap;
  line-height: 1;
}

.widget-current-desc {
  font-size: 1.1em;
  color: #fff;
  text-shadow: 0 2px 8px #000, 0 1px 0 #333;
  line-height: 1.2;
}

.widget-hi-lo-vertical {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1em;
}

.widget-hi,
.widget-lo {
  font-size: 0.95em;
  color: #fff;
  text-shadow: 0 2px 8px #000, 0 1px 0 #333;
  line-height: 1.1;
  white-space: nowrap;
}

.widget-forecast-button {
  position: absolute;
  right: 0.6em;
  bottom: 0.6em;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-width: 13.4em;
  min-height: 2.1em;
  max-width: calc(100% - 1.2em);
  padding: 0.34em 0.9em;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(241, 246, 255, 0.76) 100%);
  border: 1px solid rgba(27, 57, 106, 0.14);
  box-shadow: 0 0.25em 0.75em rgba(6, 20, 43, 0.14);
  color: #16325c;
  font-size: 0.66em;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.widget-forecast-button::before {
  content: "NEW";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.7em;
  padding: 0 0.52em;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 131, 89, 0.92) 0%, rgba(232, 95, 57, 0.88) 100%);
  color: #fff;
  font-size: 0.82em;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  transform: translateY(0.04em);
  box-shadow: inset 0 -0.08em 0 rgba(0, 0, 0, 0.12);
}

.widget-forecast-button:hover,
.widget-forecast-button:focus-visible {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(233, 241, 255, 0.86) 100%);
  border-color: rgba(27, 57, 106, 0.22);
  box-shadow: 0 0.32em 0.95em rgba(6, 20, 43, 0.2);
  transform: translateY(-0.05em) scale(1.02);
}

.widget-forecast-button:focus-visible {
  outline: 2px solid rgba(52, 111, 214, 0.55);
  outline-offset: 2px;
}

.widget-hourly {
  display: flex;
  gap: 0.25em;
  margin: 0;
  background: #181818;
  border-radius: 8px;
  padding: 0.125em 0.5em;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.widget-hourly::-webkit-scrollbar {
  display: none;
}

.widget-hour {
  background: #232323;
  border-radius: 8px;
  padding: 0.375em 0.25em;
  width: 3.6em;
  text-align: center;
  font-size: 0.85em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.widget-hour-icon {
  width: 2.5em;
  height: 2.5em;
  margin-bottom: 0.125em;
  object-fit: contain;
}

.widget-hour-temp {
  color: #fff;
  font-weight: bold;
  font-size: 1.1em;
  text-shadow: 0 2px 8px #000, 0 1px 0 #333;
}

.widget-hour-time {
  color: #fff;
  font-size: 0.95em;
  margin-bottom: 0.125em;
  text-shadow: 0 2px 8px #000, 0 1px 0 #333;
  white-space: nowrap;
  line-height: 1.05;
}

.events-toggle-header {
  font-size: 0.9em;
  font-weight: bold;
  color: #fff;
  margin-top: 0.25em;
  margin-bottom: 0.25em;
  padding: 0.375em 0.5em;
  background: #232323;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-arrow {
  transition: transform 0.25s ease;
}

.events-toggle-header.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

.events-content {
  overflow-x: hidden;
  overflow-y: auto;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
  max-height: 12.5em;
  opacity: 1;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 0.1em;
}

.events-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
}

.events-content::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.widget-event-title {
  font-size: 1em;
  font-weight: bold;
  color: #fff;
  margin: 0.25em 0 0.5em;
}

.widget-event-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.widget-event-container .event {
  background: linear-gradient(180deg, #1d1f24 0%, #191b20 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.4em;
  margin: 0.65em 0.3em 0;
  width: calc(100% - 0.6em);
  box-sizing: border-box;
  text-align: center;
  color: #fff;
  box-shadow: 0 0.35em 0.9em rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.widget-event-container .event h4 {
  margin: 0 0 0.2em;
  font-size: 1.02em;
  line-height: 1.2;
}

.widget-event-container .subheadline {
  margin: 0 0 0.25em;
  color: #d8d8d8;
  font-size: 0.84em;
}

.widget-event-container .event-time {
  font-size: 0.92em;
  font-weight: 700;
  color: #ffcc00;
  margin: 0 0 0.3em;
}

.widget-event-container .forecast-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0.3em;
  align-items: center;
  justify-items: center;
  margin-top: 0;
}

.widget-event-container .forecast-info img {
  width: 4em;
  height: 4em;
  grid-column: 1;
  grid-row: 1;
}

.widget-event-container .temp {
  color: #fff;
  font-weight: bold;
  font-size: 1.6em;
  grid-column: 2;
  grid-row: 1;
  margin: 0;
}

.widget-event-container .description {
  font-size: 0.78em;
  color: #ccc;
  grid-column: 1;
  grid-row: 2;
  margin: 0;
}

.widget-event-container .precip {
  font-size: 0.78em;
  color: #ccc;
  grid-column: 2;
  grid-row: 2;
  margin: 0;
}

.widget-event-container .event-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 4.8em;
}

.widget-empty-event-text {
  margin: 0;
  font-size: 0.9em;
  font-weight: 400;
  color: #d8d8d8;
  line-height: 1.3;
}

@media (max-width: 520px) {
  .widget-container {
    border-radius: 14px;
    padding: 0 0.55em 0.55em;
  }

  .widget-top-section {
    width: calc(100% + 1.1em);
    margin-left: -0.55em;
    margin-right: -0.55em;
  }
}
