/* =============================================
   SINOPTIK — Dark Futuristic Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ══════════════════════════════════
   ПЕРЕМЕННЫЕ
══════════════════════════════════ */
:root {
    --bg:             #090d18;
    --surface:        #0f1526;
    --card:           #141c2e;
    --accent:         #00d4ff;
    --accent-dim:     rgba(0, 212, 255, 0.10);
    --accent-border:  rgba(0, 212, 255, 0.22);
    --orange:         #ff6b35;
    --green:          #4ade80;
    --text:           #eef2ff;
    --text-2:         #8892a4;
    --text-3:         #4a5568;
    --border:         rgba(255, 255, 255, 0.07);
    --border-2:       rgba(255, 255, 255, 0.13);
    --nav-h:          52px;
    --r-sm:           12px;
    --r-md:           18px;
    --r-lg:           24px;
    --r-xl:           30px;
}

/* ══════════════════════════════════
   СБРОС И БАЗА
══════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(ellipse 700px 500px at 90% -5%,  rgba(0,212,255,0.06)  0%, transparent 70%),
        radial-gradient(ellipse 500px 400px at 5%  90%,  rgba(255,107,53,0.05) 0%, transparent 70%);
}

/* ══════════════════════════════════
   ОБЁРТКА
══════════════════════════════════ */
.sf-wrapper {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 36px 56px;
}

/* ══════════════════════════════════
   ШАПКА
══════════════════════════════════ */
.apple-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.search-container {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--nav-h);
    padding: 0 10px 0 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-container:focus-within {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 4px rgba(0,212,255,0.06);
}
.search-container input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Sora', sans-serif;
    font-size: 15px;
}
.search-container input::placeholder { color: var(--text-3); }

.search-icon-btn {
    flex-shrink: 0;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
}
.search-icon-btn:hover  { background: rgba(0,212,255,0.2); transform: scale(1.06); }
.search-icon-btn:active { transform: scale(0.94); }
.search-icon-btn svg    { display: block; }

.quick-settings { display: flex; gap: 10px; flex-shrink: 0; }
.sf-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 700;
    width: 58px;
    height: var(--nav-h);
    border-radius: var(--r-md);
    text-align: center;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: border-color 0.2s;
}
.sf-select:hover  { border-color: var(--border-2); }
.sf-select:focus  { outline: none; border-color: var(--accent-border); }
.sf-select option { background: #141c2e; color: var(--text); }

/* ══════════════════════════════════
   ТАБЫ
══════════════════════════════════ */
.ios-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 26px;
}
.tabs-bg {
    display: flex;
    padding: 4px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 280px;
}
.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-2);
    padding: 11px 20px;
    border-radius: calc(var(--r-xl) - 4px);
    cursor: pointer;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: color 0.25s, background 0.25s, box-shadow 0.25s;
    white-space: nowrap;
}
.tab-btn.active {
    background: var(--accent);
    color: #000;
    box-shadow: 0 4px 18px rgba(0,212,255,0.35);
}

/* ══════════════════════════════════
   СЕТКИ КОНТЕНТА
══════════════════════════════════ */
.content-grid { display: none; }
.content-grid.active { display: grid; }

#today-view {
    grid-template-columns: 380px 1fr;
    align-items: start;
    gap: 22px;
}

#forecast-view {
    grid-template-columns: 1fr;
    gap: 20px;
}
.full-width { grid-column: 1 / -1; }

/* ══════════════════════════════════
   БАЗОВЫЕ КАРТОЧКИ
══════════════════════════════════ */
.hero-card,
.widget {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
}

/* ══════════════════════════════════
   ГЕРОЙ-КАРТОЧКА
══════════════════════════════════ */
.hero-card {
    padding: 40px 32px 36px;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    align-self: stretch;
    justify-content: center;
}
.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 75% 0%, rgba(0,212,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.hero-header { position: relative; }
.hero-header h1 {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
}
.sf-date {
    font-size: 11px;
    color: var(--text-2);
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-top: 6px;
}

/* hero-visual — обёртка иконки + температуры */
.hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    position: relative;
}

