/* Главная «Сегодня»: вердикт, полоса ночи, «меню» объектов по времени ночи. */

.tonight-hero { padding-bottom: 8px; }
/* заголовок — во всю ширину; под ним рядом и одной высоты индексы и вердикт, без пустот: слева —
   быстрый ответ (индексы), справа — пояснение; на узком экране так же — индексы, потом вердикт */
.tonight-hero {
  display: grid; grid-template-columns: minmax(360px, 560px) minmax(0, 1fr); column-gap: 20px; align-items: stretch;
  grid-template-areas: "eye eye" "title title" "gauge verdict";
}
.tonight-hero > .eyebrow { grid-area: eye; }
.tonight-hero > h1 { grid-area: title; }
.tonight-hero > .verdict { grid-area: verdict; max-width: none; align-items: center; }

/* «спидометр» ночи: шкала от красного к зелёному, стрелка — звёздочка из логотипа */
.sky-gauge {
  /* зелёный конец шкалы — сочнее зелёного темы */
  --sg-good: color-mix(in oklab, var(--good) 45%, #1fe07a);
  position: relative; grid-area: gauge; margin-top: 20px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 18px; align-items: center;
  grid-template-areas: "h how" "pair pair" "until next";
  padding: 12px 18px 12px; border-radius: 18px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.sky-gauge .eyebrow { grid-area: h; margin: 0; }
/* две шкалы рядом: «Луна и планеты» и «галактики и туманности» */
.sg-pair { grid-area: pair; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 4px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sg-one { min-width: 0; text-align: center; }
.sg-dial { position: relative; margin: 2px auto 0; width: 100%; max-width: 205px; text-align: center; container-type: inline-size; }
.sg-dial svg { display: block; width: 100%; height: auto; overflow: visible; }
.sg-scale, .sg-fill { fill: none; stroke: url(#sg-grad); stroke-width: 17; stroke-linecap: round; }
.sg-scale { opacity: .2; }
.sg-ticks path { stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; opacity: .4; }
.sg-ticks path.major { stroke-width: 2.5; opacity: .7; }
.sg-range { fill: none; stroke: var(--sc, var(--fg)); stroke-width: 3; opacity: .6; }
.sg-star path { fill: #fff; stroke: var(--surface-solid); stroke-width: 3px; paint-order: stroke; vector-effect: non-scaling-stroke; }
.sg-star { filter: drop-shadow(0 0 5px var(--sc, #fff)); }
/* число и оценка словом — внутри шкалы; размер — от ширины шкалы (cqi): слово помещается между концами дуги */
.sg-num {
  position: absolute; left: 0; right: 0; bottom: 25%;
  font: 900 38px/1 var(--display); font-size: clamp(28px, 18.5cqi, 38px); letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  color: var(--sc, var(--fg));
}
.sg-word { margin: 4px 0 0; font: 900 21px/1.15 var(--display); letter-spacing: -0.01em; color: var(--sc, var(--fg)); }
.sg-dial .sg-word { position: absolute; left: 11%; right: 11%; bottom: 0; margin: 0; font-size: 19px; font-size: clamp(12px, 9.5cqi, 20px); line-height: 1.1; white-space: nowrap; }
.sg-dial .sg-word.long { font-size: 16px; font-size: clamp(11px, 8cqi, 17px); }
/* подпись шкалы — под ней, крупно и со значком */
.sg-for { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 0; font: 800 21px/1.2 var(--display); color: var(--fg); }
.sg-for svg { width: 24px; height: 24px; flex: none; color: var(--accent); }
.sg-note { margin: 2px 0 0; min-height: 1.3em; font-size: 13px; line-height: 1.3; color: var(--muted); }
.sg-one.wait .sg-num, .sg-one.wait .sg-word { color: var(--muted); }
.sg-one.wait .sg-num { animation: sg-pulse 1.4s ease-in-out infinite; }
@keyframes sg-pulse { 50% { opacity: .3; } }
.sg-next {
  grid-area: next; align-self: center; margin: 10px 0 0;
  display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 2px 14px; font-size: 15px;
}
.sg-next[hidden] { display: none; }
.sg-next-h { width: 100%; font: 700 12px/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sg-next a { display: inline-flex; align-items: baseline; gap: 6px; color: var(--fg); text-decoration: none; font-weight: 700; }
.sg-next a b { font: 900 18px/1 var(--display); color: var(--c, var(--muted)); }
.sg-next a i { font-style: normal; font-weight: 400; color: var(--muted); margin: 0 -2px; }
.sg-next a:hover span { text-decoration: underline; }
/* «как считается»: маленькая ссылка, раскрывается под индексом */
/* до скольких смотрят — маленький выбор под ответом */
.sg-until { grid-area: until; display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin: 10px 0 0; font: 700 14px/1 var(--body); color: var(--muted); }
.sg-until select { width: auto; padding: 5px 28px 5px 10px; min-height: 0; font: 700 14px/1.2 var(--body); border-radius: 10px; }
.sg-how { grid-area: how; justify-self: end; margin: 0; font-size: 14.5px; text-align: left; }
.sg-how summary { display: block; width: max-content; margin: 0; cursor: pointer; list-style: none; font: 700 13.5px/1.3 var(--body); color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; }
.sg-how summary::-webkit-details-marker { display: none; }
.sg-how summary:hover, .sg-how[open] summary { color: var(--fg); }
.sg-how > div {
  position: absolute; z-index: 30; left: 10px; right: 10px; top: calc(100% - 10px);
  padding: 12px 14px; border-radius: 14px; line-height: 1.45; color: var(--muted);
  background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.sg-how p { margin: 0; }
.sg-how p + ul, .sg-how ul + p { margin-top: 6px; }
.sg-how ul { margin: 0; padding-left: 18px; }
.sg-how b { color: var(--fg); }
@media (max-width: 860px) {
  .tonight-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "eye" "title" "gauge" "verdict"; }
  .sky-gauge { max-width: 560px; margin-top: 18px; }
}
/* узко: «Moon and planets» переносится — обе подписи высотой в две строки, чтобы пояснения под ними стояли ровно */
@media (max-width: 480px) {
  .sg-for { min-height: 2.4em; font-size: 18px; }
  .sg-for svg { width: 22px; height: 22px; }
}
@media (max-width: 400px) {
  .sky-gauge { padding: 12px 14px; }
  .sg-pair { gap: 10px; }
  .sg-word { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .sg-one.wait .sg-num { animation: none; } }
.verdict {
  margin-top: 20px; max-width: 760px;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 20px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--faint);
  box-shadow: var(--shadow);
}
.verdict.good { border-left-color: var(--good); }
.verdict.fair { border-left-color: var(--fair); }
.verdict.poor { border-left-color: var(--poor); }
#verdict-head { display: block; font: 900 clamp(20px, 2.6vw, 25px)/1.2 var(--display); letter-spacing: -0.01em; }
.verdict.good #verdict-head { color: var(--good); }
.verdict.fair #verdict-head { color: var(--fair); }
.verdict.poor #verdict-head { color: var(--poor); }
#verdict-text { margin: 6px 0 0; color: var(--fg); font-size: 17.5px; }
/* по строке на цель: что видно и когда лучше — или почему не выйдет; точка — цветом индекса */
.verdict-aims { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.verdict-aims[hidden] { display: none; }
.verdict-aims li { position: relative; padding-left: 18px; font-size: 16px; line-height: 1.45; color: var(--muted); }
.verdict-aims li::before { content: ""; position: absolute; left: 0; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); }
.verdict-aims b { color: var(--fg); }
.verdict-aims b span { color: var(--c, var(--fg)); }

.night-card { margin-top: 22px; }
.night-card .section-head h2 { font-size: clamp(20px, 2.4vw, 23px); }

/* полоса ночи */
.tl { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: start; }
.tl-rows { position: relative; height: 96px; font: 700 12px/1 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tl-rows span { position: absolute; left: 0; }
.tl-rows span:nth-child(1) { top: 10px; }
.tl-rows span:nth-child(2) { top: 48px; }
.tl-rows span:nth-child(3) { top: 81px; }
.tl-plot { position: relative; min-width: 0; }
.tl-plot svg { display: block; width: 100%; height: 96px; border-radius: 10px; background: rgba(0, 0, 0, .22); }
.tl-plot .s0 { fill: var(--night-0); }
.tl-plot .s1 { fill: var(--night-1); }
.tl-plot .s2 { fill: var(--night-2); }
.tl-plot .s3 { fill: var(--night-3); }
.tl-plot .s4 { fill: var(--night-4); }
.tl-plot .best { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.tl-plot .now { stroke: #fff; stroke-width: 1.6; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.tl-plot .split { fill: var(--accent); }
.tl-plot .late { fill: color-mix(in srgb, var(--surface) 62%, transparent); }
.tl-best {
  position: absolute; top: 37px; padding-left: 6px; pointer-events: none;
  font: 800 11.5px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8); white-space: nowrap; overflow: hidden;
}
.tl-ticks { position: relative; height: 22px; margin-top: 4px; }
.tl-ticks span {
  position: absolute; top: 0; transform: translateX(-50%);
  font: 500 13px/1.6 var(--mono); color: var(--muted); white-space: nowrap;
}
.tl-facts { margin: 10px 0 0; color: var(--muted); }
.tl-facts b { color: var(--fg); font-weight: 800; }

/* легенда: те же цвета, что на полосе */
.tl-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; padding: 0; color: var(--muted); }
.tl-legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tl-legend .sw { display: inline-flex; flex: none; width: 18px; height: 10px; border-radius: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.tl-legend .sw b { flex: 1; }
.tl-legend .s0 { background: var(--night-0); }
.tl-legend .s1 { background: var(--night-1); }
.tl-legend .s2 { background: var(--night-2); }
.tl-legend .s3 { background: var(--night-3); }
.tl-legend .s4 { background: var(--night-4); }
.tl-legend .tw { width: 27px; }
.tl-legend .moon { height: 6px; background: rgba(241, 239, 230, .9); }
.tl-legend .cloud { background: rgba(226, 231, 242, .55); }
.tl-legend .cloud.multi { background: repeating-linear-gradient(180deg, rgba(226, 231, 242, .7) 0 2px, transparent 2px 3px); }
.tl-legend .split { height: 4px; background: var(--accent); }
.tl-legend .best { background: none; box-shadow: inset 0 0 0 2px var(--accent); }
.tl-legend .late { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.tl-legend .now { width: 0; height: 14px; border-radius: 0; box-shadow: none; border-left: 2px dashed var(--fg); margin: 0 2px 0 6px; }

/* подсказка при наведении или касании: время и что тогда с небом, Луной и облаками */
.tl-plot svg { touch-action: pan-y; cursor: crosshair; }
.tl-mark { position: absolute; top: 0; height: 96px; width: 0; border-left: 1px solid var(--fg); opacity: .7; pointer-events: none; }
.tl-tip {
  position: absolute; top: 99px; z-index: 2; width: max-content; max-width: 100%; pointer-events: none;
  padding: 3px 9px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-strong);
  font: 600 13.5px/1.45 var(--body); color: var(--fg); box-shadow: var(--shadow);
}

.tl-retry { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.page-credits { margin: -10px 0 26px; }
.page-credits a { color: var(--muted); }
@media (max-width: 560px) {
  .tl { grid-template-columns: 1fr; }
  .tl-rows { display: none; }
  .tl-ticks span:nth-child(even) { display: none; }
}

/* меню */
.dishes { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.dish {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 16px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.dish p { margin: 0; }
.dish-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 2px; }
.dish-top > div { min-width: 0; flex: 1; }
.dish-top h3 { margin: 0; font: 800 20px/1.2 var(--display); letter-spacing: -0.01em; }
.dish-kind { color: var(--muted); font-size: 14.5px; }
.dish-when { font-weight: 700; }
.dish-span { font-size: 15px; }
/* тепловая полоска: когда этой ночью смотреть лучше всего (ось — как у полосы ночи) */
.heat { margin: 8px 0 2px; }
.heat-plot { position: relative; }
.heat-graph { display: block; width: 100%; height: 24px; overflow: visible; }
.heat-base { stroke: color-mix(in srgb, var(--fg) 14%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.heat-area { fill: color-mix(in srgb, var(--good) 22%, transparent); }
.heat-line { fill: none; stroke: var(--good); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.heat-late { position: absolute; top: -2px; bottom: 0; right: 0; background: color-mix(in srgb, var(--surface) 64%, transparent); }
.heat-now { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--accent); }
.heat-ticks { position: relative; height: 14px; margin-top: 3px; font: 600 12px/1 var(--body); color: var(--faint); }
.heat-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.dish-note { color: var(--muted); font-size: 15.5px; }
.dish { cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.dish:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.dish-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: auto; padding-top: 6px; }
.dish-links a { font-weight: 800; font-size: 15px; text-decoration: none; }
.dish-links a:hover { text-decoration: underline; }
.dish.washed { opacity: .82; }
.dot { width: 14px; height: 14px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.dot.dso { width: 18px; height: 18px; margin-top: 3px; background: radial-gradient(circle, rgba(255, 255, 255, .95) 0 18%, color-mix(in srgb, var(--accent-2) 50%, transparent) 40%, transparent 70%); box-shadow: none; }
[data-theme="daylight"] .dot.dso { background: radial-gradient(circle, #2b3a6b 0 18%, rgba(43, 58, 107, .35) 40%, transparent 70%); }
.moon-ico { flex: none; }

/* чем смотреть: фильтр «меню» */
.gear-pick { margin: 26px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.gear-h { margin: 0; font: 800 clamp(19px, 2.2vw, 21px)/1.2 var(--display); letter-spacing: -0.01em; }
.gear-seg { flex-wrap: wrap; }
.gear-seg button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px 8px 12px; }
.gear-seg svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 420px) {
  .gear-seg button { padding: 8px 10px; gap: 5px; justify-content: center; }
  .gear-seg svg { width: 18px; height: 18px; }
  /* на узком телефоне — две строки по две кнопки, а не «Telescope» один на второй строке */
  .gear-seg { display: grid; grid-template-columns: 1fr 1fr; border-radius: 18px; }
}
.gear-help { margin: 0; flex-basis: 100%; }
.gear-pick + .section { margin-top: 18px; }
.where-pick { margin-top: 14px; }
.gear-help a { font-weight: 700; }

/* картинки в меню: Луна и планеты нарисованы, глубокое небо — миниатюры каталога */
.dish-pic {
  position: relative; width: 56px; height: 56px; flex: none; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center;
}
.dish-pic.body { background: #05060a; }
.dish-pic img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.dish-pic.body img { object-fit: contain; }
.dish-pic > svg { width: 46px; height: 46px; }
.dish-pic .cat-thumb { position: absolute; inset: 0; display: grid; place-items: center; background: #000; }
.dish-pic .cat-thumb.glyph { background: var(--surface-2); color: var(--muted); }
.dish-pic .cat-thumb.glyph svg { width: 28px; height: 28px; }
/* астеризм — нарисованная фигура (asterisms.js): север вверху, восток слева */
.dish-pic.ast > svg { width: 100%; height: 100%; }
.ast-svg .ln { stroke: var(--accent-2); stroke-opacity: .6; }
[data-theme="daylight"] .ast-svg .ln { stroke: color-mix(in srgb, var(--accent-2) 45%, #fff); stroke-opacity: .8; }
.course { margin-top: 24px; }
.course:first-child { margin-top: 0; }
.course-head { margin: 0 0 10px; font: 800 13.5px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
#hidden { margin-top: 22px; }
#hidden summary { cursor: pointer; font-weight: 800; color: var(--muted); margin-bottom: 12px; }
#not-up { margin-top: 16px; }
#view-card h3, #cons-sec h3 { margin-top: 6px; }

/* ближайшие события */
.events { display: grid; gap: 12px; }
a.card.event { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; }
.event h3 { margin: 0; font-size: 18px; }
.event p { margin: 2px 0 0; }
.ev-date b { display: block; font: 800 19px/1.1 var(--display); }
.ev-date span { color: var(--muted); font-size: 13.5px; }
@media (max-width: 560px) {
  a.card.event { grid-template-columns: 64px 1fr; }
  a.card.event .badge { grid-column: 2; justify-self: start; }
}

.explore .card h3 { margin-top: 6px; }
.about-blurb { margin-top: 48px; }

/* карта всего неба на ночь */
.sky-card { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 22px; align-items: center; }
.sky-wrap { width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--chart-sky); }
.sky-wrap canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.sky-side .field input[type="range"] { width: 100%; }
.sky-pick { margin: 14px 0 6px; font-weight: 700; min-height: 1.5em; }
@media (max-width: 760px) { .sky-card { grid-template-columns: 1fr; } }
