:root {
  color-scheme: light;
  --ink: #172b3a;
  --muted: #667887;
  --paper: #f3f7fa;
  --surface: #ffffff;
  --line: #d9e3ea;
  --soft-line: #eaf0f4;
  --day-title: #f3f7fa;
  --blue: #176b87;
  --blue-soft: rgba(23, 107, 135, 0.12);
  --blue-dark: #104a62;
  --yellow: #f2bd5b;
  --yellow-hover: #ffd27f;
  --accent-ink: #173244;
  --red: #b64742;
  --intro-copy: #435766;
  --homework-bg: var(--surface);
  --homework-text: var(--ink);
  --homework-muted: var(--muted);
  --card-tint: var(--day-title);
  --card-line: var(--line);
  --window-bg: #fff3d8;
  --window-ink: #76551e;
  --window-line: rgba(118, 85, 30, 0.3);
  --homework-input-bg: var(--surface);
  --homework-input-text: var(--ink);
  --status-text: var(--muted);
  --status-error: var(--red);
  --status-success: var(--blue-dark);
  --task-delete: var(--red);
  --task-delete-hover: var(--red);
  --h1-a: #172b3a;
  --h1-b: #176b87;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e5f0f5;
  --muted: #9eb2be;
  --paper: #0c1720;
  --surface: #142631;
  --line: #2a3e49;
  --soft-line: #20343f;
  --day-title: #182c37;
  --blue: #75cbe4;
  --blue-soft: rgba(117, 203, 228, 0.15);
  --blue-dark: #9de0f0;
  --yellow: #f3c66b;
  --yellow-hover: #ffdc91;
  --accent-ink: #20323c;
  --red: #ff9388;
  --intro-copy: #bdd0da;
  --homework-bg: var(--surface);
  --homework-text: var(--ink);
  --homework-muted: var(--muted);
  --card-tint: var(--day-title);
  --card-line: var(--line);
  --window-bg: #3e3523;
  --window-ink: #ffdea0;
  --window-line: rgba(255, 222, 160, 0.3);
  --homework-input-bg: var(--surface);
  --homework-input-text: var(--ink);
  --status-text: var(--muted);
  --status-error: var(--red);
  --status-success: var(--blue-dark);
  --h1-a: #e5f0f5;
  --h1-b: #75cbe4;
}

:root[data-season="halloween"] { --blue: #ff7518; --blue-soft: rgba(255, 117, 24, 0.16); --blue-dark: #c8520a; --yellow: #8a4bd2; --red: #8a4bd2; --h1-a: #ff7518; --h1-b: #8a4bd2; }
:root[data-season="halloween"][data-theme="dark"] { --blue: #ffa24d; --blue-soft: rgba(255, 162, 77, 0.18); --blue-dark: #ffbe80; --yellow: #b98cf0; --red: #b98cf0; --h1-a: #ffab52; --h1-b: #b98cf0; }
:root[data-season="newyear"] { --blue: #1f8fbf; --blue-soft: rgba(31, 143, 191, 0.15); --blue-dark: #12698c; --yellow: #f2c14e; --red: #d1495b; --h1-a: #1f8fbf; --h1-b: #2fbf9f; }
:root[data-season="newyear"][data-theme="dark"] { --blue: #6cc4e8; --blue-soft: rgba(108, 196, 232, 0.16); --blue-dark: #a6dded; --yellow: #f4d58a; --red: #ff8a95; --h1-a: #6cc4e8; --h1-b: #5fd6b5; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  transition: background-color 180ms ease, color 180ms ease;
}

button, input, textarea, select { font: inherit; }

button, a, select { -webkit-tap-highlight-color: transparent; }

button { cursor: pointer; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(244, 187, 81, 0.85);
  outline-offset: 3px;
}

.page-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.site-name {
  grid-column: 2;
  color: var(--ink);
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  letter-spacing: -0.05em;
}

.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.topbar-actions > * { flex-shrink: 0; white-space: nowrap; }
.topbar p, .muted { margin: 0; color: var(--muted); font-size: 14px; }

.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 750;
}

.theme-toggle:hover { border-color: var(--blue); color: var(--blue); }

.intro {
  position: relative;
  padding: clamp(52px, 9vw, 112px) 0 clamp(42px, 6vw, 74px);
  max-width: 900px;
}

.intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -40px;
  left: -60px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--blue-soft) 0%, transparent 62%);
  filter: blur(30px);
  opacity: .55;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.067em;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .intro h1 {
    background-image: linear-gradient(120deg, var(--h1-a), var(--h1-b));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.intro-copy {
  max-width: 660px;
  margin: 24px 0 0;
  color: var(--intro-copy);
  font-size: 18px;
  line-height: 1.58;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 800;
}

.tab-button:hover { border-color: var(--blue); color: var(--blue); }

.tab-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.content-grid { display: block; }

.panel[hidden] { display: none; }

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.07);
}