.main-icon, .main-weather-svg {
    width: 160px;
    height: 160px;
    position: relative;
    flex-shrink: 0;
}
.main-weather-svg svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 24px rgba(0,212,255,0.2));
}

.floating { animation: float 4.5s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0px);   }
    50%       { transform: translateY(-10px); }
}

/* ── Анимации SVG ── */
@keyframes spin-slow {
    from { transform: rotate(0deg);   transform-origin: center; }
    to   { transform: rotate(360deg); transform-origin: center; }
}
@keyframes pulse-glow {
    0%, 100% { opacity: 1;   }
    50%       { opacity: 0.7; }
}
@keyframes rain-fall {
    0%   { transform: translateY(0px);  opacity: 1; }
    100% { transform: translateY(6px);  opacity: 0; }
}
@keyframes snow-fall {
    0%   { transform: translateY(0px) scale(1);    opacity: 1; }
    100% { transform: translateY(5px) scale(0.8);  opacity: 0.4; }
}
@keyframes bolt-flash {
    0%, 100% { opacity: 1;   }
    50%       { opacity: 0.3; }
}
@keyframes mist-drift {
    0%, 100% { transform: translateX(0);   }
    50%       { transform: translateX(4px); }
}

.svg-sun-rays { animation: spin-slow 12s linear infinite; }
.svg-sun-core { animation: pulse-glow 3s ease-in-out infinite; }
.svg-moon     { animation: pulse-glow 4s ease-in-out infinite; }
.svg-cloud    { animation: pulse-glow 5s ease-in-out infinite; }
.svg-rain     { animation: rain-fall 1.2s ease-in-out infinite; }
.svg-drizzle  { animation: rain-fall 1.8s ease-in-out infinite; }
.svg-snow     { animation: snow-fall 2s ease-in-out infinite; }
.svg-bolt     { animation: bolt-flash 1.5s ease-in-out infinite; }
.svg-mist     { animation: mist-drift 3s ease-in-out infinite; }

.temp-wrapper { display: flex; flex-direction: column; align-items: center; }
.temp-flex    { display: flex; align-items: flex-start; line-height: 1; }

#temp {
    font-family: 'Space Mono', monospace;
    font-size: 104px;
    font-weight: 700;
    letter-spacing: -6px;
    background: linear-gradient(140deg, #ffffff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.degree-top {
    font-size: 36px;
    font-weight: 300;
    color: var(--text-2);
    margin-top: 12px;
    -webkit-text-fill-color: var(--text-2);
}
.sf-desc {
    font-size: 18px;
    color: var(--text-2);
    font-weight: 400;
    text-transform: capitalize;
    margin-bottom: 6px;
}
.feels-like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
}

/* ══════════════════════════════════
   ВИДЖЕТЫ
══════════════════════════════════ */
.widgets-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.widget { padding: 22px 24px; }
.widget-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: 16px;
}

/* ══════════════════════════════════
   ПОЧАСОВОЙ ПРОГНОЗ
══════════════════════════════════ */
.hourly-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,212,255,0.2) transparent;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}
.hourly-scroll::-webkit-scrollbar       { height: 4px; }
.hourly-scroll::-webkit-scrollbar-track { background: transparent; }
.hourly-scroll::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.25); border-radius: 4px; }

