/* «Сегодня» — макеты WebToday (компьютер) и WebTodayPhone (телефон). */

.today-phone { display: none; }
.today-desk { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; container: today / inline-size; }
@media (max-width: 899px) {
  .today-desk { display: none; }
  .today-phone { display: flex; flex-direction: column; }
}

/* ---------- Шапка ---------- */

.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.today-titles { display: flex; flex-direction: column; gap: 4px; }
.today-titles h1 { margin: 0; font-family: var(--heading); font-size: 38px; line-height: 46px; font-weight: 600; letter-spacing: -0.8px; }
.today-sub { font-size: 15px; line-height: 20px; color: var(--text2); }
.week-nav { display: flex; align-items: center; gap: 10px; }
.week-title { min-width: 230px; text-align: center; display: flex; flex-direction: column; }
.week-title > span:first-child { font-size: 15px; line-height: 20px; font-weight: 600; }
.week-range { font-size: 13px; line-height: 18px; color: var(--text2); }
.round-button {
  flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 20px;
  display: grid; place-items: center; background: var(--surface); color: var(--text); cursor: pointer;
}
.round-button .icon { width: 18px; height: 18px; vertical-align: 0; }
.pill-button {
  height: 40px; padding: 0 16px; border: 0; border-radius: 20px;
  background: var(--accent); color: #0B1120; font-size: 14px; font-weight: 600; cursor: pointer;
}
.pill-button.soft { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-pale); }
.text-button { padding: 0; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--accent-soft); cursor: pointer; }

.today-body { display: grid; gap: 24px; align-items: start; }
.week-section { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 4px; }
.today-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; align-items: start; }
.today-side > * { min-width: 0; }