.schedule-panel, .homework-panel { padding: 28px; }
.feature-panel { padding: 28px; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading h2 { margin: 0; font-size: 29px; letter-spacing: -0.045em; }
.section-heading .eyebrow { margin-bottom: 7px; }

.schedule-source {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.schedule-source .text-button { color: var(--blue); }
.schedule-source .text-button:hover { color: var(--blue-dark); }

#schedule-note {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.week-controls {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 9px;
}

.week-arrow {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.week-arrow:hover { border-color: var(--blue); color: var(--blue); }

.week-current {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 780;
  text-align: center;
}

.parity-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0;
}

.parity-switch button, .week-option {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.parity-switch button {
  border-radius: 10px;
  padding: 9px 11px;
}

.parity-switch button[aria-pressed="true"], .week-option[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.week-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 20px;
}

.week-option {
  min-height: 42px;
  border-radius: 10px;
  padding: 7px 9px;
  text-align: left;
  line-height: 1.25;
}

.week-option:hover, .parity-switch button:hover { border-color: var(--blue); color: var(--blue); }
.week-option[aria-pressed="true"]:hover,
.parity-switch button[aria-pressed="true"]:hover { color: #fff; }

.schedule-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
}

.alternate-dot {
  width: 8px;
  height: 8px;
  border: 2px solid var(--blue);
  border-radius: 50%;
}

.window-dot {
  width: 10px;
  height: 10px;
  margin-left: 5px;
  border-radius: 3px;
  background: var(--window-bg);
  box-shadow: inset 0 0 0 1px rgba(120, 80, 23, 0.22);
}

.schedule-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 11px;
  min-height: 260px;
  align-content: start;
}

/* Сводка «что сдать на неделе» */
.week-summary {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--day-title);
}
.summary-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.summary-title { font-size: 12px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.summary-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 850; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; transition: border-color .15s, background .15s, transform .12s; }
.summary-chip:hover { border-color: var(--blue); transform: translateY(-1px); }
.summary-chip .summary-num { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: 12px; font-weight: 850; }
.summary-chip.urgent { border-color: var(--red); }
.summary-chip.urgent .summary-num { background: var(--red); color: #fff; }

.day-flash { animation: dayFlash 1.2s ease; }
@keyframes dayFlash {
  0% { box-shadow: 0 0 0 0 var(--blue); }
  30% { box-shadow: 0 0 0 3px var(--blue); }
  100% { box-shadow: 0 4px 16px rgba(23, 43, 58, 0.06); }
}

.day-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(23, 43, 58, 0.06);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  animation: cardIn .34s ease backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.day-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(23, 43, 58, 0.12);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.day-today {
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px var(--yellow);
}

.today-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.day-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--day-title);
}

.day-title h3 { margin: 0; font-size: 15px; letter-spacing: -0.015em; }
.day-title span { color: var(--muted); font-size: 12px; text-align: right; }

.class-list { list-style: none; margin: 0; padding: 0; }

.class-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 13px 14px;
  border-bottom: 1px solid var(--soft-line);
}