.hour-item {
    min-width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 10px 12px;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    cursor: default;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.3s ease both;
}
.hour-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: transparent;
    border-radius: 2px 2px 0 0;
    transition: background 0.3s;
}
.hour-item:hover { background: rgba(255,255,255,0.06); border-color: var(--border-2); transform: translateY(-2px); }
.hour-item:nth-child(1)  { animation-delay: 0.00s; }
.hour-item:nth-child(2)  { animation-delay: 0.04s; }
.hour-item:nth-child(3)  { animation-delay: 0.07s; }
.hour-item:nth-child(4)  { animation-delay: 0.10s; }
.hour-item:nth-child(5)  { animation-delay: 0.13s; }
.hour-item:nth-child(6)  { animation-delay: 0.16s; }
.hour-item:nth-child(7)  { animation-delay: 0.19s; }
.hour-item:nth-child(8)  { animation-delay: 0.22s; }

.hour-item--now { background: rgba(0,212,255,0.07); border-color: var(--accent-border); }
.hour-item--now::before { background: var(--accent); }
.hour-item--now .hour-time { color: var(--accent); font-weight: 700; }
.hour-item--now .hour-temp { color: var(--accent); }

.hour-item--night { background: rgba(139,92,246,0.04); border-color: rgba(139,92,246,0.15); }
.hour-item--night::before { background: rgba(139,92,246,0.4); }

.hour-time { font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: 0.3px; white-space: nowrap; }

.hour-icon { width: 48px; height: 48px; flex-shrink: 0; }
.hour-icon svg { width: 100%; height: 100%; }
.hour-icon .svg-sun-rays { animation: spin-slow 20s linear infinite; }
.hour-icon .svg-rain,
.hour-icon .svg-drizzle  { animation: rain-fall 1.5s ease-in-out infinite; }
.hour-icon .svg-snow     { animation: snow-fall 2.5s ease-in-out infinite; }