/* Карточки встают справа, когда помещаются все семь дней с колонкой времени. */
@container today (min-width: 1140px) {
  .today-body { grid-template-columns: minmax(0, 1fr) 340px; }
  .today-side { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Неделя сеткой ---------- */

.week-grid { display: grid; grid-template-columns: 68px repeat(var(--days, 6), minmax(92px, 1fr)); gap: 8px; }
.grid-day { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.grid-wd { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text2); }
.grid-num {
  min-width: 32px; height: 28px; padding: 0 6px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--heading); font-size: 16px; font-weight: 600; color: var(--text);
}
.grid-day.past .grid-num { color: var(--text2); }
.grid-day.today .grid-wd { color: var(--accent-soft); }
.grid-day.today .grid-num { background: var(--accent); color: #0B1120; }
.grid-slot { padding: 10px 4px 0 0; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.grid-pair { font-size: 13px; line-height: 18px; font-weight: 600; }
.grid-start { font-size: 12px; line-height: 16px; color: var(--text2); }
.grid-end { font-size: 12px; line-height: 16px; color: var(--text3); }
.grid-cell {
  min-height: 104px; padding: 10px; border: 0; border-radius: 16px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); color: var(--text); text-align: left; font: inherit;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: background-color 250ms ease;
}
button.grid-cell { cursor: pointer; }
button.grid-cell:hover { background: color-mix(in srgb, var(--surface) 92%, #FFFFFF); }
.grid-cell.past { opacity: 0.55; }
.grid-cell.empty {
  align-items: center; justify-content: center;
  background: rgba(157, 170, 196, 0.04); color: var(--text3); font-size: 13px;
}
.cell-title {
  font-size: 13px; line-height: 17px; font-weight: 600;
  hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cell-meta { font-size: 12px; line-height: 16px; color: var(--text2); overflow-wrap: anywhere; }
.cell-tag {
  margin-top: auto; align-self: flex-start; min-height: 20px; padding: 3px 8px; border-radius: 10px;
  display: flex; align-items: center; font-size: 11px; line-height: 14px; font-weight: 700;
}
.grid-cell.tone-now { background: var(--accent); }
button.grid-cell.tone-now:hover { background: var(--accent); }
.tone-now .cell-title { color: #0B1120; }
.tone-now .cell-meta { color: rgba(11, 17, 32, 0.72); }
.tone-now .cell-tag { background: rgba(11, 17, 32, 0.14); color: #0B1120; }
.grid-cell.tone-cancel { background: color-mix(in srgb, var(--cancel) 7%, transparent); }
.tone-cancel .cell-title, .tone-cancel .pair-title { color: var(--text2); text-decoration: line-through; }
.tone-cancel .cell-tag, .tone-cancel .pair-tag { background: color-mix(in srgb, var(--cancel) 16%, transparent); color: var(--cancel); }
.grid-cell.tone-warn { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 55%, transparent); }
.tone-warn .cell-tag, .tone-warn .pair-tag { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }

/* ---------- Карточки справа и под днём ---------- */

.side-card { border-radius: 22px; background: var(--surface); padding: 18px 20px; display: flex; flex-direction: column; color: inherit; }
.now-card { gap: 4px; }
.kicker { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--accent-soft); }
.kicker.muted { color: var(--text2); }
.now-title { font-family: var(--heading); font-size: 19px; line-height: 24px; font-weight: 600; }
.now-line { font-size: 14px; line-height: 20px; color: var(--text2); }
.side-card .divider { margin: 10px 0 6px; height: 1px; background: var(--line); }
.after-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; line-height: 20px; }
.after-title { font-weight: 500; }
.after-time { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.after-line { font-size: 13px; line-height: 18px; color: var(--text2); }

.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.side-head h2 { margin: 0; font-family: var(--heading); font-size: 19px; line-height: 24px; font-weight: 600; letter-spacing: -0.2px; }
.side-head > span { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text2); }
.side-card:has(.changes) { padding-bottom: 10px; }
.side-card:has(.homework-list) { padding-bottom: 6px; }
.changes { margin-top: 6px; }
.change { padding: 10px 0; display: flex; gap: 12px; align-items: flex-start; }
.change + .change { border-top: 1px solid var(--line); }
.change-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 4px; flex-shrink: 0; background: var(--accent-soft); }
.change-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 20px; }
.change-title { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--accent-soft); }
.change.tone-cancel .change-dot { background: var(--cancel); }
.change.tone-cancel .change-title { color: var(--cancel); }
.change.tone-warn .change-dot { background: var(--warn); }
.change.tone-warn .change-title { color: var(--warn); }

.homework-list { margin-top: 2px; }
.hw-row {
  width: 100%; padding: 12px 0; border: 0; border-radius: 0; background: none;
  display: flex; gap: 12px; align-items: flex-start;
  color: var(--text); text-align: left; font: inherit; cursor: pointer;
}
.hw-row + .hw-row { border-top: 1px solid var(--line); }
.hw-row:hover { background: rgba(255, 255, 255, 0.04); }
.hw-check {
  width: 22px; height: 22px; margin-top: 1px; flex-shrink: 0; border-radius: 11px;
  border: 1.5px solid var(--text2); display: grid; place-items: center; color: #0B1120;
  transition: background-color 200ms ease;
}
.hw-check .icon { width: 14px; height: 14px; vertical-align: 0; opacity: 0; }
.hw-row.done .hw-check { background: var(--accent); border-color: var(--accent); }
.hw-row.done .hw-check .icon { opacity: 1; }
.hw-text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hw-title { font-size: 15px; line-height: 20px; font-weight: 500; }
.hw-row.done .hw-title { text-decoration: line-through; }
.hw-sub { font-size: 13px; line-height: 18px; color: var(--text2); overflow-wrap: anywhere; }
.hw-due { flex-shrink: 0; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--text2); }
.hw-due.near { color: var(--accent-soft); }

