/* Главная: каркас 52/48, погода на 6 часов — сверху карты,
   под картой — значки Telegram + кнопка настроек. Палитра и компоненты — из style.css. */

/* Знак «проходит маршрут» — раз в минуту, вперёд (как при открытии). */
.logo-start { animation: logo-min-start 60s linear infinite; }
.logo-route circle:nth-child(1) { animation: logo-min-c1 60s linear infinite; }
.logo-route circle:nth-child(2) { animation: logo-min-c2 60s linear infinite; }
.logo-route circle:nth-child(3) { animation: logo-min-c3 60s linear infinite; }
.logo-route circle:nth-child(4) { animation: logo-min-c4 60s linear infinite; }
.logo-route circle:nth-child(5) { animation: logo-min-c5 60s linear infinite; }
.logo-drop { animation: logo-min-drop 60s linear infinite; }
@keyframes logo-min-start {
  0% { opacity: 0; transform: scale(0); }
  0.0833% { opacity: 0; transform: scale(0); animation-timing-function: cubic-bezier(.3, 1.6, .5, 1); }
  0.5167% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes logo-min-c1 {
  0% { opacity: 0; transform: scale(0); }
  0.2833% { opacity: 0; transform: scale(0); animation-timing-function: cubic-bezier(.3, 1.6, .5, 1); }
  0.7167% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes logo-min-c2 {
  0% { opacity: 0; transform: scale(0); }
  0.4167% { opacity: 0; transform: scale(0); animation-timing-function: cubic-bezier(.3, 1.6, .5, 1); }
  0.8500% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes logo-min-c3 {
  0% { opacity: 0; transform: scale(0); }
  0.5667% { opacity: 0; transform: scale(0); animation-timing-function: cubic-bezier(.3, 1.6, .5, 1); }
  1.0000% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes logo-min-c4 {
  0% { opacity: 0; transform: scale(0); }
  0.7500% { opacity: 0; transform: scale(0); animation-timing-function: cubic-bezier(.3, 1.6, .5, 1); }
  1.1833% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes logo-min-c5 {
  0% { opacity: 0; transform: scale(0); }
  0.8833% { opacity: 0; transform: scale(0); animation-timing-function: cubic-bezier(.3, 1.6, .5, 1); }
  1.3167% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes logo-min-drop {
  0% { opacity: 0; transform: translateY(-60%); }
  1.0333% { opacity: 0; transform: translateY(-60%); animation-timing-function: cubic-bezier(.3, 0, .4, 1); }
  1.4083% { opacity: 1; transform: translateY(0) scale(1.08, .86); animation-timing-function: ease-out; }
  1.6167% { transform: translateY(-8%) scale(.97, 1.04); animation-timing-function: ease-in; }
  1.8667% { opacity: 1; transform: none; }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-start, .logo-route circle, .logo-drop { animation: none; }
}

@media (min-width: 801px) {
  .layout { grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); }
  .secret-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-soft); }

  /* Погода по часам — на уровне шапки, над картой. */
  .secret-weather-bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 68px;
    padding: 6px 12px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
  }
  .secret-weather-bar .weather-now { display: none; }
  .secret-weather-bar .secret-weather-panel { display: contents; }
  .secret-weather-bar .secret-weather-panel .footer-title { display: none; }
  .secret-weather-bar .weather-head { flex: none; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .secret-weather-bar .weather-big { font-size: 26px; line-height: 1; }
  .secret-weather-bar .weather-temp { font-size: 18px; line-height: 1.1; white-space: nowrap; }
  .secret-weather-bar .weather-temp span { font-size: 12px; }
  .secret-weather-bar .weather-sub { font-size: 10px; line-height: 1.2; white-space: nowrap; }
  .secret-weather-bar .weather-hours {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    padding: 0;
  }
  .secret-weather-bar .weather-hours li {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "time time"
      "icon temp"
      "icon pop";
    column-gap: 6px;
    align-items: center;
    padding: 5px 7px;
    border-radius: 8px;
    background: var(--surface);
    min-width: 0;
    overflow: hidden;
  }
  .secret-weather-bar .weather-hour { grid-area: time; justify-self: center; font-size: 11px; line-height: 1.1; color: var(--muted); white-space: nowrap; }
  .secret-weather-bar .weather-hour-icon { grid-area: icon; justify-self: center; font-size: 18px; line-height: 1; }
  .secret-weather-bar .weather-hours b { grid-area: temp; justify-self: center; font-size: 13px; line-height: 1; white-space: nowrap; }
  .secret-weather-bar .weather-pop { grid-area: pop; justify-self: center; color: var(--muted); font-size: 9px; letter-spacing: -.2px; line-height: 1; white-space: nowrap; }
  .secret-weather-bar .weather-pop.is-wet { color: var(--accent-strong); font-weight: 600; }

  .secret-right .map-wrap { flex: 1; min-height: 0; position: relative; }
  .secret-right .site-footer {
    position: relative;
    flex: none;
    z-index: 4;
    margin-top: 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
    box-shadow: none;
  }
  .secret-right .footer-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-height: 46px;
    padding: 5px 12px;
  }
  .secret-right .footer-bar .footer-icon { width: 34px; height: 34px; }
  .secret-more {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--accent-ink);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .secret-more:hover { background: var(--accent-soft); border-color: var(--accent); }
  .secret-more-icon { font-size: 17px; line-height: 1; }

  .routes .rain-banner { grid-column: 1 / -1; }

  /* Ровные карточки маршрутов: одинаковая ширина и выровненная высота. */
  .route-card { display: flex; flex-direction: column; height: 100%; }
  .route-card h3 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .route-card p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .route-card .tags { margin-top: auto; padding-top: 8px; }
  .route-card.route-pair { height: 100%; }
  .route-card.route-pair > :last-child { margin-top: auto; }

  /* Шторка настроек — над правой колонкой. */
  .secret-sheet-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 48vw;
    z-index: 40;
    background: rgba(19, 41, 61, .18);
  }
  .secret-sheet {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 48vw;
    max-height: 90dvh;
    z-index: 41;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 34px rgba(18, 60, 100, .22);
  }
  .secret-sheet[hidden], .secret-sheet-backdrop[hidden] { display: none !important; }
  .secret-sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .secret-sheet .secret-sheet-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; text-transform: none; }
  .secret-sheet-close {
    margin-inline-start: auto;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
  }
  .secret-sheet-body { overflow-y: auto; padding: 10px 16px 14px; }

  .secret-sheet .footer-section { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .secret-sheet .footer-section:last-child { border-bottom: 0; }
  .secret-sheet .footer-title { margin: 0 0 6px; font-size: 10px; letter-spacing: .06em; }
  .secret-sheet .footer-links { gap: 4px; }
  .secret-sheet .footer-link { padding: 6px 8px; margin: 0 -8px; gap: 10px; }
  .secret-sheet .footer-link > span:first-child { width: 28px; height: 28px; }
  .secret-sheet .footer-link-text { display: grid; gap: 1px; font-size: 11px; line-height: 1.3; }
  .secret-sheet .footer-link-text b { font-size: 13px; }
  .secret-sheet .theme-switch { display: flex; width: 100%; }
  .secret-sheet .theme-switch button { flex: 1; }
  .secret-sheet .cookie-setting { margin-top: 10px; }

  /* Деталь маршрута: спокойнее и плотнее в левой колонке. */
  .detail { padding: 20px 20px 30px; }
  .detail h1 { font-size: 28px; margin-bottom: 8px; }
  .detail .lead { margin: 12px 0; font-size: 15px; line-height: 1.5; }
  .detail .meta { font-size: 13px; gap: 4px 14px; }
  .actions { gap: 9px; margin: 18px 0 10px; }
  .actions.route-actions .button { min-height: 46px; border-radius: 12px; }
  .stops { padding: 16px 14px 6px; border-radius: 18px; }
  .stop { gap: 13px; padding-bottom: 8px; }
  .stop-name { padding-top: 6px; font-size: 15px; }
  .stop-address, .stop-note, .stop-about, .stop-description { font-size: 13.5px; }
  .leg-row { padding-block: 10px 13px; }
  .approach { padding: 14px 16px; border-radius: 14px; }

  /* Места: карточка и список аккуратнее. */
  .place-item { height: 100%; }
  .place-card { height: 100%; align-items: flex-start; }
  .place-thumb { width: 96px; height: 96px; border-radius: 14px; }
  .place-text h3 { font-size: 17px; }
  .place-text p { -webkit-line-clamp: 2; font-size: 13.5px; }
  .place-meta { font-size: 12px; gap: 4px 14px; }
  .places-more .button { min-height: 44px; }

  /* Поиск и фильтры */
  .filters { padding: 16px 20px 4px; gap: 14px; }
  .search { padding: 11px 14px; border-radius: 12px; }
  .filter-title { margin-bottom: 6px; }
  .chips { gap: 6px; }
  .chip { padding: 6px 12px; font-size: 13.5px; }
  .toolbar { gap: 10px; min-height: 34px; margin-top: -6px; }
  .count { font-size: 13px; }
  .routes { padding-top: 0; }
  .suggest { border-radius: 14px; }
  .suggest-item { padding: 8px 10px; }
  .suggest-name { font-size: 15px; }

  /* Фильтры: строка-заголовок и группы — один блок, кнопка едва заметна. */
  .filters-block {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
  }
  .filters-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: start;
  }
  .filters-toggle:hover { background: var(--bg-soft); }
  .filters-summary { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 500; font-size: 13px; }
  .filters-toggle-arrow { color: var(--muted); transition: transform .2s; }
  .filters.is-open .filters-toggle-arrow { transform: rotate(180deg); }
  .filters-block .filters-body { padding: 12px 12px 12px; border-top: 1px solid var(--line); }
  .filters:not(.is-open) .filters-body { display: none; }
}

