/* ============================================================
   Учебный центр — оформление
   Два контекста: рабочий кабинет (плотный, «инструмент») и
   публичный сайт (тёплый, витрина). Общая типографика и токены.
   ============================================================ */

:root {
  --bg: #f5f6fa;
  --bg-2: #eef0f7;
  --card: #ffffff;
  --text: #14171f;
  --text-2: #3c4353;
  --muted: #6d7484;
  --line: #e4e7ef;
  --line-2: #eef0f6;

  --primary: #4353e0;
  --primary-d: #2f3cc2;
  --primary-l: #ebedff;
  --accent: #e39b3d;
  --accent-l: #fdf1e0;

  --ok: #0d8a66;
  --ok-l: #e2f5ee;
  --warn: #a2660a;
  --warn-l: #fdf0d8;
  --bad: #c33a2e;
  --bad-l: #fce9e6;

  --radius: 16px;
  --radius-s: 10px;
  --shadow-s: 0 1px 2px rgba(20, 23, 31, .04), 0 1px 3px rgba(20, 23, 31, .06);
  --shadow-m: 0 10px 30px -12px rgba(20, 23, 31, .18), 0 2px 8px rgba(20, 23, 31, .05);
  --shadow-l: 0 30px 70px -30px rgba(20, 23, 31, .35);

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Lora", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15.5px/1.55 var(--font);
  font-feature-settings: "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); text-decoration: none; }
h1, h2, h3 { letter-spacing: -.018em; color: var(--text); }
h1 { font-size: 1.85rem; font-weight: 800; margin: 0 0 .3rem; line-height: 1.18; }
h2 { font-size: 1.12rem; font-weight: 700; margin: 0 0 .85rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 26px 20px 72px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------- шапка кабинета */
.top {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.top-in { max-width: 1120px; margin: 0 auto; padding: 12px 20px 10px; }
.top-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.02rem;
  color: var(--text); letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--primary), #6f7bf0); color: #fff;
  font-size: .72rem; font-weight: 800; letter-spacing: 0; box-shadow: 0 3px 8px -2px rgba(67, 83, 224, .6); }
.top-search { flex: 0 1 280px; }
.top-search input {
  width: 100%; min-height: 38px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); transition: .18s;
}
.top-search input:focus { background: #fff; border-color: var(--primary); outline: none;
  box-shadow: 0 0 0 4px var(--primary-l); }
.top-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { color: var(--text-2); font-size: .88rem; font-weight: 600; text-align: right; line-height: 1.25; }
.who-role { display: block; font-size: .74rem; font-weight: 500; color: var(--muted); }
.logout { margin: 0; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600;
  font-size: .86rem; cursor: pointer; padding: 8px 12px; border-radius: 999px; transition: .15s; }
.link-btn:hover { background: var(--bg-2); color: var(--text); }

.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.nav a {
  padding: 7px 14px; border-radius: 999px; color: var(--text-2);
  font-weight: 600; font-size: .92rem; transition: .15s;
}
.nav a:hover { background: var(--bg-2); color: var(--text); }
.nav a.on { background: var(--primary); color: #fff; box-shadow: 0 6px 14px -8px rgba(67, 83, 224, .9); }
.subnav { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--line); font-size: .85rem; }
.subnav a { color: var(--muted); font-weight: 500; }
.subnav a:hover { color: var(--primary); }
.subnav a.on { color: var(--primary); font-weight: 700; }