.class-item:last-child { border-bottom: 0; }
.class-item { transition: background .14s ease; }
.class-item:hover { background: var(--day-title); }
.class-time { display: grid; justify-items: start; gap: 2px; color: var(--blue-dark); font-size: 12px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.class-time-end { color: var(--muted); font-size: 11px; font-weight: 650; }
.class-info { min-width: 0; }
.class-name { margin: 0; font-size: 14px; font-weight: 720; line-height: 1.3; }
.class-meta { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }

.alternate-badge {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border: 2px solid var(--blue);
  border-radius: 50%;
}

.class-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.class-actions .alternate-badge { margin-top: 0; }

.add-homework-button {
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.add-homework-button:hover,
.add-homework-button[aria-expanded="true"] {
  border-color: var(--blue);
  border-style: solid;
  color: var(--blue);
}

.inline-homework-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.inline-lead { margin: 0; color: var(--muted); font-size: 12px; font-weight: 750; }

.inline-field { display: grid; gap: 6px; }
.inline-field span { color: var(--muted); font-size: 12px; font-weight: 750; }

.inline-field textarea, .inline-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  font-size: 14px;
}

.inline-field textarea { resize: vertical; min-height: 70px; }

.inline-field textarea:focus, .inline-field input:focus { border-color: var(--blue); outline: 0; }

.inline-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.inline-footer .primary-button { padding: 9px 15px; font-size: 13px; }

.inline-footer .inline-cancel {
  width: auto;
  margin-top: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 9px 15px;
  font-size: 13px;
}

.inline-footer .inline-cancel:hover {
  border-color: var(--blue);
  background: transparent;
  color: var(--blue);
}

.inline-status { min-height: 16px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.inline-status.error { color: var(--red); }

.window-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-bottom: 1px dashed var(--line);
  background: var(--window-bg);
  color: var(--window-ink);
  font-size: 12px;
  font-weight: 700;
}

.window-badge {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.day-empty { padding: 14px; color: var(--muted); font-size: 13px; }

.class-homework { display: grid; gap: 5px; margin-top: 9px; }

.homework-chip {
  display: inline-block;
  padding: 6px 9px;
  border: 1px dashed var(--window-line);
  border-radius: 8px;
  background: var(--window-bg);
  color: var(--window-ink);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}

.class-homework-loose {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 14px;
  border-top: 1px dashed var(--line);
}

.class-homework-loose .class-homework { flex: 1; margin-top: 0; }

.homework-chip-badge {
  flex: 0 0 auto;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--accent-ink);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.homework-panel { background: var(--homework-bg); color: var(--homework-text); }
.homework-panel .eyebrow { color: var(--blue); }
.homework-panel .muted { color: var(--homework-muted); }

.homework-range { margin: -7px 0 18px; color: var(--homework-muted); font-size: 13px; line-height: 1.45; }

.homework-toolbar { max-width: 820px; margin: 12px 0 4px; }

.filter-label { display: flex; align-items: center; gap: 10px; }
.filter-label span { color: var(--homework-muted); font-size: 12px; font-weight: 750; }
.filter-label select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--card-line);
  border-radius: 9px;
  background: var(--homework-input-bg);
  color: var(--homework-input-text);
  padding: 9px 11px;
  font-size: 13px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: 750;
}
.text-button:hover { color: var(--blue-dark); }

.homework-form {
  display: grid;
  gap: 15px;
  max-width: 820px;
  padding: 18px;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--card-tint);
}

.homework-form label { display: grid; gap: 7px; }
.homework-form label span { font-size: 13px; font-weight: 700; }
.homework-form em { color: var(--homework-muted); font-style: normal; font-weight: 500; }

.homework-form input, .homework-form textarea, .homework-form select {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--homework-input-bg);
  color: var(--homework-input-text);
  padding: 11px 12px;
}

.homework-form textarea { resize: vertical; min-height: 95px; }
.homework-form input:focus, .homework-form textarea:focus, .homework-form select:focus { border-color: var(--yellow); outline: 0; }

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-note { max-width: 245px; margin: 0; color: var(--homework-muted); font-size: 11px; line-height: 1.4; }

.primary-button, .secondary-button {
  border: 0;
  border-radius: 10px;
  padding: 11px 15px;
  font-weight: 800;
}
.primary-button { background: var(--yellow); color: var(--accent-ink); }
.primary-button:hover { background: var(--yellow-hover); }
.primary-button:disabled { cursor: not-allowed; opacity: 0.65; }

.status-message { min-height: 20px; margin: 14px 0 2px; color: var(--status-text); font-size: 13px; line-height: 1.4; }
.status-message.error { color: var(--status-error); }
.status-message.success { color: var(--status-success); }

.homework-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.empty-state, .list-label { grid-column: 1 / -1; }
.empty-state { padding: 22px 8px; color: var(--homework-muted); line-height: 1.5; text-align: center; }
.list-label { margin: 14px 0 1px; color: var(--homework-muted); font-size: 12px; font-weight: 800; }

.homework-item {
  padding: 15px;
  border: 1px solid var(--card-line);
  border-radius: 13px;
  background: var(--card-tint);
}

.task-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-subject { margin: 0; color: var(--blue-dark); font-size: 13px; font-weight: 800; }
.task-date { flex: 0 0 auto; color: var(--homework-muted); font-size: 12px; }

.task-subject-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.task-subject-line .task-subject { margin: 0; }

