:root {
  --bg: #fff5fa;
  --surface: #ffffff;
  --text: #24182f;
  --muted: #534266;
  --line: #f3d4e6;
  --accent: #ff4f9a;
  --yellow: #ffe14d;
  --ink: #24182f;
  --shadow: 0 16px 40px rgba(180, 60, 120, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: #d12378; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #ffd0e6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: white;
  color: black;
  padding: 8px 12px;
  z-index: 50;
}
.skip:focus { top: 12px; }

.site-header, .cabinet-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.logo {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  font-size: 18px;
  color: var(--accent);
}
.nav-links, .nav-side, .side-links { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.nav-links { flex: 1; }
.nav-links a, .side-links a, .nav-side a:not(.btn) {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
}
.nav-links a[aria-current="page"], .side-links a[aria-current="page"], .cabinet-header a[aria-current="page"] {
  color: #b01268;
  background: #ffe4f2;
}
.nav-side form { margin: 0; }
.dot {
  display: inline-grid;
  place-items: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 12px;
}

.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(680px, 100%); }
main { padding-bottom: 64px; }

h1, h2, h3 { font-family: "Nunito", sans-serif; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 2.6vw, 2.15rem) !important; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 1.4rem; margin: 0 0 14px; line-height: 1.3; }
h3 { font-size: 1.1rem; margin: 0 0 8px; }
.eyebrow {
  margin: 0 0 8px;
  color: #b01268;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 800;
}
.lede { max-width: 40rem; color: var(--muted); }
.muted { color: var(--muted); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.85fr);
  gap: 28px;
  align-items: center;
  padding: 28px 0 8px;
}
.hero-photo {
  width: 100%;
  border-radius: 28px;
  display: block;
  box-shadow: var(--shadow);
}
.hero-card {
  background: white;
  border-radius: 28px;
  padding: 28px;
  border: 1px solid var(--line);
}
.hero-actions, .inline-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 12px 18px;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}
.btn-primary, button.btn.btn-primary { background: var(--yellow); color: #3a2460; }
.btn-ghost, button.btn.btn-ghost { border-color: #f3b6d4; color: var(--ink); background: white; }
.btn-small { padding: 8px 14px; font-size: 15px; }
.btn-dark, button.btn.btn-dark { background: var(--accent); color: white; }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-weight: 700; }
.who { font-weight: 800; color: var(--ink); }
.hw-modal {
  width: min(440px, calc(100% - 32px));
  border: 0;
  border-radius: 20px;
  padding: 22px;
  color: var(--text);
}
.hw-modal::backdrop { background: rgba(36, 24, 47, 0.45); }
.hw-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.family-note {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
}
.login-switch { display: flex; gap: 8px; margin: 16px 0; }
.login-switch a {
  text-decoration: none;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}
.login-switch a[aria-current="page"] { background: var(--accent); color: white; border-color: transparent; }

.section { padding: 28px 0; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 20px;
  background: white;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}
.quick-card span { color: var(--muted); font-weight: 600; }

.poster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.poster-block {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px 10px;
}
.place {
  display: block;
  margin: 0 0 6px;
  padding: 8px 12px;
  background: #d7ebff;
  border-radius: 12px;
  color: #1c2744;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.3;
}
.paper.branch-drop { padding: 0; background: #fff; }
.branch-drop summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 16px 18px;
  background: #fff;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.branch-drop summary::-webkit-details-marker { display: none; }
.branch-drop summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.35s ease;
}
.branch-drop details[open] summary::after { transform: rotate(45deg); }
.branch-drop .branch-times { padding: 0 18px 14px; background: #fff; }
.sched-day, .sched-line { margin: 0; color: var(--text); }
.sched-day {
  margin-top: 14px;
  font-size: 1.05rem;
  font-weight: 800;
}
.sched-line {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 7px 2px;
  border-bottom: 1px solid #f3e4ee;
  font-size: 1.05rem;
}
.sched-line time { font-weight: 800; font-variant-numeric: tabular-nums; }

.paper, .banner, .flash, .ticket {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
}
.paper, .ticket { padding: 18px; }
.banner, .flash { padding: 14px 16px; margin: 12px 0; }
.banner { background: #fff8dc; }
.flash-ok { background: #eefbf3; }
.flash-bad { background: #fff0f4; }
.form-error { color: #d12378; font-weight: 800; }
.stack { display: grid; gap: 12px; }
.remain-num {
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 4.5rem);
  line-height: 0.95;
  margin: 6px 0;
  color: var(--accent);
}

.form { display: grid; gap: 14px; max-width: 720px; }
.field { display: grid; gap: 6px; }
.field span, .check { font-size: 0.95rem; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.file-name { color: var(--muted); font-size: 14px; font-weight: 600; }
.hp { position: absolute; left: -9999px; }
.requisites { white-space: pre-wrap; margin: 8px 0 0; font-family: "Nunito", sans-serif; }
.list { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.note { padding: 14px 0; border-top: 1px solid var(--line); }
.note p { white-space: pre-line; }
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
  background: #fff3c4;
  color: #6a4b10;
}
.badge-ok { background: #e5f8ec; color: #146b32; }
.badge-no { background: #ffe4ea; color: #9d2048; }
.badge-muted { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.week { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.day {
  min-height: 0;
  padding: 14px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
}
.day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.day h3 { font-size: 1rem; color: var(--ink); }
.class-card {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7fb;
  border-left: 4px solid #8ebfee;
  font-size: 1rem;
  line-height: 1.4;
}
.class-card.mine { border-left-color: var(--accent); }
.class-card.cancelled { opacity: 0.55; text-decoration: line-through; }
.class-card time { font-weight: 800; }
.pager { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 8px 0 16px; }
.branch-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.branch-strip a, .price-row, .branch-row {
  border-top: 1px solid var(--line);
}
.branch-strip a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  background: white;
}
.branch-strip a[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.price-row, .branch-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1fr;
  gap: 10px;
  padding: 12px 0;
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  background: white;
}
summary { cursor: pointer; font-weight: 800; }
.faq-list { display: grid; gap: 10px; max-width: 820px; }
.faq-item {
  background: #7464c4;
  color: white;
  border-radius: 16px;
}
.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.faq-q::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.35s ease;
}
.faq-item.is-open .faq-q::after { transform: rotate(45deg); }
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}
.faq-item.is-open .faq-panel { grid-template-rows: 1fr; }
.faq-panel-inner { overflow: hidden; min-height: 0; }
.faq-answer {
  margin: 0;
  padding: 0 18px 16px;
  white-space: pre-line;
  line-height: 1.55;
}

.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; background: #fff8fc; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 20px 16px;
  background: white;
  border-right: 1px solid var(--line);
}
.side-label { color: var(--accent); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 800; }
.side-links { display: grid; gap: 8px; margin: 14px 0 22px; }
.side-out { color: var(--muted); font-weight: 700; text-decoration: none; }
.sidebar form { margin-top: 12px; }
.admin-main { padding: 24px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  padding: 16px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}
.stat b { display: block; font-size: 1.8rem; color: var(--accent); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.95rem; color: var(--text); }

@media (max-width: 900px) {
  .hero, .quick, .admin-shell, .price-row, .branch-row { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .side-links { display: flex; }
  .week { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .site-header, .cabinet-header { padding: 12px; }
  .form-row, .poster, .week { grid-template-columns: 1fr; }
}
.pay-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 12px;
  padding: 14px 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.pay-line p { margin: 0; }
.modal {
  border: 0;
  border-radius: 22px;
  padding: 22px;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(36, 24, 47, 0.35); }
.cookie-bar {
  display: none;
  position: fixed;
  z-index: 30;
  left: 16px;
  right: 16px;
  bottom: 16px;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.cookie-bar.is-on { display: flex; }
.cookie-bar p { margin: 0; color: var(--muted); font-size: 0.95rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .faq-panel, .faq-q::after { transition: none; }
}
