:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --bg-deep: #e7e1d4;
  --card: #fffdf8;
  --ink: #1c1915;
  --muted: #6e675d;
  --line: #e6dfd2;
  --accent: #2f6d4f;
  --accent-ink: #1b4a32;
  --accent-soft: #e5f3ea;
  --sunken: #efe8dc;
  --nav: rgba(255, 253, 248, 0.9);
  --shadow: 0 1px 2px rgba(48, 36, 16, 0.04), 0 10px 28px rgba(48, 36, 16, 0.06);
  --warn-bg: #fff3e4;
  --warn: #8a4e16;
  --lab: #1d5f86;
  --prac: #8d4e16;
  --danger: #8d2f2f;
  --rail: var(--accent);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141816;
    --bg-deep: #0d100e;
    --card: #1d2320;
    --ink: #f4f1ea;
    --muted: #b1b8b0;
    --line: #2d3530;
    --accent: #8ed4ae;
    --accent-ink: #d9f6e6;
    --accent-soft: #24362c;
    --sunken: #171c19;
    --nav: rgba(20, 24, 22, 0.9);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 14px 32px rgba(0, 0, 0, 0.28);
    --warn-bg: #3a2c1c;
    --warn: #f3c48a;
    --lab: #9fd0ee;
    --prac: #f0b27a;
    --danger: #f0b0b0;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 50% -80px, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    var(--bg-deep);
  color: var(--ink);
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }

.app {
  width: min(440px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  box-shadow: 0 0 0 1px var(--line);
}

@media (max-width: 480px) {
  body { background: var(--bg); }
  .app { width: 100%; box-shadow: none; }
}

.top {
  padding: calc(14px + env(safe-area-inset-top)) 18px 6px;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand {
  margin: 1px 0 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
}

.group-btn, .text-btn, .nav button, .primary, .ghost, .suggest button, .day-jump, .shift {
  border: 0;
}

.group-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 62%;
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-align: left;
}

.group-kicker {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.group-code {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.offline-flag, .progress {
  margin: 10px 0 0;
}

.offline-flag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 0.78rem;
  font-weight: 700;
}

.progress {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 45% 100%;
  animation: glide 1.1s ease-in-out infinite;
}

.hero { padding: 8px 18px 2px; }

.kicker {
  margin: 0;
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker.warn { color: var(--warn); }

.hero-date {
  margin: 4px 0 0;
  font-size: 2.45rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.hero-range {
  font-size: 1.28rem;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.weekday {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero .text-btn { margin-top: 12px; }

.lessons, .week { padding: 12px 16px 4px; }

.card, .empty, .date-card, .tip, .block, .suggest button {
  background: var(--card);
  box-shadow: var(--shadow);
}

.card {
  position: relative;
  margin: 0 0 10px;
  padding: 14px 16px 14px 18px;
  border-radius: 22px;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 99px 99px 0;
  background: var(--rail);
}

.card.лек { --rail: var(--accent); }
.card.лаб { --rail: var(--lab); }
.card.пр { --rail: var(--prac); }
.card.none { --rail: var(--muted); }
.card.now { background: var(--accent-soft); }
.card.past .time,
.card.past .subject { color: var(--muted); }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.time {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.time-sep { color: var(--muted); font-weight: 500; padding: 0 1px; }

.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chip.лек { background: var(--accent-soft); color: var(--accent-ink); }
.chip.лаб { background: color-mix(in srgb, var(--lab) 16%, var(--card)); color: var(--lab); }
.chip.пр { background: var(--warn-bg); color: var(--prac); }
.chip.now { background: var(--accent); color: var(--card); }
.chip.subgroup {
  background: transparent;
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 72%, var(--line));
}

.subject {
  margin: 10px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.28;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.meta-line a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.dot { opacity: 0.7; }

.empty {
  margin: 0 0 10px;
  padding: 22px 16px;
  border-radius: 22px;
  text-align: center;
  color: var(--muted);
}

.empty p { margin: 0; }
.empty-title {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.week section { margin: 0 0 18px; }
.week h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.98rem;
}
.day-jump {
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: left;
}
.week .empty { padding: 14px 16px; text-align: left; }
.week .empty-title { font-size: 0.95rem; }

.panel { padding: 8px 16px 8px; }

.date-card {
  margin-top: 6px;
  padding: 14px;
  border-radius: 22px;
}

.date-card-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.date-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.date-card-head strong {
  display: block;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.date-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
}

.shift {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sunken);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}

.date-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: var(--sunken);
}

.field-month { grid-column: 1 / -1; }

label.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

label.field input,
label.field select,
.search {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

label.field input { padding: 0 8px; text-align: center; }
label.field select {
  padding: 0 32px 0 12px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  font-weight: 650;
  text-align: left;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 19px, calc(100% - 9px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.date-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.primary, .ghost {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border-radius: 16px;
  font-weight: 700;
}

.primary { background: var(--accent); color: #f7fff9; }
.ghost, .text-btn {
  background: var(--card);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.text-btn {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 700;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.status-row .text-btn { flex: none; box-shadow: none; background: var(--sunken); }

.tip {
  margin: 12px 16px;
  padding: 14px;
  border-radius: 22px;
  font-size: 0.92rem;
}

.tip p { margin: 0 0 8px; line-height: 1.4; }

.update-banner {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 6;
  width: min(408px, calc(100% - 24px));
  max-height: calc(100dvh - 140px);
  overflow-y: auto;
  padding: 14px 14px 12px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow), inset 0 0 0 2px var(--accent);
}

.update-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
}

.update-date, .update-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.update-note { color: var(--ink); margin-top: 8px; }

.update-changes {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.update-changes li + li { margin-top: 4px; }

.update-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.update-actions .primary, .update-actions .ghost {
  flex: 1;
  width: auto;
  margin: 0;
  min-height: 42px;
}

.update-actions .primary[disabled] { opacity: 0.7; }

.nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--nav);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 5;
}

.nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.nav button svg { width: 22px; height: 22px; }
.nav button[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(16, 18, 16, 0.46);
}

.sheet-card {
  width: min(440px, 100%);
  max-height: min(88dvh, 760px);
  overflow: auto;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--bg);
}

.grabber {
  width: 42px;
  height: 5px;
  margin: 4px auto 12px;
  border-radius: 99px;
  background: var(--line);
}

.sheet h2 { margin: 0 0 4px; font-size: 1.45rem; letter-spacing: -0.04em; }
.sheet .lead { margin: 0 0 14px; color: var(--muted); line-height: 1.4; }

.search::placeholder { color: var(--muted); font-weight: 600; }

.search {
  height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  font-weight: 700;
}

.suggest { list-style: none; margin: 12px 0 0; padding: 0; }
.suggest button {
  width: 100%;
  min-height: 52px;
  margin-bottom: 8px;
  padding: 0 14px;
  border-radius: 16px;
  text-align: left;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.suggest .status { padding: 8px 2px 0; }

.more { padding: 8px 16px 16px; }
.more h1 {
  margin: 8px 0 12px;
  font-size: 2rem;
  letter-spacing: -0.045em;
}
.block {
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 22px;
}
.block h2 { margin: 0 0 8px; font-size: 1.05rem; letter-spacing: -0.03em; }
.block p, .block li { line-height: 1.45; }
.block p { margin: 0 0 8px; }
.block ol { margin: 0 0 8px; padding-left: 1.15rem; }
.block label.field { margin-top: 8px; }
.block label.field input { text-align: left; padding: 0 12px; font-weight: 650; }
.schedule-seg { margin: 8px 16px 0; }
.subgroup-wrap { margin: 10px 16px 0; }
.subgroup-kicker {
  margin: 0 2px 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.seg { display: flex; gap: 8px; margin: 8px 0 4px; }
.subgroup-wrap .seg { margin: 0; }
.seg button {
  flex: 1;
  min-height: 42px;
  border-radius: 14px;
  background: var(--sunken);
  font-weight: 700;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: #f7fff9; }
.student-name {
  margin: 2px 0 8px;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.student-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.summary .student-name { font-size: 1.15rem; }
.att-screen { padding-left: 0; padding-right: 0; }
.att-screen .block { margin-left: 16px; margin-right: 16px; }
.summary {
  margin: 0 16px 12px;
  padding: 16px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.summary-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.summary-percent {
  margin: 0;
  font-size: 2.8rem;
  font-weight: 750;
  letter-spacing: -0.05em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}
.summary-caption { margin: 4px 0 0; color: var(--muted); font-weight: 700; }
.summary-empty { margin: 0; font-size: 1.2rem; font-weight: 700; }
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.summary-grid div {
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--sunken);
}
.summary-grid strong { display: block; font-size: 1.2rem; letter-spacing: -0.03em; }
.summary-grid span { color: var(--muted); font-size: 0.78rem; }
.formula { margin: 12px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.list-title {
  margin: 4px 16px 8px;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}
.att-screen > .status { margin-left: 16px; margin-right: 16px; }
.att-screen > .skeleton { margin-left: 16px; margin-right: 16px; }
.att-list { padding: 0 16px 8px; }
.att-day { margin: 0 0 12px; }
.att-day h3 { margin: 0 0 8px; font-size: 0.95rem; }
.att-card {
  position: relative;
  margin: 0 0 8px;
  padding: 12px 12px 12px 16px;
  border-radius: 16px;
  background: var(--sunken);
  overflow: hidden;
}
.att-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 99px 99px 0;
  background: var(--accent);
}
.att-card.abs::before { background: var(--danger); }
.att-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.att-top h3 { margin: 0; font-size: 1rem; letter-spacing: -0.03em; }
.mark { flex: none; font-size: 0.78rem; font-weight: 800; color: var(--muted); }
.mark.abs { color: var(--danger); }
.mark.ok { color: var(--accent-ink); }
.soon {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.skeleton {
  height: 92px;
  background: linear-gradient(90deg, var(--card), var(--sunken), var(--card));
  background-size: 200% 100%;
  animation: glide 1.2s ease-in-out infinite;
}
.skeleton::before { display: none; }

.boot {
  padding: 28px 18px;
  color: var(--muted);
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 2px;
}

@keyframes glide {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@media (prefers-color-scheme: dark) {
  .primary { color: #102117; }
  .chip.now { color: #102117; }
  .seg button[aria-pressed="true"] { color: #102117; }
}

@media (prefers-reduced-motion: reduce) {
  .progress, .skeleton { animation: none; }
}

/* Преподаватели (v15) */
.nav { grid-template-columns: repeat(4, 1fr); }
.nav button { font-size: 0.58rem; letter-spacing: -0.01em; }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.teacher-screen .block { padding-bottom: 8px; }
.teacher-search .ghost { width: 100%; margin-top: 4px; }
.teacher-source { padding: 0 4px; color: var(--muted); font-size: 0.85rem; }
.suggest .suggest-head {
  margin: 10px 2px 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.suggest .star { float: right; color: var(--prac); }
.teacher-hero .teacher-name { font-size: clamp(1.7rem, 8vw, 2.3rem); }
.teacher-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.teacher-actions .text-btn { margin-top: 0; width: auto; display: inline-flex; align-items: center; }
.teacher-week-nav { margin: 10px 16px 14px; }
.teacher-week-nav > .text-btn { margin-top: 8px; }
.teacher-week { padding: 0 16px; }
.teacher-week .past-day { opacity: 0.62; }

/* Свободные аудитории и «Поделиться картинкой» (v16) */
.tool-block .primary { margin-top: 4px; }
.rooms-screen h1 { margin-bottom: 4px; }
.rooms-note { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 8px -16px 4px;
  padding: 2px 16px 8px;
  scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll button {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 48px;
  padding: 6px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  font: inherit;
  font-weight: 750;
  font-size: 0.9rem;
}
.chip-scroll button small { color: var(--muted); font-size: 0.72rem; font-weight: 650; }
.chip-scroll button[aria-pressed="true"] { background: var(--accent); color: #f7fff9; }
.chip-scroll button[aria-pressed="true"] small { color: #d7efe0; }
.rooms-date { margin: 6px 0 4px; }
.rooms-pair-time { margin: 2px 2px 10px; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.progress.inline { position: static; margin: 0 0 10px; }
.rooms-head { margin: 8px 2px 8px; font-size: 1.05rem; letter-spacing: -0.02em; }
.room-list { list-style: none; margin: 0; padding: 0; }
.room-row {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 0;
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  font: inherit;
  text-align: left;
}
.room-row.busy { border-left-color: var(--prac); }
.room-row.unknown { border-left-color: var(--muted); }
.room-name { flex: none; font-weight: 800; }
.room-hint { color: var(--muted); font-size: 0.85rem; text-align: right; }
.room-row.busy { flex-direction: column; align-items: flex-start; gap: 2px; }
.room-row.busy .room-hint { text-align: left; }
.room-busy { margin: 10px 0; }
.room-busy summary { padding: 10px 2px; font-weight: 800; cursor: pointer; }
.room-day { max-height: 52vh; overflow-y: auto; margin: 0 0 8px; }
.link-ghost { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.share-btn { margin-top: 6px; }
.share-card { max-height: 92vh; overflow-y: auto; }
.share-preview { margin: 10px 0; text-align: center; }
.share-preview img {
  width: 100%;
  max-height: 46vh;
  object-fit: contain;
  object-position: top;
  border-radius: 16px;
  box-shadow: var(--shadow);
  background: var(--bg);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 4px; }
.hero-actions .text-btn { width: auto; }
.share-link::before { content: "↗ "; }
.share-link.icon-only::before { content: "↗"; font-size: 1.1rem; }
.share-link.icon-only { min-width: 48px; justify-content: center; }

/* ===== v17: умное управление и уведомления ===== */
/* Крупнее зоны нажатия */
.text-btn { min-height: 44px; }
.link-btn { padding: 6px 2px; margin: -6px 0; }
.meta-line a { display: inline-block; padding: 6px 0; margin: -6px 0; }
.seg button { min-height: 44px; }
.shift { min-width: 48px; min-height: 48px; }

/* Дата в заголовке — кнопка быстрого выбора */
.date-tap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  text-align: left;
}
.date-tap-icon { font-size: 0.5em; color: var(--muted); transform: translateY(2px); }
.quick-date { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.hero { position: relative; }

/* Сейчас / следующая пара */
.now-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.now-line::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); flex: none; }
.now-line::after { content: ""; flex: 1; height: 2px; background: var(--danger); opacity: 0.55; border-radius: 2px; }
.now-line.done { color: var(--muted); }
.now-line.done::before, .now-line.done::after { background: var(--muted); }
.card.next { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.chip.next-chip { background: var(--accent-soft); color: var(--accent-ink); }
.card-progress {
  position: absolute;
  left: 18px;
  right: 16px;
  bottom: 8px;
  height: 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  overflow: hidden;
}
.card-progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--accent); border-radius: 4px; }
.card.now { padding-bottom: 22px; }
.card[data-press] { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

/* Плавающая кнопка «Сегодня» над нижней панелью */
.fab {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #f7fff9;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(20, 50, 35, 0.28);
  animation: fab-in 0.18s ease-out;
}
@keyframes fab-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* Свайп: короткая анимация въезда */
main.slide-left { animation: slide-l 0.2s ease-out; }
main.slide-right { animation: slide-r 0.2s ease-out; }
@keyframes slide-l { from { opacity: 0.4; transform: translateX(28px); } }
@keyframes slide-r { from { opacity: 0.4; transform: translateX(-28px); } }

/* Потянуть вниз — обновить */
.ptr {
  white-space: nowrap;
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 750;
  opacity: 0;
  transform: translate(-50%, calc(var(--pull, 0px) - 48px));
  transition: opacity 0.15s;
  pointer-events: none;
}
.ptr.visible { opacity: 1; }
.ptr.ready { color: var(--accent); }
.ptr.ready .ptr-dot { transform: rotate(180deg); }
.ptr-dot { display: inline-block; transition: transform 0.15s; }

/* Быстрые действия */
.action-list { display: grid; gap: 8px; margin: 12px 0; }
.action-list button, .action-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--sunken);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

/* Уведомления */
.notify-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notify-head h2 { margin: 0; }
.switch {
  position: relative;
  flex: none;
  width: 58px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.15s;
}
.switch span {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] span { transform: translateX(24px); }
.switch:disabled { opacity: 0.5; }
.field-label { margin: 12px 0 0; color: var(--muted); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.seg-wrap { flex-wrap: wrap; }
.seg-wrap button { flex: 1 1 0; min-width: 52px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 10px 0 6px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
}
.check-box {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--accent);
  color: #fff;
  font-size: 0.85rem;
}
.check-row[aria-checked="true"] .check-box { background: var(--accent); }
.notify-warn { padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-weight: 650; }
.notify-hint { padding: 10px 12px; border-radius: 12px; background: var(--sunken); color: var(--muted); font-size: 0.9rem; }
.notify-note { margin: 8px 0; }
.diag { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 12px 0; font-size: 0.86rem; }
.diag dt { color: var(--muted); }
.diag dd { margin: 0; font-weight: 650; word-break: break-word; }
.tips summary { min-height: 44px; display: flex; align-items: center; font-weight: 800; cursor: pointer; color: var(--accent-ink); }
.tips ol { padding-left: 20px; font-size: 0.9rem; line-height: 1.45; }
.tips li { margin-bottom: 6px; }
.ptr.busy { opacity: 1; color: var(--accent); }
.ptr.busy .ptr-dot { animation: ptr-spin 0.8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