.task-countdown {
  padding: 2px 8px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  color: var(--homework-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.task-countdown.urgent { border-color: var(--red); color: var(--red); }

.task-actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 9px; }
.task-actions .text-button { padding: 0; font-size: 12px; }
.task-delete { color: var(--task-delete); }
.task-delete:hover { color: var(--task-delete-hover); }

.task-link { color: var(--blue-dark); overflow-wrap: anywhere; }
.task-details { margin: 9px 0 0; color: var(--homework-text); font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.task-created { margin: 10px 0 0; color: var(--homework-muted); font-size: 11px; }

.secondary-button { display: block; width: 100%; margin-top: 12px; background: transparent; border: 1px solid var(--line); color: var(--homework-text); }
.secondary-button:hover { background: var(--day-title); }
.hidden { display: none !important; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
  padding: 20px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p { margin: 0; }
.site-footer strong { color: var(--ink); font-weight: 750; }
.footer-meta { display: grid; gap: 4px; }
.support-plate { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--day-title); color: var(--ink); font-size: 13px; font-weight: 750; text-decoration: none; white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.support-plate::before { content: "♥"; color: var(--red); font-size: 14px; }
.support-plate:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.support-plate:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.support-qr { display: grid; place-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.support-qr img { display: block; width: min(62vw, 250px); height: auto; }
.support-link { text-align: center; text-decoration: none; display: block; padding: 11px 14px; }
.support-url { margin: 0; text-align: center; color: var(--muted); font-size: 12px; word-break: break-all; }
.newyear-count { flex: 1 1 auto; margin: 0; text-align: center; font-size: 15px; font-weight: 750; color: var(--ink); }
.newyear-count b { font-variant-numeric: tabular-nums; color: var(--blue-dark); font-size: 18px; }

.feature-copy { margin: -8px 0 18px; color: var(--muted); line-height: 1.5; }
.feature-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--day-title);
}
.feature-form.hidden { display: none; }
.feature-form label { display: grid; gap: 7px; min-width: 0; }
.feature-form label span { font-size: 13px; font-weight: 750; }
.feature-form em { color: var(--muted); font-style: normal; font-weight: 500; }
.feature-form input, .feature-form textarea, .feature-form select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 11px;
}
.feature-form textarea { resize: vertical; }
.feature-form-wide, .feature-form-actions { grid-column: 1 / -1; }
.feature-form-actions { display: flex; align-items: center; gap: 14px; }
.feature-form-actions .text-button { color: var(--muted); }
.feature-status { min-height: 0; margin: 8px 0; color: var(--muted); font-size: 13px; }
.feature-status.success { color: var(--blue-dark); }
.feature-status.error { color: var(--red); }
.feature-empty { margin: 0; padding: 20px 12px; color: var(--muted); text-align: center; line-height: 1.5; }

/* Canvas-оверлей для сезонных эффектов */
#fx-layer { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; pointer-events: none; }

/* Парящие праздничные украшения */
#decor-layer { position: fixed; inset: 0; z-index: 52; pointer-events: none; overflow: hidden; }
.decor {
  position: absolute;
  font-size: var(--s, 32px);
  line-height: 1;
  opacity: .82;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .18));
  animation: decorFloat 6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes decorFloat {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-12px) rotate(calc(var(--r, 0deg) * -1)); }
}