/* ---------------------------------------------------- заголовки страниц */
.page-head { margin: 4px 0 20px; }
.page-head h1 { margin-bottom: .25rem; }
.page-head.row-between, .row-between { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.crumbs { margin: 6px 0 0; font-size: .9rem; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 22px; }

/* ---------------------------------------------------- кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 9px 18px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 650; font-size: .93rem; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-s); transition: transform .12s, box-shadow .18s, background .18s, border-color .18s;
}
.btn:hover { background: var(--bg); border-color: #d8dce8; color: var(--text); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-d) 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px -10px rgba(67, 83, 224, .85), 0 1px 2px rgba(20, 23, 31, .08);
}
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-l); }
.btn.danger { color: var(--bad); border-color: transparent; background: transparent; box-shadow: none; }
.btn.danger:hover { background: var(--bad-l); }
.btn.small { min-height: 34px; padding: 5px 13px; font-size: .86rem; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(67, 83, 224, .35); outline-offset: 2px;
}

/* ---------------------------------------------------- карточки */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 0 0 18px; box-shadow: var(--shadow-s);
}
.card.empty { text-align: center; color: var(--muted); padding: 40px 20px; background: linear-gradient(180deg, #fff, #fafbff); }
.center-card { max-width: 540px; margin: 56px auto; text-align: center; }
.cols { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 18px; }
.cols > .card { margin: 0; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

/* «что сделать сегодня» */
.card.today { border: 0; padding: 22px 22px 8px; background: linear-gradient(160deg, #f7f8ff 0%, #fff 55%);
  box-shadow: var(--shadow-m); position: relative; overflow: hidden; }
.card.today::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--primary), #8b95f5); }
.card.today h2 { font-size: 1.02rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.card.today ul.plain li { border-top: 1px dashed var(--line); padding: 13px 0; font-size: .98rem; }
.card.today ul.plain li:first-child { border-top: 0; padding-top: 4px; }
.card.today b { font-weight: 800; }

/* ---------------------------------------------------- статистика */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin-bottom: 20px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  display: flex; flex-direction: column; gap: 3px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  color: var(--text); box-shadow: var(--shadow-s); transition: transform .15s, box-shadow .2s, border-color .2s;
}
.stat:hover { text-decoration: none; border-color: #cdd3e6; transform: translateY(-2px); box-shadow: var(--shadow-m); }
.stat-n { font-size: 2.05rem; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: .9rem; font-weight: 500; }
.stat-s { color: var(--muted); font-size: .8rem; margin-top: 6px; }
.stat.accent { background: linear-gradient(150deg, #3b49d4 0%, #5566ee 55%, #7c88f5 100%);
  border-color: transparent; color: #fff; box-shadow: 0 18px 40px -22px rgba(59, 73, 212, .9); grid-column: span 2; }
.stat.accent .stat-l, .stat.accent .stat-s { color: #dfe4ff; }
@media (min-width: 900px) { .stat.accent { grid-column: span 1; } }

/* ---------------------------------------------------- списки, dl */
.big { font-size: 1.9rem; font-weight: 800; margin: 0 0 .4rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.big .muted { font-size: .95rem; font-weight: 500; letter-spacing: 0; }
.summary { margin: 0 0 14px; font-size: 1.05rem; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 12px 0; border-top: 1px solid var(--line-2); }
ul.plain li:first-child { border-top: 0; padding-top: 0; }
ul.plain li form { margin: 0; }
dl.info { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: .95rem; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; font-weight: 500; }
.note { background: var(--bg-2); border-radius: var(--radius-s); padding: 12px 14px; white-space: pre-wrap; margin: 14px 0 0; }

/* ---------------------------------------------------- флеши и бейджи */
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: 12px; margin: 0 0 16px;
  border: 1px solid; font-weight: 500; font-size: .94rem;
}
.flash.ok { background: var(--ok-l); border-color: #bfe8d9; color: #0a6047; }
.flash.error { background: var(--bad-l); border-color: #f3c9c4; color: #8f2a21; }
.flash.info { background: var(--primary-l); border-color: #ccd2ff; color: var(--primary-d); }

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .8rem;
  font-weight: 700; letter-spacing: .01em; margin: 2px 5px 2px 0; white-space: nowrap; }
.ok-b, .st-present.badge { background: var(--ok-l); color: var(--ok); }
.warn-b, .st-late.badge { background: var(--warn-l); color: var(--warn); }
.st-absent.badge { background: var(--bad-l); color: var(--bad); }
.muted-b { background: var(--bg-2); color: var(--muted); }
.badge.warn-b { background: var(--warn-l); color: var(--warn); }

/* ---------------------------------------------------- формы */
.form { display: grid; gap: 16px; max-width: 760px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-weight: 650; font-size: .88rem; color: var(--text-2); }
.req { color: var(--bad); }
input, select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid #d7dbe7;
  border-radius: 11px; padding: 10px 13px; min-height: 44px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #c3c9da; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none;
  box-shadow: 0 0 0 4px var(--primary-l); }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
.err { color: var(--bad); font-size: .86rem; font-weight: 500; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 20px; height: 20px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.inline-form select { flex: 1 1 220px; width: auto; }
.search { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 0 0 18px; }
.search input[type=search] { flex: 1 1 240px; width: auto; }
.search select, .search input[type=date], .search input[type=month] { width: auto; }
.inline-label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.tabs { display: flex; gap: 8px; margin: 0 0 18px; flex-wrap: wrap; }
.tabs a { padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--text-2); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-s); }
.tabs a.on { background: var(--primary); border-color: transparent; color: #fff; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.schedule { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfcff; }
.schedule legend { font-weight: 650; padding: 0 6px; color: var(--text-2); }
.sched-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; flex-wrap: wrap; }
.sched-row .check { min-width: 150px; font-weight: 500; }
.times { display: flex; align-items: center; gap: 8px; }
.times input { width: 130px; }

/* ---------------------------------------------------- вход */
.login-box { max-width: 420px; margin: 8vh auto 0; padding: 28px; }
.login-box h1 { font-size: 1.5rem; }
.login-box .form { max-width: none; }

/* ---------------------------------------------------- таблицы */
.table-wrap {
  overflow-x: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin: 0 0 14px; box-shadow: var(--shadow-s);
}
.card .table-wrap { border: 0; border-radius: 0; margin: 0; box-shadow: none; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 13px 16px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line-2); }
.tbl thead th {
  border-top: 0; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); background: #fafbff; white-space: nowrap;
}
.tbl tbody tr:hover { background: #fafbff; }
.tbl tbody tr.archived { opacity: .6; }
.tbl td.actions { white-space: nowrap; text-align: right; }
.tbl td.actions form { display: inline; margin: 0; }
.tbl .c { text-align: center; }
.tbl td b { font-weight: 700; }
.journal th.sticky, .journal td.sticky { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 170px; }
.journal td.c, .journal th.c { min-width: 52px; }
.mark { display: inline-block; min-width: 30px; padding: 3px 7px; border-radius: 8px; font-weight: 800; text-align: center; font-size: .86rem; }
.mark.st-present { background: var(--ok-l); color: var(--ok); }
.mark.st-late { background: var(--warn-l); color: var(--warn); }
.mark.st-absent { background: var(--bad-l); color: var(--bad); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .9rem; }
.month-now { padding: 0 8px; }

/* ---------------------------------------------------- посещаемость */
.att-list { display: grid; gap: 10px; margin-bottom: 16px; }
.att-row { padding: 12px 0; border-top: 1px solid var(--line-2); }
.att-row:first-child { border-top: 0; }
.att-name { font-weight: 700; }
.att-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 760px) { .att-row { grid-template-columns: 1fr auto; align-items: center; } }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg-opt { position: relative; display: block; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg-opt span {
  display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 12px;
  text-align: center; border: 1px solid #d7dbe7; border-radius: 11px; background: #fff;
  font-size: .92rem; font-weight: 600; transition: .15s;
}
.seg-opt:hover span { border-color: #b9c0d6; }
.seg-opt.st-present input:checked + span { background: var(--ok-l); border-color: var(--ok); color: var(--ok); }
.seg-opt.st-late input:checked + span { background: var(--warn-l); border-color: var(--warn); color: var(--warn); }
.seg-opt.st-absent input:checked + span { background: var(--bad-l); border-color: var(--bad); color: var(--bad); }
.seg-opt input:focus-visible + span { outline: 3px solid rgba(67, 83, 224, .35); outline-offset: 2px; }

/* ---------------------------------------------------- долги */
.debt-sum { color: var(--bad); font-size: 1.06rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tbl tr.paid { background: #fbfefc; }
details.remind { display: inline-block; }
details.remind > summary { list-style: none; cursor: pointer; }
details.remind > summary::-webkit-details-marker { display: none; }
details.remind[open] > summary { background: var(--primary-l); border-color: transparent; color: var(--primary-d); }
.remind-box {
  margin-top: 10px; background: #fbfcff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; max-width: 430px; text-align: left; white-space: normal;
}
.remind-text { margin: 0 0 10px; font-size: .9rem; color: var(--text-2); }

/* ---------------------------------------------------- публичный сайт */
body.public { background: #fdfbf7; color: var(--text); }
.pub-top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(253, 251, 247, .82); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid #ece6da;
}
.pub-top-in { max-width: 1120px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pub-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem;
  color: var(--text); letter-spacing: -.02em; }
.pub-brand:hover { color: var(--text); }
.pub-brand .pub-dot { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, #4353e0, #7c88f5); color: #fff; font-size: .72rem; font-weight: 800;
  box-shadow: 0 6px 14px -6px rgba(67, 83, 224, .8); }
.pub-nav { display: flex; gap: 22px; margin-left: auto; }
.pub-nav a { color: var(--text-2); font-weight: 600; font-size: .94rem; }
.pub-nav a:hover { color: var(--primary); }
.pub-wrap { max-width: 1120px; margin: 0 auto; padding: 46px 20px; }
.pub-wrap + .pub-wrap { padding-top: 22px; }
.pub-wrap h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.95rem; letter-spacing: -.01em;
  margin: 0 0 22px; }
.pub-kicker { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 14px; }

.pub-hero { position: relative; overflow: hidden; border-bottom: 1px solid #efeadf;
  background: radial-gradient(900px 480px at 88% -10%, #e7eaff 0%, rgba(231, 234, 255, 0) 62%),
              radial-gradient(720px 420px at 4% 110%, #fdeed8 0%, rgba(253, 238, 216, 0) 60%),
              linear-gradient(180deg, #fdfbf7 0%, #fbf8f2 100%); }
.pub-hero .pub-wrap { padding: 76px 20px 68px; position: relative; }
.pub-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: 3.15rem; line-height: 1.06;
  letter-spacing: -.025em; margin: 0 0 18px; max-width: 820px; }
.pub-lead { font-size: 1.22rem; color: var(--text-2); margin: 0 0 14px; max-width: 720px; }
.pub-about { color: var(--muted); max-width: 680px; font-size: 1.02rem; }
.pub-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.pub-actions .btn { min-height: 46px; padding: 12px 22px; border-radius: 14px; font-size: .98rem; }
.pub-facts { display: flex; gap: 34px; flex-wrap: wrap; margin-top: 44px; padding-top: 26px; border-top: 1px solid #eae4d8; }
.pub-fact b { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; }
.pub-fact span { color: var(--muted); font-size: .88rem; }

.pub-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.pub-card {
  position: relative; background: #fff; border: 1px solid #ece7dc; border-radius: 18px; padding: 22px;
  box-shadow: 0 1px 2px rgba(20, 23, 31, .03); transition: transform .16s, box-shadow .2s, border-color .2s;
}
.pub-card:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -26px rgba(20, 23, 31, .35); border-color: #ddd6c8; }
.pub-card h3 { font-size: 1.06rem; margin: 0 0 8px; }
.pub-card p { color: var(--muted); font-size: .94rem; margin: 0; }
.pub-price { font-weight: 800; font-size: 1.02rem; margin: 16px 0 0 !important; color: var(--text) !important;
  display: inline-flex; align-items: baseline; gap: 6px; }
.pub-price span { color: var(--muted); font-weight: 500; font-size: .84rem; }

.pub-teacher { display: flex; gap: 14px; align-items: flex-start; }
.pub-avatar { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(150deg, #edefff, #dfe3ff); color: var(--primary-d);
  font-weight: 800; font-size: .95rem; letter-spacing: -.02em; }

.pub-form-card { background: #fff; border: 1px solid #ece7dc; border-radius: 22px; padding: 30px;
  box-shadow: 0 30px 70px -50px rgba(20, 23, 31, .5); }
.pub-form-card h2 { font-family: var(--font); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; margin: 0 0 6px; }
.pub-form-card .form { max-width: none; }

.pub-contacts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pub-contact { background: #fff; border: 1px solid #ece7dc; border-radius: 16px; padding: 18px 20px; }
.pub-contact b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.pub-contact span, .pub-contact a { font-size: 1.02rem; font-weight: 600; color: var(--text); }

.pub-footer { border-top: 1px solid #ece6da; background: #fbf9f4; }
.pub-footer .pub-top-in { justify-content: space-between; color: var(--muted); font-size: .9rem; padding: 26px 20px; }
.pub-footer a { color: var(--muted); }
.pub-footer a:hover { color: var(--primary); }
.pub-flash { max-width: 1120px; margin: 18px auto 0; }

/* ---------------------------------------------------- телефон */
@media (max-width: 760px) {
  .wrap { padding: 16px 14px 60px; }
  h1 { font-size: 1.5rem; }
  .top { position: static; }
  .nav { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 12px; font-size: .88rem; }
  .top-search { flex: 1 1 100%; order: 4; }
  .who { display: none; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px; }
  .stat-n { font-size: 1.55rem; }
  .stat-l { font-size: .8rem; }
  .stat.accent { grid-column: span 3; }
  .seg-opt span { font-size: .84rem; padding: 6px 2px; }
  .tbl:not(.journal) thead { display: none; }
  .tbl:not(.journal), .tbl:not(.journal) tbody, .tbl:not(.journal) tr, .tbl:not(.journal) td { display: block; width: 100%; }
  .tbl:not(.journal) tr { padding: 12px 14px; border-top: 1px solid var(--line-2); }
  .tbl:not(.journal) tr:first-child { border-top: 0; }
  .tbl:not(.journal) td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
  .tbl:not(.journal) td::before { content: attr(data-label); color: var(--muted); text-align: left; flex: 0 0 38%; font-weight: 600; }
  .tbl:not(.journal) td.actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; padding-top: 10px; }
  .tbl:not(.journal) td.actions::before { content: none; }
  .journal td[data-label]::before { content: none; }
  .btn-row .btn, .quick .btn { flex: 1 1 auto; }
  dl.info { grid-template-columns: 1fr; gap: 0; }
  dl.info dt { margin-top: 10px; font-size: .82rem; }
  .times input { width: 120px; }

  .pub-hero h1 { font-size: 2.1rem; }
  .pub-hero .pub-wrap { padding: 44px 18px 40px; }
  .pub-wrap { padding: 32px 18px; }
  .pub-wrap h2 { font-size: 1.55rem; }
  .pub-nav { width: 100%; margin-left: 0; gap: 16px; overflow-x: auto; white-space: nowrap; }
  .pub-facts { gap: 22px; }
  .pub-form-card { padding: 20px; }
}

/* ---- таблица долгов: колонки не должны разваливаться ---- */
.tbl.debts td, .tbl.debts th { vertical-align: top; }
.tbl.debts td:nth-child(1), .tbl.debts th:nth-child(1) { min-width: 190px; }
.tbl.debts td:nth-child(2), .tbl.debts th:nth-child(2) { min-width: 150px; }
.tbl.debts td:nth-child(3) { white-space: nowrap; }
.tbl.debts td:nth-child(4) { min-width: 130px; }
.tbl.debts td:nth-child(5) { min-width: 120px; }
.tbl { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .tbl.debts td:nth-child(n) { min-width: 0; white-space: normal; }
}

/* ---- первый экран: текст + ближайшие занятия ---- */
.pub-hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 52px; align-items: start; }
.pub-hero-grid .pub-facts { grid-column: 1 / -1; }
.pub-next { background: #fff; border: 1px solid #ece7dc; border-radius: 20px; padding: 22px 24px;
  box-shadow: 0 30px 60px -40px rgba(20, 23, 31, .45); }
.pub-next-label { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.pub-next-row { display: flex; gap: 14px; padding: 13px 0; border-top: 1px solid #f1ece1; }
.pub-next-row:first-of-type { border-top: 0; padding-top: 0; }
.pub-next-day { flex: 0 0 46px; text-align: center; font-size: .8rem; color: var(--muted); line-height: 1.25; }
.pub-next-day b { display: block; font-size: 1rem; color: var(--text); }
.pub-next-body { display: flex; flex-direction: column; gap: 3px; font-size: .92rem; }
.pub-next-body b { font-weight: 700; }
.pub-next-body span { color: var(--muted); font-size: .86rem; }
.pub-next-link { display: inline-block; margin-top: 14px; font-weight: 700; font-size: .9rem; }
@media (max-width: 900px) {
  .pub-hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .pub-next { max-width: 520px; }
}

/* ---- о центре, галерея, отзывы ---- */
.pub-about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.pub-photo { margin: 0; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -40px rgba(20, 23, 31, .45); }
.pub-photo img { display: block; width: 100%; height: 100%; max-height: 460px; object-fit: cover; }
.pub-about-text { color: var(--muted); font-size: 1.02rem; }
.pub-steps { list-style: none; margin: 22px 0; padding: 0; counter-reset: step; display: grid; gap: 14px; }
.pub-steps li { position: relative; padding-left: 46px; }
.pub-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 11px;
  display: grid; place-items: center; font-weight: 800; font-size: .92rem;
  background: var(--primary-l); color: var(--primary-d);
}
.pub-steps b { display: block; font-size: 1rem; }
.pub-steps span { color: var(--muted); font-size: .92rem; }

.pub-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pub-gallery figure { margin: 0; }
.pub-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 18px; box-shadow: 0 20px 40px -34px rgba(20, 23, 31, .5); }
.pub-gallery figcaption { margin-top: 10px; color: var(--muted); font-size: .88rem; }

.pub-review { display: flex; flex-direction: column; gap: 12px; }
.pub-stars { color: var(--accent); letter-spacing: 2px; font-size: 1rem; }
.pub-review-text { color: var(--text-2) !important; font-size: .97rem !important; margin: 0; flex: 1; }
.pub-review-author { display: flex; align-items: center; gap: 12px; padding-top: 6px; border-top: 1px solid #f1ece1; }
.pub-review-author .pub-avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; font-size: .85rem; }
.pub-review-author b { display: block; font-size: .92rem; }
.pub-review-author span { color: var(--muted); font-size: .82rem; }

@media (max-width: 900px) {
  .pub-about-grid { grid-template-columns: 1fr; gap: 26px; }
  .pub-gallery { grid-template-columns: 1fr; }
  .pub-photo img { max-height: 320px; }
}