.hour-temp { font-family: 'Space Mono', monospace; font-size: 15px; font-weight: 700; color: var(--text); line-height: 1; }
.hour-pop  { font-size: 10px; color: #60A5FA; font-weight: 600; opacity: 0.9; }

/* ══════════════════════════════════
   2 МАЛЕНЬКИХ ВИДЖЕТА В РЯД
══════════════════════════════════ */
.small-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.sun-info { display: flex; flex-direction: column; }
.sun-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.sun-row:last-child { border-bottom: none; padding-bottom: 0; }
.sun-row span { color: var(--text-2); }
.sun-row b { font-family: 'Space Mono', monospace; font-size: 14px; font-weight: 700; }

.aqi-status { font-family: 'Space Mono', monospace; font-size: 28px; font-weight: 700; color: var(--green); line-height: 1; margin-bottom: 4px; }
.aqi-bar { height: 5px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; margin: 12px 0 8px; }
#aqi-progress { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--green), #22c55e); transition: width 1.2s ease; width: 0%; }
.aqi-desc { font-size: 11px; color: var(--text-3); line-height: 1.5; }

/* ══════════════════════════════════
   ДЕТАЛИ КОМФОРТА
══════════════════════════════════ */
.comfort-grid { display: flex; flex-direction: column; }
.c-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.c-item:last-child { border-bottom: none; padding-bottom: 0; }
.c-item span { color: var(--text-2); font-size: 14px; }
.c-item b    { font-family: 'Space Mono', monospace; font-size: 14px; font-weight: 700; }

/* ══════════════════════════════════
   ПРОГНОЗ НА 5 ДНЕЙ
══════════════════════════════════ */
.forecast-list { display: flex; flex-direction: column; gap: 8px; }

.forecast-item {
    display: grid;
    grid-template-columns: 130px 52px 1fr auto;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px 24px;
    transition: background 0.2s, border-color 0.2s, transform 0.18s;
    cursor: default;
    animation: fadeUp 0.35s ease both;
}
.forecast-item:hover {
    background: rgba(0,212,255,0.04);
    border-color: var(--accent-border);
    transform: translateX(3px);
}
.forecast-item:first-child {
    background: rgba(0,212,255,0.05);
    border-color: rgba(0,212,255,0.2);
}
.forecast-item:first-child .f-day { color: var(--accent); }

/* Левая часть: день + осадки */
.fd-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.f-day   { font-size: 15px; font-weight: 700; color: var(--text); text-transform: capitalize; white-space: nowrap; }
.fd-pop  { font-size: 11px; color: #60A5FA; font-weight: 600; }

/* Иконка прогноза */
.f-icon-svg {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.f-icon-svg svg      { width: 100%; height: 100%; display: block; }
.f-icon-svg .svg-sun-rays { animation: spin-slow 25s linear infinite; }
.f-icon-svg .svg-rain,
.f-icon-svg .svg-drizzle  { animation: rain-fall 2s ease-in-out infinite; }
.f-icon-svg .svg-snow     { animation: snow-fall 3s ease-in-out infinite; }
.f-icon-svg .svg-cloud    { animation: pulse-glow 5s ease-in-out infinite; }
.f-icon-svg .svg-bolt     { animation: bolt-flash 1.5s ease-in-out infinite; }
.f-icon-svg .svg-mist     { animation: mist-drift 3s ease-in-out infinite; }

/* Описание */
.fd-desc { font-size: 14px; color: var(--text-2); text-transform: capitalize; line-height: 1.3; min-width: 0; }

/* Температуры макс/мин */
.fd-temps { display: flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
.fd-max   { font-family: 'Space Mono', monospace; font-size: 17px; font-weight: 700; color: var(--text); }
.fd-min   { font-family: 'Space Mono', monospace; font-size: 13px; font-weight: 400; color: var(--text-3); }

/* ══════════════════════════════════
   АНИМАЦИИ ПОЯВЛЕНИЯ
══════════════════════════════════ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0);    }
}
.hero-card { animation: fadeUp 0.4s ease both; }
.widgets-container .widget:nth-child(1) { animation: fadeUp 0.4s 0.05s ease both; }
.widgets-container .widget:nth-child(2) { animation: fadeUp 0.4s 0.10s ease both; }
.widgets-container .widget:nth-child(3) { animation: fadeUp 0.4s 0.15s ease both; }

/* ══════════════════════════════════
   СКРОЛЛБАР
══════════════════════════════════ */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ══════════════════════════════════
   КАСТОМНЫЙ ДРОПДАУН
══════════════════════════════════ */
.sf-dropdown { position: relative; flex-shrink: 0; z-index: 100; }

.sf-dropdown__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    height: var(--nav-h);
    padding: 0 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    min-width: 76px;
}
.sf-dropdown__trigger:hover { border-color: var(--border-2); background: rgba(255,255,255,0.05); }
.sf-dropdown.is-open .sf-dropdown__trigger { border-color: var(--accent-border); background: rgba(0,212,255,0.06); box-shadow: 0 0 0 3px rgba(0,212,255,0.08); }
.sf-dropdown__icon  { font-size: 16px; line-height: 1; }
.sf-dropdown__label { flex: 1; text-align: center; }
.sf-dropdown__arrow { width: 10px; height: 6px; color: var(--text-2); flex-shrink: 0; transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1); }
.sf-dropdown.is-open .sf-dropdown__arrow { transform: rotate(180deg); }

.sf-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #0e1828;
    border: 1px solid var(--accent-border);
    border-radius: var(--r-lg);
    padding: 6px;
    list-style: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,212,255,0.05), inset 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.22s cubic-bezier(0.34,1.56,0.64,1), transform 0.22s cubic-bezier(0.34,1.56,0.64,1), visibility 0.22s;
    pointer-events: none;
}
.sf-dropdown.is-open .sf-dropdown__menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }
.sf-dropdown__menu::before { content: ''; display: block; height: 1px; margin: 0 6px 6px; background: linear-gradient(90deg, transparent, var(--accent-border), transparent); }

