:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #6b7685;
  --line: #e6eaf0;
  --accent: #f5b301;     /* galben Google-weather */
  --accent-soft: #fdf3d3;
  --blue: #2b7de9;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(20,30,50,.06), 0 8px 24px rgba(20,30,50,.05);
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b; --card: #1a212b; --ink: #e8edf4; --muted: #97a3b2;
    --line: #2a333f; --accent-soft: #2c2a1a; --shadow: 0 1px 3px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }

/* --- titlu + cautare --- */
.topbar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.brand { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.brand small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 8px; }

.brand-link { color: inherit; text-decoration: none; }
.brand-link:hover { color: var(--blue); }

.search { display: flex; gap: 10px; margin-bottom: 16px; }
.ac-wrap { position: relative; flex: 1; min-width: 0; }
.search input[type=text] {
  width: 100%; min-width: 0; font-size: 16px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
}
.search input[type=text]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,125,233,.15); }

/* dropdown autocomplete */
.ac-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.ac-item { display: block; padding: 11px 16px; font-size: 15px; color: var(--ink); text-decoration: none; cursor: pointer; }
.ac-item + .ac-item { border-top: 1px solid var(--line); }
.ac-item:hover, .ac-item.active { background: rgba(43,125,233,.10); color: var(--blue); }

/* favorite (chips) */
.favs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.favs-title { font-size: 13px; color: var(--muted); }
.fav-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 13px; }
.fav-chip a { color: var(--ink); text-decoration: none; }
.fav-chip a:hover { color: var(--blue); }
.fav-del { border: 0; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 999px; }
.fav-del:hover { color: #b3261e; }

/* buton salveaza oras */
.star-btn { margin-top: 10px; font-size: 13px; font-weight: 600; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); cursor: pointer; }
.star-btn:hover { border-color: var(--accent); color: var(--ink); }
.star-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.search button {
  font-size: 15px; font-weight: 600; padding: 12px 22px; border: 0; border-radius: 12px;
  background: var(--blue); color: #fff; cursor: pointer;
}
.search button:hover { filter: brightness(1.05); }

.matches { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 22px; }
.matches a, .suggest a {
  font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); text-decoration: none;
}
.matches a:hover, .suggest a:hover, .matches a.active { border-color: var(--blue); color: var(--blue); }
.matches a.active { background: rgba(43,125,233,.08); }
.suggest { margin-top: 10px; color: var(--muted); font-size: 13px; }
.suggest .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.note { color: var(--muted); font-size: 13px; }
.error { background: #fdecec; color: #b3261e; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
@media (prefers-color-scheme: dark) { .error { background: #3a1f1d; color: #ffb4ab; } }

/* --- hero consens --- */
.hero {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 28px; display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; flex-wrap: wrap; margin-bottom: 18px;
}
.hero-main { display: flex; align-items: center; gap: 14px; }
.hero-main .wicon { width: 92px; height: 92px; }
.hero-temp { font-size: 64px; font-weight: 300; line-height: 1; letter-spacing: -.03em; }
.hero-temp sup { font-size: 24px; font-weight: 400; vertical-align: super; color: var(--muted); }
.hero-meta { font-size: 14px; color: var(--muted); margin-left: 6px; }
.hero-meta div { white-space: nowrap; }
.hero-side { text-align: right; margin-left: auto; }
.hero-side .place { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.hero-side .when { color: var(--muted); font-size: 15px; }
.hero-side .desc { color: var(--ink); font-size: 16px; margin-top: 2px; }
.hero-side .spread { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* --- comparatie "acum" --- */
.section-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 26px 0 12px; }
.now-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.src-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.src-card .src-head { display: flex; align-items: center; justify-content: space-between; }
.src-card .src-name { font-weight: 600; font-size: 14px; }
.src-card .src-model { font-size: 11px; color: var(--muted); }
.src-card .src-body { display: flex; align-items: center; gap: 10px; }
.src-card .wicon { width: 56px; height: 56px; }
.src-card .src-temp { font-size: 34px; font-weight: 400; letter-spacing: -.02em; }
.src-card .src-desc { font-size: 13px; color: var(--muted); }
.src-card .src-extra { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.src-card.failed { opacity: .65; }
.src-card.failed .src-body { color: var(--muted); font-size: 13px; }

/* --- prognoza 7 zile (matrice surse x zile) --- */
.forecast { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 4px; overflow-x: auto; }
.fc-table { border-collapse: collapse; width: 100%; min-width: 640px; }
.fc-table th, .fc-table td { padding: 10px 6px; text-align: center; }
.fc-table thead th { font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.fc-table thead th .dow { display: block; color: var(--ink); font-weight: 700; }
.fc-table thead th.hcol { font-weight: 600; min-width: 52px; }
.fc-table tbody th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink); padding-left: 14px; white-space: nowrap; }
.fc-table tbody tr + tr td, .fc-table tbody tr + tr th { border-top: 1px solid var(--line); }
.fc-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.fc-cell .wicon { width: 38px; height: 38px; }
.fc-cell .t { font-size: 13px; }
.fc-cell .t b { font-weight: 700; }
.fc-cell .t span { color: var(--muted); }
.fc-cell .pop { font-size: 11px; color: var(--blue); }
.fc-na { color: var(--muted); font-size: 12px; }

.footer { margin-top: 30px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.7; }
.footer a { color: var(--muted); }