@media (min-width: 801px) and (max-width: 1400px) {
  .secret-weather-bar .weather-sub { display: none; }
  .secret-weather-bar .weather-pop { display: none; }
}
@media (min-width: 801px) and (max-width: 1320px) {
  .secret-weather-bar .weather-temp span { display: none; }
}
@media (min-width: 801px) and (max-width: 1080px) {
  .secret-weather-bar .weather-hours li:nth-child(6) { display: none; }
}
@media (min-width: 801px) and (max-width: 1000px) {
  .secret-weather-bar .weather-hours li:nth-child(n+5) { display: none; }
}
@media (min-width: 801px) and (max-width: 930px) {
  .secret-weather-bar .weather-hours li:nth-child(n+4) { display: none; }
}
@media (min-width: 801px) and (max-width: 870px) {
  .secret-weather-bar .weather-hours li:nth-child(n+3) { display: none; }
}
@media (min-width: 801px) and (max-width: 820px) {
  .secret-weather-bar { position: relative; }
  .secret-weather-bar .weather-head { flex: 1; cursor: pointer; }
  .secret-weather-bar .weather-head::after {
    content: "▾";
    color: var(--muted);
    font-size: 13px;
    line-height: 1;
  }
  .secret-weather-bar .weather-hours {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 12px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 18px rgba(18, 60, 100, .14);
  }
  .secret-weather-bar.is-open .weather-hours { display: grid; }
  .secret-weather-bar.is-open .weather-hours li { display: grid; }
}

@media (min-width: 1280px) {
  .routes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  /* Погода — значком на карте; отдельной строки сверху нет. */
  .secret-right { position: fixed; inset: 0; }
  .secret-weather-bar { display: none; }
  .secret-right .map-wrap { position: fixed; inset: 0; }
  .secret-right .site-footer, .secret-sheet, .secret-sheet-backdrop { display: none !important; }
}
