:root {
  --bg: #f2efe8;
  --paper: rgba(255, 251, 245, 0.82);
  --ink: #152033;
  --muted: #5f6777;
  --line: rgba(21, 32, 51, 0.12);
  --accent: #0f766e;
  --accent-strong: #134e4a;
  --highlight: #f59e0b;
  --shadow: 0 24px 70px rgba(21, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.2), transparent 30%),
    radial-gradient(circle at right, rgba(15, 118, 110, 0.22), transparent 35%),
    linear-gradient(180deg, #fffdf9 0%, var(--bg) 100%);
}

button,
input,
table {
  font: inherit;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  background: linear-gradient(135deg, rgba(255, 251, 245, 0.9), rgba(255, 255, 255, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px;
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  max-width: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.hero-copy {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: 1.15rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  margin-top: 24px;
}

.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 16px 30px rgba(15, 118, 110, 0.22);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.status-text {
  margin: 0;
  color: var(--muted);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.summary-strip article,
.city-card {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.summary-strip article {
  padding: 18px 20px;
}

.controls-panel {
  margin-bottom: 18px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding: 20px;
}

.city-form {
  display: grid;
  gap: 10px;
}

.city-form-label {
  font-weight: 700;
}

.city-form-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.city-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.city-input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  border-color: rgba(15, 118, 110, 0.45);
}

.form-message {
  margin: 0;
  color: var(--muted);
}

.form-hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.cards-grid {
  display: block;
}

.city-card {
  padding: 22px;
  animation: rise-in 420ms ease;
  width: 100%;
}

.tabs-shell {
  display: grid;
  gap: 16px;
}

.tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.city-tab {
  border: 1px solid rgba(21, 32, 51, 0.12);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 251, 245, 0.72);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.city-tab:hover {
  transform: translateY(-1px);
}

.city-tab[aria-selected="true"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  border-color: transparent;
}

.city-tab-content {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.remove-city {
  border: 0;
  background: rgba(21, 32, 51, 0.08);
  color: inherit;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
}

.city-tab[aria-selected="true"] .remove-city {
  background: rgba(255, 255, 255, 0.18);
}

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

.city-region,
.updated-time {
  margin: 0;
  color: var(--muted);
}

.city-region {
  font-size: 0.92rem;
}

.city-name {
  margin: 4px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
}

.city-badge {
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
  text-align: center;
  font-weight: 700;
}

.updated-time {
  margin-top: 14px;
  font-size: 0.92rem;
}

.date-switcher {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(21, 32, 51, 0.05);
}

.date-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.view-toggle {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px 0;
}

.date-chip {
  border: 1px solid rgba(21, 32, 51, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.date-chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  border-color: transparent;
}

.date-chip.is-today {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #92400e;
}

.date-chip.is-active.is-today {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  border-color: transparent;
}

.date-label {
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.current-hour-row td {
  background: rgba(15, 118, 110, 0.12);
  box-shadow: inset 0 1px 0 rgba(15, 118, 110, 0.08), inset 0 -1px 0 rgba(15, 118, 110, 0.08);
}

.condition-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.condition-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  font-size: 0.95rem;
  line-height: 1;
}

.error-card {
  padding: 24px;
  border-radius: 22px;
  background: rgba(127, 29, 29, 0.08);
  border: 1px solid rgba(127, 29, 29, 0.12);
  color: #7f1d1d;
}

.city-card .table-wrap {
  padding-bottom: 4px;
}

.city-card::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.city-card::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(21, 32, 51, 0.22);
  border-radius: 999px;
}

.city-card::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
  background: rgba(21, 32, 51, 0.06);
  border-radius: 999px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 20px;
  }

  .hero,
  .city-card {
    padding: 20px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .date-switcher {
    gap: 10px;
  }

  .date-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .city-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tabs-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .hero h1 {
    max-width: none;
  }

  table {
    min-width: 900px;
  }
}