.exam-card { flex-direction: row; align-items: center; gap: 16px; text-decoration: none; }
.exam-card:hover { text-decoration: none; background: color-mix(in srgb, var(--surface) 94%, #FFFFFF); }
.exam-days {
  width: 64px; height: 64px; flex-shrink: 0; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn);
  font-size: 12px; line-height: 16px;
}
.exam-num { font-family: var(--heading); font-size: 26px; line-height: 28px; font-weight: 600; }
.exam-text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.exam-title { font-size: 15px; line-height: 20px; font-weight: 600; }
.exam-meta { font-size: 13px; line-height: 18px; color: var(--text2); }
.exam-chevron { color: var(--text2); display: flex; }
.exam-chevron .icon { width: 16px; height: 16px; }

/* ---------- Телефон ---------- */

.phone-title { margin: 4px 0 0; font-family: var(--heading); font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.5px; }
.phone-sub { margin-top: 2px; font-size: 15px; line-height: 20px; color: var(--text2); }
.day-tiles { margin-top: 14px; display: grid; grid-template-columns: repeat(var(--count, 6), minmax(0, 1fr)); gap: 6px; }
.day-tile {
  height: 58px; padding: 0; border: 0; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  transition: background-color 200ms ease;
}
.tile-wd { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text2); }
.tile-num { font-family: var(--heading); font-size: 17px; line-height: 20px; font-weight: 600; }
.day-tile.today .tile-wd { color: var(--accent-soft); }
.day-tile.pressed { background: var(--accent); color: #0B1120; }
.day-tile.pressed .tile-wd { color: #0B1120; }

.day-card { margin-top: 16px; padding: 10px 20px 6px; border-radius: 22px; background: var(--surface); display: flex; flex-direction: column; }
.day-card-head {
  min-height: 32px; display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text2);
}
.pair-row {
  width: 100%; padding: 12px 0; border: 0; background: none;
  display: flex; gap: 14px; text-align: left; color: var(--text); font: inherit;
}
button.pair-row { cursor: pointer; }
.pair-row + .pair-row { border-top: 1px solid var(--line); }
.pair-row.past { opacity: 0.55; }
.pair-time { width: 50px; flex-shrink: 0; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.pair-time strong { font-family: var(--heading); font-size: 16px; line-height: 20px; font-weight: 600; }
.pair-time span { font-size: 13px; line-height: 18px; color: var(--text2); }
.pair-info { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pair-num { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text2); }
.pair-title { font-size: 16px; line-height: 21px; font-weight: 600; overflow-wrap: anywhere; }
.pair-meta { font-size: 14px; line-height: 19px; color: var(--text2); }
.pair-tag {
  margin-top: 4px; align-self: flex-start; height: 22px; padding: 0 9px; border-radius: 11px;
  display: flex; align-items: center; font-size: 12px; font-weight: 700;
}
.tone-live .pair-tag { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-pale); }
.phone-cards { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.phone-cards:empty { display: none; }
.checked-note { margin: 14px 4px 0; font-size: 13px; line-height: 18px; color: var(--text2); }

/* ---------- До сентября ---------- */

.summer {
  flex: 1 1 auto; min-width: 0; padding: 28px; border-radius: 22px; background: var(--surface);
  display: flex; flex-direction: column; gap: 10px;
}
.today-phone .summer { margin-top: 16px; padding: 22px 20px; }
.summer-top { display: flex; align-items: baseline; gap: 10px; }
.summer-num { font-family: var(--heading); font-size: 56px; line-height: 60px; font-weight: 600; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.summer-caption { font-size: 17px; line-height: 22px; color: var(--text2); }
.summer-title { margin: 6px 0 0; font-family: var(--heading); font-size: 22px; line-height: 28px; font-weight: 600; }
.summer-text { margin: 0; max-width: 560px; font-size: 15px; line-height: 21px; color: var(--text-soft); }
.summer .pill-button { align-self: flex-start; margin-top: 8px; }
.summer-line { position: relative; height: 22px; margin-top: 18px; }
.summer-track, .summer-fill { position: absolute; left: 0; top: 8px; height: 6px; border-radius: 3px; }
.summer-track { right: 0; background: var(--raised); }
.summer-fill { background: var(--accent); }
.summer-mark, .summer-now { position: absolute; top: 3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 8px; }
.summer-mark { background: var(--warn); box-shadow: 0 0 0 3px var(--surface); }
.summer-now { background: var(--text); box-shadow: 0 0 0 3px var(--surface); }
.summer-legend { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; line-height: 18px; color: var(--text2); white-space: nowrap; }
.summer-expect { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--warn); }
.summer-dot { width: 8px; height: 8px; flex: none; border-radius: 4px; background: var(--warn); }