.sf-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: calc(var(--r-lg) - 6px);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative;
    overflow: hidden;
}
.sf-dropdown__item::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at left, rgba(0,212,255,0.12) 0%, transparent 70%); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.sf-dropdown__item:hover { background: rgba(255,255,255,0.05); }
.sf-dropdown__item:hover::before { opacity: 1; }
.sf-dropdown__item--active { background: rgba(0,212,255,0.08); border: 1px solid rgba(0,212,255,0.18); }
.sf-dropdown__item--active .item-code { color: var(--accent); }
.sf-dropdown__item--active::after { content: '✓'; position: absolute; right: 12px; color: var(--accent); font-size: 12px; font-weight: 700; }
.item-flag { font-size: 20px; line-height: 1; flex-shrink: 0; }
.item-name { flex: 1; font-size: 13px; font-weight: 400; color: var(--text-2); transition: color 0.15s; }
.sf-dropdown__item:hover .item-name,
.sf-dropdown__item--active .item-name { color: var(--text); }
.item-code { font-family: 'Space Mono', monospace; font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: 1px; transition: color 0.15s; flex-shrink: 0; }

.sf-dropdown.is-open .sf-dropdown__item { animation: dropItem 0.2s ease both; }
.sf-dropdown.is-open .sf-dropdown__item:nth-child(1) { animation-delay: 0.02s; }
.sf-dropdown.is-open .sf-dropdown__item:nth-child(2) { animation-delay: 0.05s; }
.sf-dropdown.is-open .sf-dropdown__item:nth-child(3) { animation-delay: 0.08s; }
.sf-dropdown.is-open .sf-dropdown__item:nth-child(4) { animation-delay: 0.11s; }
.sf-dropdown.is-open .sf-dropdown__item:nth-child(5) { animation-delay: 0.14s; }
.sf-dropdown.is-open .sf-dropdown__item:nth-child(6) { animation-delay: 0.17s; }

@keyframes dropItem {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0);    }
}

.sf-dropdown--units .sf-dropdown__trigger { min-width: 64px; padding: 0 12px; }
.sf-dropdown--units .sf-dropdown__menu    { min-width: 160px; }

/* ══════════════════════════════════
   ДЕСКТОП БОЛЬШОЙ (≥ 1100px)
══════════════════════════════════ */
@media (min-width: 1100px) {
    #today-view { grid-template-columns: 420px 1fr; gap: 28px; }
    .widgets-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 20px;
        align-content: start;
    }
    .widgets-container > .widget:first-child { grid-column: 1 / -1; }
    .small-widgets { display: flex; flex-direction: column; gap: 16px; grid-column: 1 / 2; }
    .widgets-container > .widget:last-child  { grid-column: 2 / 3; }
}

/* ══════════════════════════════════
   ПЛАНШЕТ (768px – 1099px)
══════════════════════════════════ */
@media (max-width: 1099px) {
    .sf-wrapper { padding: 20px 24px 44px; }
    #today-view { grid-template-columns: 1fr; gap: 16px; }
    .hero-card  { align-self: auto; padding: 36px 28px 30px; }
    #temp       { font-size: 92px; }
}

