* {
  --border-radius: .5rem;
  --shadow: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
  --shadow-hover: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;
  --bg: #f5f5fa;
}

/* --- Card container --- */
.ew-current-weather {
  display: flex;
  flex-wrap: wrap;
  max-width: 900px;
  border-radius: var(--border-radius);
  overflow: hidden;
  color: #1f2937;
  box-shadow: var(--shadow);
  background: #fff;
  margin: 0 auto;
}

/* --- Left column: main + today summary --- */
.ew-main-today {
  display: flex;
  flex-direction: column;
  color: var(--contrast);
  padding: 32px 24px;
  min-width: 280px;
  flex-shrink: 0;
  transition: background 0.3s ease;
  border-radius: var(--border-radius);
  position: relative;
  text-align: center;
}

/* --- Header: city + time --- */
.ew-header {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
}

.ew-header {
    position: relative;
}

.ew-time {
  margin-left: .5rem;
}

/* --- Main icon and temperature --- */
.ew-icon img,
.ew-icon svg {
  width: 64px;
  height: 64px;
}

.ew-temperature {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 1rem;
}

/* --- Today summary --- */
.ew-today {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ew-today .ew-row {
  background: rgba(255,255,255,0.3);
  padding: 8px 12px;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.875rem;
  min-width: 70px;
  transition: all .25s;
}

.ew-today .ew-row:hover {
  background: rgba(255,255,255,0.5);
}

.ew-today .ew-row span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-3);
  text-transform: uppercase;
}

.ew-today .ew-row img,
.ew-today .ew-row svg {
  width: 36px;
  height: 36px;
}

.ew-today .ew-row strong {
  font-size: 1rem;
  font-weight: 600;
}

/* --- Right column: detailed cards --- */
.ew-details-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 16px;
  padding: 25px 24px 0 24px;
  flex: 1;
}

/* --- Detail card --- */
.ew-details-container .ew-row {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
  transition: all .25s;
}

.ew-details-container .ew-row span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-3);
  text-transform: uppercase;
}

.ew-details-container .ew-row img,
.ew-details-container .ew-row svg {
  width: 64px;
  height: 64px;
}

.ew-details-container .ew-row strong {
  font-size: 1.25rem;
  font-weight: 700;
}

/* --- Wind rotation inside detail --- */
.ew-wind {
  display: inline-block;
  transform: rotate(var(--wind-deg, 0deg));
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .ew-current-weather {
    flex-direction: column;
	flex-wrap: nowrap;
  }
}

/* Footer */
.ew-current-weather > footer {
  flex: 0 0 100%;
  margin-top: auto;
}

.ew-current-weather footer {
  text-align: center;
}

.ew-current-weather footer h2 {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-3);
  text-transform: uppercase;
  margin: .5rem 0;
}

/* Header */
.ew-hourly-table thead th {
	position: sticky;
	top: 0;
	z-index: 3;
	background: var(--bg);
	color: #444;
	font-weight: 600;
	font-size: 0.7rem;
	text-transform: uppercase;
	padding: 0.75rem 0.75rem;
	text-align: left;
}

/* Header icons */
.ew-hourly-table img {
	width: 36px;
	height: 36px;
	min-width: 24px;
	min-height: 24px;
	margin-right: 4px;
	vertical-align: middle;
}

/* Body rows */
.ew-hourly-table tbody tr {
	background: #ffffff;
}

/* Cells */
.ew-hourly-table tbody td {
	padding: 0.75rem;
	color: #333;
	white-space: nowrap;
}

/* First + last cell rounding */
.ew-hourly-table tbody tr td:first-child {
	font-weight: 600;
}

/* Temperature emphasis */
.ew-hourly-table tbody td:nth-child(3) {
	font-weight: 600;
}

/* Rain + wind muted */
.ew-hourly-table tbody td:nth-child(4),
.ew-hourly-table tbody td:nth-child(5) {
	color: #666;
	font-size: 0.8rem;
}

.ew-hourly-table tbody tr:hover {
	background: var(--bg);
	box-shadow: var(--shadow);
	transform: translateY(-1px);
	transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

@media (max-width: 500px) {
  .ew-hourly-table th span {
    display: none;
  }
}


/* --- AJAX loading placeholder --- */
.ew-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.ew-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: ew-spin 0.8s linear infinite;
}

@keyframes ew-spin {
  to { transform: rotate(360deg); }
}

/* --- Tab switcher --- */
.ew-widget {
  max-width: 310px;
  margin: 0 auto;
}

.ew-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: -1px; /* overlap the card border below */
  position: relative;
  z-index: 1;
}

.ew-tab {
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  background: rgb(var(--blue-rgb), .05);
  color: var(--black);
  transition: background 0.15s ease, color 0.15s ease;
}

.ew-tab:hover {
  background: transparent;
  color: var(--black);
}

.ew-tab.is-active {
  background: #fff;
  color: var(--black);
}

/* --- Tab panels --- */
.ew-tab-panel {
  display: none;
}

.ew-tab-panel.is-active {
  display: block;
}

/* Remove the auto margin from .ew-current-weather inside the widget
   since .ew-widget already handles centering */
.ew-widget .ew-current-weather {
  max-width: 100%;
  border-radius: 0 6px 6px 6px;
}

/* --- Inline date/icon/temperature strip --- */
.ew-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: inherit;
  line-height: 1;
  vertical-align: middle;
}

.ew-inline-icon {
  width: 1.4em;
  height: 1.4em;
  vertical-align: middle;
}

.ew-inline-temp {
  font-weight: 500;
}

.ew-current-weather a {
  text-decoration: none;
}

.ew-current-weather a:hover {
  color: inherit;
}

/* ── Hourly forecast strip ─────────────────────────────────────────── */

/* ── Hourly strip (bottom of widget) ──────────────────────────────── */

.ew-hourly-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 4px;
    width: 100%;        /* never exceed the widget */
    box-sizing: border-box;
}

.ew-hourly {
    display: flex;
    flex-direction: row;
    width: max-content;  /* allows inner content to be wider than wrap */
}

.ew-hourly__strip {
    display: none;
    flex-direction: row;
    min-width: max-content;
}

.ew-hourly__strip.is-active {
    display: flex;
}

.ew-hourly__col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 10px 10px;
    min-width: 52px;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.ew-hourly__col:last-child {
    border-right: none;
}

.ew-hourly__col--now {
    background: rgba(99, 130, 255, 0.07);
    border-top: 2px solid rgba(99, 130, 255, 0.55);
}

.ew-hourly__time {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
}

.ew-hourly__col--now .ew-hourly__time {
    color: #4361cc;
}

.ew-hourly__icon-img {
    width: 24px;
    height: 24px;
}

.ew-hourly__temp {
    font-size: 12px;
    font-weight: 700;
    color: #222;
}

.ew-hourly__precip {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: #666;
}

.ew-hourly__precip-icon {
    width: 11px;
    height: 11px;
    opacity: 0.55;
}

.ew-hourly__precip-none {
    color: #bbb;
}

.ew-hourly__empty {
    padding: 12px;
    font-size: 12px;
    color: #999;
}