/*
 * Единая страница. Основа — стили главной (/static/styles.css): шапка,
 * главная карточка, холм, шторки. Здесь только новое: выбор цели, общая
 * шкала сеанса, быстрые переключатели и легенда UV.
 *
 * Правило цветов: одни цвета — один смысл. Цвета шкалы ВОЗ (зелёный …
 * фиолетовый) — только про силу солнца: холм, квадратик UV и легенда под
 * холмом. Всё остальное нейтральное, кроме четырёх отметок сеанса — у них
 * свои цвета в кружках расписания сеанса. Раньше рядом жили три
 * цветовых языка (UV, цена для кожи, зоны шкалы), и читать это было трудно.
 */

:root {
  --mark-vitd: #2f6fdb;
  --mark-tan: #8b5e3c;
  --mark-shade: #6b6f78;
  --mark-burn: #d23b3b;
}


/* ---------- ради чего ---------- */

.goal {
  display: grid;
  gap: 6px;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-2);
}

.segmented[hidden] {
  display: none;
}

.segmented button {
  border: none;
  background: none;
  padding: 10px 6px;
  border-radius: 10px;
  font-size: 0.98rem;
  cursor: pointer;
  color: var(--muted);
}

.segmented button[aria-checked="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  box-shadow: var(--shadow);
}

.segmented.small button {
  padding: 6px 6px;
  font-size: 0.88rem;
}

/* ---------- главная карточка ---------- */

/* Карточка без цветного фона: цвет здесь означал бы ещё что-то третье. */
#hero,
#hero[data-kind] {
  --tone: var(--text);
  --tone-soft: var(--surface);
  box-shadow: var(--shadow);
}

/* Расписание сеанса: сверху вниз, значок в кружке, линия между кружками.
   Сплошная — пока можно на солнце, красный пунктир — после «пора в тень».
   Цвет кружка — одна отметка, одинаково везде. */
.session {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.plan {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plan li {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 10px;
  min-height: 30px;
  padding-bottom: 16px;
}

.plan li:last-child {
  padding-bottom: 0;
}

/* Линия от этого кружка вниз к следующему. */
.plan li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 32px;
  bottom: 2px;
  width: 2px;
  border-radius: 1px;
  background: var(--line);
}

.plan li.risky:not(:last-child)::after {
  background: repeating-linear-gradient(
    to bottom,
    var(--mark-burn) 0 4px,
    transparent 4px 8px
  );
  opacity: 0.7;
}

.plan .ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  align-self: start;
}

.plan .ico svg {
  width: 17px;
  height: 17px;
}

.plan .ico b {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
}

.plan .start .ico {
  background: var(--surface-2);
  color: var(--muted);
}

.plan .start .ico svg {
  width: 14px;
  height: 14px;
  margin-left: 2px;
}

.plan .vitd .ico { background: var(--mark-vitd); }
.plan .tan .ico { background: var(--mark-tan); }
.plan .shade .ico { background: var(--mark-shade); }
.plan .burn .ico { background: var(--mark-burn); }
.plan .partial .ico { opacity: 0.45; }

/* Первая строка текста — по центру кружка. */
.plan .what,
.plan .when {
  padding-top: 5px;
  line-height: 1.25;
}

.plan .what {
  font-size: 1rem;
}

.plan .start .what {
  color: var(--muted);
}

.plan .burn .what {
  color: var(--mark-burn);
}

.plan .when {
  text-align: right;
  white-space: nowrap;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.plan .start .when {
  color: var(--text);
  font-weight: 650;
}

.plan .when small {
  display: block;
  font-size: 0.82em;
  color: var(--faint);
}

/* Две цифры с подписями — вместо безымянных «таблеток». */
/* Строками во всю ширину: у цены для кожи две мерки, в половине экрана
   они переносились. */
.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 18px;
}

.facts[hidden],
.fact[hidden] {
  display: none;
}

.fact {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.uv-fact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 8px;
}

.fact-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.fact-value {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 1rem;
  font-weight: 700;
}

/* «для этого дня — низкая» / «по общей мерке — высокая»: подпись слева,
   оценка справа, обе строки одного веса. */
.price-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.price-line b {
  color: var(--text);
  font-weight: 700;
}

.price-line:empty {
  display: none;
}

.fact-sub {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}

.fact-sub:empty {
  display: none;
}

/* Квадратик цвета ВОЗ — тот же, что на холме и в легенде UV. */
.swatch {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--line);
}

.hero-hint {
  background: var(--surface-2);
}

/* ---------- быстрые переключатели ---------- */

.quick {
  display: grid;
  gap: 10px;
}

/* Подпись над кнопками, а не слева: тогда кнопкам хватает всей ширины,
   и на узком телефоне ничего не уезжает за край. */
.quick-row {
  display: grid;
  gap: 6px;
}

#skin-chips {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#skin-chips .chip {
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

.chips.tight {
  margin-top: 0;
  gap: 6px;
}

.chips.tight .chip {
  padding: 7px 11px;
  font-size: 0.88rem;
}

/* Четыре варианта крема — в одну строку и на узком телефоне. */
#spf-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#spf-chips .chip {
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  white-space: nowrap;
}

.quick-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.quick-note:empty {
  display: none;
}

/* ---------- холм и легенда UV ---------- */

/* Подложка лучшего времени — нейтральная, не зелёная: зелёный на холме
   уже означает «низкий UV». */
#hill-best {
  fill: var(--text);
  opacity: 0.07;
}

/* Легенда: что значат цвета холма. Цвета — ровно те же, что на холме. */
.uv-legend {
  display: grid;
  grid-template-columns: auto repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 3px;
  margin-top: 16px;
  font-size: 0.72rem;
  color: var(--muted);
}

.uv-legend .caption {
  padding-right: 4px;
  align-self: center;
}

.uv-legend .step {
  display: grid;
  gap: 3px;
  text-align: center;
}

.uv-legend .step i {
  display: block;
  height: 6px;
  border-radius: 3px;
}

.uv-legend .step.today {
  color: var(--text);
  font-weight: 700;
}

#hill-mid {
  color: var(--faint);
}

/* ---------- подробнее ---------- */

.more {
  display: grid;
  gap: 4px;
}

.more details {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.more details:last-of-type {
  border-bottom: none;
}

.more summary {
  cursor: pointer;
  font-weight: 600;
}

.more details p {
  margin: 8px 0 2px;
  font-size: 0.92rem;
  color: var(--muted);
}

.more-links {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.dot-sep {
  color: var(--faint);
  margin: 0 6px;
}

.wide-button.as-link {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

/* Время в «лучшем времени» — обычным цветом текста: зелёный на этой
   странице означает только «низкий UV». */
.best .best-value {
  color: var(--text);
}