@media (max-width: 620px) {
  .decor { opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
  #decor-layer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .day-card { animation: none; }
  .day-card, .class-item { transition: none; }
  html { scroll-behavior: auto; }
}

.material-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.materials-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 9px; }
.feature-item-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.feature-item-actions { display: flex; justify-content: flex-end; gap: 14px; margin-top: 10px; }
.feature-item-actions .text-button { padding: 0; color: var(--muted); font-size: 12px; }
.feature-item-actions .feature-delete { color: var(--red); }
.materials-toolbar { max-width: 540px; margin: 16px 0; }
.materials-subject-heading { grid-column: 1 / -1; margin: 16px 0 0; font-size: 17px; }
.materials-subject-heading:first-child { margin-top: 0; }
.material-title { color: var(--blue-dark); font-size: 15px; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.material-title:hover { color: var(--blue); }
.material-card .feature-item-actions { margin-top: 12px; }

.account-dialog {
  position: relative;
  width: min(100% - 32px, 440px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}
.account-dialog::backdrop { background: rgba(8, 22, 30, 0.58); }
.account-form { display: grid; gap: 14px; }
.account-form form { display: grid; gap: 10px; }
.account-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
.account-form input, .account-form select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px; background: var(--surface); color: var(--ink); }
.account-form .text-button { justify-self: start; padding: 0; }
.feature-item-heading { padding-right: 44px; }
.dialog-close { position: absolute; top: 14px; right: 14px; justify-self: unset; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--day-title); color: var(--ink); font-size: 24px; line-height: 1; font-weight: 400; transition: background .15s, color .15s, border-color .15s; }
.dialog-close:hover { background: var(--red); border-color: var(--red); color: #fff; }
.dialog-close:focus-visible { outline: 3px solid rgba(244, 187, 81, 0.85); outline-offset: 2px; }
.search-results { display: grid; gap: 10px; max-height: 46vh; overflow: auto; }
.search-results h3 { margin: 8px 0 0; font-size: 14px; }
.search-result { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--day-title); }
.search-result p { margin: 5px 0 0; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.admin-users { display: grid; gap: 8px; max-height: 36vh; overflow: auto; }
.admin-user { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.admin-user > span:first-child { margin-right: auto; }
.admin-user select { padding: 6px; font-size: 12px; }
.admin-user .text-button { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; white-space: nowrap; }
.danger-button { color: var(--red); border-color: var(--red); }
.danger-button:hover { background: var(--red); color: var(--surface); }
.banned-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--red); color: var(--surface); font-size: 11px; font-weight: 700; }
.feedback-item { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--day-title); display: grid; gap: 6px; }
.feedback-item.is-done { opacity: 0.62; }
.feedback-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.feedback-kind { font-size: 12px; font-weight: 800; padding: 1px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); }
.feedback-kind.complaint { background: rgba(182, 71, 66, 0.14); color: var(--red); }
.feedback-author { color: var(--muted); font-size: 11px; }
.feedback-message { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-contact { margin: 0; color: var(--muted); font-size: 12px; }
.feedback-item .text-button { justify-self: start; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }

@media (max-width: 620px) {
  .page-shell { width: min(100% - 28px, 1280px); padding-top: 14px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding-bottom: 16px; }
  .brand { grid-column: 1; grid-row: 1; }
  .site-name { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .topbar-actions { grid-column: 2; grid-row: 1; align-items: flex-end; flex-direction: column; gap: 8px; }
  .topbar-actions > * { white-space: normal; }
  #account-button { text-align: right; max-width: 46vw; }
  .intro { padding: 45px 0; }
  h1 { font-size: clamp(37px, 12vw, 54px); }
  .intro-copy { font-size: 16px; }
  .schedule-panel, .homework-panel, .feature-panel { padding: 20px; border-radius: 18px; }
  .section-heading { align-items: flex-start; }
  .section-heading .muted { display: none; }
  .schedule-source { align-items: flex-start; }
  #schedule-note { max-width: none; text-align: left; }
  .tab-button { padding: 10px 17px; }
  .feature-form { grid-template-columns: 1fr; padding: 14px; }
  .feature-form-wide, .feature-form-actions { grid-column: auto; }
  .feature-form-actions { align-items: stretch; flex-direction: column; }
  .materials-list { grid-template-columns: 1fr; }
  .week-options { grid-template-columns: 1fr; }
  .day-title { align-items: flex-start; flex-direction: column; gap: 3px; }
  .day-title span { text-align: left; }
  .class-item { grid-template-columns: 48px minmax(0, 1fr) auto; padding: 12px; }
  .window-item { align-items: flex-start; flex-direction: column; gap: 5px; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-note { max-width: none; }
  .primary-button { width: 100%; }
  .tab-bar { gap: 6px; }
  .tab-button { flex: 1 1 0; min-width: 0; padding: 12px 8px; font-size: 13px; text-align: center; }
  .theme-toggle, .parity-switch button, .week-option { min-height: 44px; }
  .week-arrow { width: 44px; height: 44px; }
  .week-controls { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .text-button { min-height: 40px; }
  .account-form input, .account-form select, .account-form textarea,
  .homework-form input, .homework-form textarea, .homework-form select,
  .feature-form input, .feature-form textarea, .feature-form select,
  .filter-label select, .inline-field input, .inline-field textarea { font-size: 16px; }
  .account-dialog { width: calc(100% - 24px); }
  .dialog-close { top: 10px; right: 10px; width: 44px; height: 44px; }
  .feature-item-heading { padding-right: 50px; }
  .page-shell { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
}

@media (max-width: 400px) {
  .tab-button { padding: 12px 4px; font-size: 12px; }
  .week-current { padding: 11px 8px; font-size: 13px; }
  .schedule-panel, .homework-panel, .feature-panel { padding: 16px; }
}
