/* Компоненты кабинета. Цвета — только через переменные из theme.css */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 16px; line-height: 1.55;
  color: var(--text); background: var(--page-bg); background-color: #E3E3EF;
}
html { background-color: #E3E3EF; }
.only-mobile { display: none !important; }
a { color: var(--eva-blue-deep); }
a:hover { color: var(--eva-coral-deep); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--text-muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--eva-blue-deep); outline-offset: 2px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- Шапка (как на сайте) ---------- */
.top { padding: 18px 0 10px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.logo img { height: 74px; width: auto; }
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.circle-btn {
  width: 46px; height: 46px; border-radius: 50%; background: var(--eva-blue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; border: 0; text-decoration: none;
}
.circle-btn:hover { background: var(--eva-blue-deep); color: #fff; }
.circle-btn svg { width: 22px; height: 22px; }
.phone { display: flex; flex-direction: column; align-items: flex-end; text-decoration: none; color: var(--text); }
.phone b { font-size: 19px; font-weight: 700; }
.phone span { color: var(--eva-coral-deep); font-weight: 600; font-size: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 5px; background: var(--surface); border-radius: var(--radius-pill); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--eva-coral-soft); color: var(--eva-coral-deep);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: none; }
.user-chip .name { font-weight: 600; font-size: 15px; }
.link-btn { background: none; border: 0; padding: 8px 12px; font: inherit; font-size: 14px; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-pill); min-height: 38px; }
.link-btn:hover { color: var(--eva-coral-deep); background: var(--surface-alt); }

/* ---------- Меню-«таблетка» (как на сайте) ---------- */
.menu { margin-top: 14px; display: flex; gap: 4px; background: var(--surface-alt); border-radius: var(--radius-pill); padding: 5px;
  overflow-x: auto; scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
.menu a {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--radius-pill);
  text-decoration: none; color: var(--text); font-size: 17px; font-weight: 500; white-space: nowrap;
}
.menu a:hover { background: #fff; color: var(--text); }
.menu a.active { background: var(--eva-blue); color: #fff; font-weight: 600; }
.menu .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--eva-coral); color: #fff;
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

main { padding: 28px 0 60px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border-radius: var(--radius-card); padding: 26px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tile { background: var(--surface-alt); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 19px; }
.stat { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }

/* Плашка-бейдж, как «Более 600 семей…» */
.pill { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; background: rgba(255,255,255,.75);
  border-radius: var(--radius-pill); padding: 8px 18px; font-weight: 600; font-size: 15px; }

/* ---------- Герой «Обзор» ---------- */
.hero { position: relative; overflow: hidden; background: rgba(255,255,255,.55); border-radius: 28px; padding: 36px;
  display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between; }
.hero::after { content: ""; position: absolute; right: -90px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%;
  background: var(--hero-circle); opacity: .85; pointer-events: none; }
.hero-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.hero-text p { font-size: 18px; color: var(--text-muted); }
.week-card { position: relative; z-index: 1; background: #fff; border-radius: 20px; padding: 22px 26px; min-width: 230px;
  box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 2px; }
.week-card .stat { color: var(--eva-coral-deep); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 24px;
  border-radius: var(--radius-pill); border: 0; font: inherit; font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; }
.btn-cta { background: var(--eva-coral); color: #fff; padding: 6px 6px 6px 28px; min-height: 58px; font-size: 18px; }
.btn-cta .arrow { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--text); display: inline-flex;
  align-items: center; justify-content: center; flex: none; }
.btn-cta:hover { background: #D0687A; color: #fff; }
.btn-blue { background: var(--eva-blue); color: #fff; }
.btn-blue:hover { background: var(--eva-blue-deep); color: #fff; }
.btn-ghost { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--eva-blue); color: var(--text); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-danger { background: #fff; color: var(--eva-coral-deep); box-shadow: inset 0 0 0 1.5px var(--eva-coral-soft); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Статусы ---------- */
.badge { display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; white-space: nowrap; }
.tone-ok { background: var(--ok-bg); color: var(--ok-fg); }
.tone-wait { background: var(--wait-bg); color: var(--wait-fg); }
.tone-new { background: var(--new-bg); color: var(--new-fg); }
.tone-neutral { background: var(--neutral-bg); color: var(--neutral-fg); }

/* ---------- Этапы (полоса) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(104px, 1fr)); gap: 8px; }
.steps-scroll { overflow-x: auto; padding-bottom: 4px; }
.steps li { display: flex; flex-direction: column; gap: 8px; }
.steps .bar { height: 8px; border-radius: 4px; background: var(--line); }
.steps .done .bar { background: var(--eva-blue); }
.steps .current .bar { background: var(--eva-coral); }
.steps .lbl { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.steps .done .lbl { color: var(--eva-blue-deep); }
.steps .current .lbl { color: var(--eva-coral-deep); }
.steps .ttl { font-size: 14px; font-weight: 600; }
.steps .current .ttl { font-weight: 800; }
.steps .todo .ttl { color: var(--text-muted); }

/* ---------- Этапы (вертикально) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 18px; }
.timeline .rail { display: flex; flex-direction: column; align-items: center; }
.timeline .dot { width: 40px; height: 40px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; border: 2px solid var(--line); color: var(--text-muted); background: #fff; }
.timeline .done .dot { background: var(--eva-blue); border-color: var(--eva-blue); color: #fff; }
.timeline .current .dot { background: var(--eva-coral); border-color: var(--eva-coral); color: #fff; }
.timeline .line { width: 2px; flex: 1; min-height: 22px; background: var(--line); }
.timeline li:last-child .line { display: none; }
.timeline .body { padding: 6px 0 26px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Списки и таблицы ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .main { display: flex; flex-direction: column; min-width: 0; }
.row .main b { font-weight: 600; }
.event { display: flex; gap: 14px; align-items: center; }
.datebox { width: 60px; flex: none; border-radius: 16px; background: var(--eva-blue-soft); padding: 8px 0; display: flex;
  flex-direction: column; align-items: center; }
.datebox b { font-size: 22px; line-height: 1; color: var(--eva-blue-deep); }
.datebox span { font-size: 12px; color: var(--text-muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 620px; }
th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 14px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.right { text-align: right; }
.progress { height: 12px; border-radius: 6px; background: var(--surface-alt); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--eva-blue), var(--eva-coral)); border-radius: 6px; }
.empty { padding: 18px; text-align: center; color: var(--text-muted); background: var(--surface-alt); border-radius: 16px; }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number],
input[type=file], select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: #fff; border: 1.5px solid var(--line);
  border-radius: var(--radius-field); padding: 11px 14px; min-height: 48px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--eva-blue); outline: none; box-shadow: 0 0 0 3px var(--eva-blue-soft); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

/* ---------- Сообщения ---------- */
.flash { border-radius: 16px; padding: 14px 18px; font-weight: 600; }
.flash-ok { background: var(--ok-bg); color: var(--ok-fg); }
.flash-error { background: var(--wait-bg); color: var(--wait-fg); }

/* ---------- Чат ---------- */
.chat { padding: 0; gap: 0; overflow: hidden; }
.chat-head { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.chat-log { padding: 22px; display: flex; flex-direction: column; gap: 12px; height: min(58vh, 520px); overflow-y: auto; background: #FAFBFD; }
.msg { max-width: min(78%, 560px); padding: 12px 16px; border-radius: 20px; display: flex; flex-direction: column; gap: 4px;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.them { align-self: flex-start; background: #fff; box-shadow: inset 0 0 0 1px var(--line); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--eva-blue-soft); border-bottom-right-radius: 6px; }
.msg .meta { font-size: 12px; color: var(--text-muted); align-self: flex-end; }
.chat-form { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { min-height: 48px; height: 48px; flex: 1; }

/* ---------- Вход ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.login-page::before { content: ""; position: absolute; right: -200px; bottom: -260px; width: 680px; height: 680px; border-radius: 50%;
  background: var(--hero-circle); opacity: .7; }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 460px; background: #fff; border-radius: 28px; padding: 36px;
  box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 18px; }
.login-card .logo img { height: 86px; margin: 0 auto; }
.code-input { font-size: 28px !important; letter-spacing: .4em; text-align: center; font-weight: 700; }

/* ---------- Панель куратора ---------- */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.subtabs a { padding: 9px 16px; border-radius: var(--radius-pill); background: #fff; text-decoration: none; color: var(--text);
  font-weight: 600; font-size: 15px; min-height: 42px; display: inline-flex; align-items: center; }
.subtabs a.active { background: var(--eva-coral); color: #fff; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form select { min-height: 40px; padding: 6px 10px; font-size: 14px; width: auto; }

footer { padding: 20px 0 40px; font-size: 13px; color: var(--text-muted); }

@media (max-width: 640px) {
  .logo img { height: 52px; }
  .top-row { flex-wrap: nowrap; }
  .top-right { gap: 8px; flex-wrap: nowrap; }
  .phone { display: none; }
  .only-mobile { display: inline-flex !important; }
  .circle-btn { width: 42px; height: 42px; }
  .user-chip { padding: 3px; gap: 0; }
  .user-chip .name, .user-chip .avatar { display: none; }
  .link-btn { padding: 8px 10px; }
  .card { padding: 20px; }
  .hero { padding: 24px; }
  .hero::after { width: 260px; height: 260px; right: -120px; bottom: -140px; }
  .menu a { font-size: 15px; padding: 0 16px; min-height: 44px; }
  .btn-cta { font-size: 16px; }
  .msg { max-width: 88%; }
}

/* ---------- Обзор: карточка недели ---------- */
.week-link { text-decoration: none; color: var(--text); align-items: flex-start; }
.week-link:hover { color: var(--text); box-shadow: 0 8px 30px rgba(63, 90, 140, .16); }
.row-link { text-decoration: none; color: var(--text); border-radius: 12px; }
.row-link:hover { color: var(--text); background: var(--surface-alt); }
.circle-light { background: #fff; color: var(--text); }
.circle-light:hover { background: var(--eva-blue-soft); color: var(--text); }

/* ---------- Календарь беременности ---------- */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.week-title { text-align: center; display: flex; flex-direction: column; }
.week-body { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.week-pic { flex: 1 1 240px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: linear-gradient(160deg, var(--eva-blue-soft), var(--eva-coral-soft)); border-radius: 24px; padding: 20px; }
.week-pic b { font-size: 19px; }
.week-text { flex: 999 1 320px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.week-text h3 { margin-bottom: 4px; }
.fruit { display: block; max-width: 100%; height: auto; }

/* ---------- Медиа ---------- */
.media-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.media-item { margin: 0; background: var(--surface-alt); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.media-item img, .media-item video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #1F2430; display: block; }
.media-item figcaption { padding: 10px 14px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.photo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-row img { width: 140px; height: 140px; object-fit: cover; border-radius: 14px; }
.photo-edit { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ---------- Анкеты сурмам ---------- */
.sm-card { display: flex; flex-wrap: wrap; gap: 24px; }
.sm-gallery { flex: 1 1 260px; max-width: 380px; position: relative; border-radius: 22px; overflow: hidden; background: var(--surface-alt);
  aspect-ratio: 3 / 4; }
.sm-gallery img { width: 100%; height: 100%; object-fit: cover; }
.sm-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; }
.sm-dots button { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 0; background: rgba(255,255,255,.6); cursor: pointer; }
.sm-dots button.on { background: #fff; transform: scale(1.25); }
.sm-gallery .sm-prev, .sm-gallery .sm-next { position: absolute; top: 0; bottom: 0; width: 40%; background: none; border: 0; cursor: pointer; }
.sm-gallery .sm-prev { left: 0; } .sm-gallery .sm-next { right: 0; }
.sm-nophoto { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--text-muted); font-weight: 600; background: linear-gradient(160deg, var(--eva-blue-soft), var(--eva-pink-soft)); }
.sm-body { flex: 999 1 320px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sm-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; }
.sm-facts div { display: flex; flex-direction: column; }
.sm-facts dt { font-size: 13px; color: var(--text-muted); }
.sm-facts dd { margin: 0; font-weight: 600; }
.sm-about { margin: 0; padding: 16px 20px; background: var(--surface-alt); border-radius: 16px; font-style: italic; }
.curator-note { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 16px; background: var(--eva-coral-soft); }
.curator-note b { font-size: 13px; color: var(--eva-coral-deep); }
.ask summary { cursor: pointer; color: var(--eva-blue-deep); font-weight: 600; min-height: 32px; }
.sm-thumb { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; flex: none; }
.sm-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sm-tile { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; background: var(--surface-alt); text-decoration: none; color: var(--text); }
.sm-tile:hover { color: var(--text); box-shadow: inset 0 0 0 2px var(--eva-blue); }
.sm-tile img, .sm-tile .sm-nophoto { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; font-size: 11px; }
.sm-tile .main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pick-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pick { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--surface-alt); cursor: pointer; }
.pick:has(input:checked) { box-shadow: inset 0 0 0 2px var(--eva-coral); background: #fff; }
.pick input { width: 20px; height: 20px; flex: none; }
.pick img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; }
.pick .main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* ---------- Чат: вложения ---------- */
.chat-form .attach { position: relative; flex: none; cursor: pointer; }
.chat-form .attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chat-input { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chat-file-name { font-size: 13px; color: var(--eva-blue-deep); font-weight: 600; }
.msg-img { max-width: 240px; max-height: 240px; border-radius: 12px; object-fit: cover; }
.msg-file { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }

/* ---------- Программы ---------- */
.stage-edit { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.stage-edit li { background: var(--surface-alt); border-radius: 16px; padding: 12px; }
.report .main { display: flex; flex-direction: column; }
.main { display: flex; flex-direction: column; min-width: 0; }