/* ══════════════════════════════════
   МОБАЙЛ (≤ 640px)
══════════════════════════════════ */
@media (max-width: 640px) {

    .sf-wrapper { padding: 14px 14px 40px; }

    /* Шапка */
    .apple-nav   { gap: 8px; flex-wrap: nowrap; }
    .quick-settings { gap: 6px; flex-shrink: 0; }
    .search-container { height: 44px; padding: 0 8px 0 16px; border-radius: 22px; }
    .search-container input { font-size: 14px; }
    .search-icon-btn { width: 32px; height: 32px; }

    /* Select скрыт — показываем дропдауны */
    .sf-select { display: none; }
    .sf-dropdown__trigger { height: 44px; min-width: 58px; padding: 0 10px; font-size: 12px; border-radius: 14px; }
    .sf-dropdown__arrow   { display: none; }

    /* Табы */
    .ios-tabs { margin-bottom: 14px; }
    .tabs-bg  { max-width: 240px; }
    .tab-btn  { padding: 9px 14px; font-size: 13px; }

    /* Hero */
    .hero-card    { padding: 24px 20px 24px; gap: 12px; border-radius: 22px; }
    .hero-visual  { gap: 10px; }
    .hero-header h1 { font-size: 26px; letter-spacing: -0.5px; }
    .sf-date      { font-size: 10px; letter-spacing: 1.5px; margin-top: 4px; }
    .main-icon,
    .main-weather-svg { width: 110px; height: 110px; }
    #temp         { font-size: 80px; letter-spacing: -4px; }
    .degree-top   { font-size: 28px; margin-top: 8px; }
    .sf-desc      { font-size: 16px; margin-bottom: 4px; }
    .feels-like   { font-size: 12px; padding: 5px 14px; }

    /* Виджеты */
    .widgets-container { display: flex !important; flex-direction: column !important; gap: 12px !important; }
    .widget       { padding: 16px; border-radius: 20px; }
    .widget-title { font-size: 9px; letter-spacing: 1.8px; margin-bottom: 12px; }

    /* Почасовой */
    .hourly-scroll { gap: 8px; padding-bottom: 6px; }
    .hour-item  { min-width: 68px; padding: 10px 8px 9px; border-radius: 14px; gap: 5px; }
    .hour-icon  { width: 38px; height: 38px; }
    .hour-time  { font-size: 10px; }
    .hour-temp  { font-size: 13px; }
    .hour-pop   { font-size: 9px; }

    /* Маленькие виджеты */
    .small-widgets { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
    .sun-row { padding: 8px 0; font-size: 13px; }
    .sun-row b { font-size: 13px; }
    .aqi-status { font-size: 22px; }
    .aqi-desc   { font-size: 10px; }

    /* Детали комфорта */
    .c-item      { padding: 10px 0; gap: 8px; }
    .c-item span { font-size: 13px; flex-shrink: 0; }
    .c-item b    { font-size: 13px; text-align: right; word-break: break-word; max-width: 55%; }

    /* Прогноз 5 дней */
    .forecast-item {
        grid-template-columns: 82px 40px 1fr auto;
        padding: 13px 14px;
        gap: 10px;
        border-radius: 16px;
    }
    .f-day   { font-size: 13px; }
    .fd-pop  { font-size: 10px; }
    .fd-desc { font-size: 12px; }
    .fd-max  { font-size: 15px; }
    .fd-min  { font-size: 11px; }
    .f-icon-svg { width: 38px !important; height: 38px !important; min-width: 38px !important; }

    /* Дропдаун */
    .sf-dropdown__menu { min-width: 160px; right: 0; }
    .sf-dropdown--units .sf-dropdown__trigger { min-width: 54px; }
}

/* ══════════════════════════════════
   МОБАЙЛ МАЛЕНЬКИЙ (≤ 390px)
══════════════════════════════════ */
@media (max-width: 390px) {
    .sf-wrapper { padding: 12px 12px 32px; }

    .hero-header h1 { font-size: 22px; }
    #temp         { font-size: 66px; letter-spacing: -3px; }
    .degree-top   { font-size: 24px; }
    .main-icon,
    .main-weather-svg { width: 95px; height: 95px; }

    .small-widgets { grid-template-columns: 1fr 1fr !important; }
    .hour-item  { min-width: 60px; }
    .hour-icon  { width: 34px; height: 34px; }

    .forecast-item {
        grid-template-columns: 68px 32px 1fr auto;
        padding: 11px 12px;
        gap: 8px;
    }
    .f-icon-svg { width: 30px !important; height: 30px !important; min-width: 30px !important; }
    .fd-max { font-size: 13px; }
    .fd-min { font-size: 10px; }

    .sf-dropdown__trigger { min-width: 50px; padding: 0 8px; }
}