/**
 * profile.css — дополнения к journal.css для QR-профиля
 * Подключать ПОСЛЕ /assets/journal.css
 * Фон, шрифты Maybug/Cornerita, .j-btn, .j-card, .tg-input — из journal.css
 */

/* ================================================================
 * База (без своего фона — journal / backgroundtg)
 * ================================================================ */

.profile-page {
  min-height: 100dvh;
}

.profile-page .j-muted {
  color: #6b7280;
  font-size: 0.9rem;
}

.break-all {
  word-break: break-all;
}

/* ================================================================
 * Flash
 * ================================================================ */

.profile-page .j-flash {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(17, 24, 39, 0.08);
  background: #fff;
  max-width: 90vw;
}

.profile-page .j-flash--success {
  background: rgba(209, 250, 229, 0.95);
  color: #065f46;
  border: 1px solid rgba(52, 211, 153, 0.5);
}

.profile-page .j-flash--error {
  background: rgba(254, 226, 226, 0.95);
  color: #991b1b;
  border: 1px solid rgba(252, 165, 165, 0.55);
}

/* ================================================================
 * Layout
 * ================================================================ */

.profile-layout {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 320px);
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 6rem;
}

.profile-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-aside {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-self: start;
}

@media (min-width: 861px) {
  .profile-aside {
    position: sticky;
    top: 4.2rem;
  }
}

@media (max-width: 860px) {
  .profile-layout {
    grid-template-columns: 1fr;
    padding: 0.75rem 0.75rem 5.5rem;
    gap: 0.85rem;
  }
  /* nav → контент → управление снизу */
  .j-sec-nav {
    order: 0;
  }
  .profile-main {
    order: 1;
  }
  .profile-aside {
    order: 2;
    position: static;
  }
}

/* ================================================================
 * Навигация секций — одна линия + горизонтальный скролл
 * (journal прячет .j-sec-nav на mobile — здесь принудительно показываем)
 * ================================================================ */

.profile-page .j-sec-nav {
  grid-column: 1 / -1;
  display: flex !important;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 0.4rem 0.45rem;
  margin: 0 0 0.25rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 9999px;
  box-shadow: 0 8px 24px -10px rgba(17, 24, 39, 0.18);
  position: sticky;
  top: 0.5rem;
  z-index: 50;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.profile-page .j-sec-nav::-webkit-scrollbar {
  display: none;
}

.profile-page .j-sec-nav a {
  flex: 0 0 auto;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4b5563;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.profile-page .j-sec-nav a:hover {
  background: rgba(255, 251, 235, 0.95);
  border-color: rgba(245, 158, 11, 0.4);
  color: #92400e;
}

.profile-page .j-sec-nav a.is-active {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  color: #92400e;
  box-shadow: 0 2px 8px -2px rgba(245, 158, 11, 0.35);
}

.profile-page #photos,
.profile-page #activity,
.profile-page #create-post,
.profile-page #journal,
.profile-page #profile,
.profile-page #manage,
.profile-page #qr,
.profile-page #pedigree,
.profile-page #medical,
.profile-page #report {
  scroll-margin-top: 4.5rem;
}

/* ================================================================
 * Секции — то же стекло, что .j-card в journal
 * ================================================================ */

.profile-page .j-section {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 1.35rem;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.12);
  padding: 1.1rem 1.15rem;
  overflow: hidden;
}
/* Fold: шапка на всю ширину карточки */
.profile-page .j-section.j-fold {
  padding: 0;
}
.profile-page .j-section.j-fold > .j-fold-body {
  padding: 0.85rem 1.15rem 1.15rem;
}

/* aside-карточки уже .j-card — если вдруг без стиля journal */
.profile-page .profile-aside .j-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 1.35rem;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.12);
  padding: 1.1rem 1.15rem;
  overflow: hidden;
}

.profile-page .j-section h2 {
  font-family: 'Maybug', system-ui, sans-serif;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.75rem;
  color: #111;
  font-weight: 700;
}

.j-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.j-section__head h2 {
  margin: 0;
}

/* ================================================================
 * Hero — фото по центру
 * ================================================================ */

.profile-hero {
  text-align: center;
}

.profile-hero.j-section {
  padding: 1.15rem 1.1rem 1.2rem;
}

.profile-hero__photo-wrap {
  position: relative;
  width: min(280px, 70vw);
  margin: 0 auto 1rem;
  display: inline-block; /* якорь для absolute-бейджей */
  max-width: 100%;
}
.profile-hero__photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 1.35rem;
  display: block;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.6);
}
.profile-hero__photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #c4b5d4;
  aspect-ratio: 1;
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.5);
}
/* старый центральный lost-badge (если ещё где-то остался) */
.profile-hero__lost-badge {
  position: absolute;
  top: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  background: linear-gradient(135deg, #ef4444, #e11d48);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
  white-space: nowrap;
}
/* --- Бейджи на фото (как в старом UI) --- */
.profile-hero__badge {
  position: absolute;
  z-index: 5;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  pointer-events: none;
  white-space: nowrap;
  line-height: 1.2;
  font-family: 'Maybug', system-ui, sans-serif;
}
.profile-hero__badge--prem {
  top: 0.65rem;
  left: 0.65rem;
  background: linear-gradient(90deg, #fbbf24, #fb923c);
  color: #111;
  border: 1px solid rgba(255, 255, 255, 0.55);
}
.profile-hero__badge--token {
  top: 0.65rem;
  right: 0.65rem;
  background: #fde047;
  color: #111;
}
.profile-hero__badge--status {
  bottom: 0.65rem;
  left: 0.65rem;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  text-transform: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.profile-hero__badge--status.status-pill-lost {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.18);
}
.profile-hero__badge--status.status-pill-home {
  background: linear-gradient(135deg, #86efac 0%, #4ade80 50%, #22c55e 100%);
  color: #14532d;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}
/* лайк — кликабельный */
.profile-hero__like {
  position: absolute;
  z-index: 6;
  bottom: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.82);
  color: #dc2626;
  border: none;
  border-radius: 9999px;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.profile-hero__like:hover {
  background: #ef4444;
  color: #fff;
}
.profile-hero__like:active {
  transform: scale(0.95);
}
.profile-hero__like .like-count {
  font-variant-numeric: tabular-nums;
}
/* совместимость со старыми круглыми .badge (если где-то остались) */
.profile-hero__badges {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  z-index: 5;
}
.profile-hero__badges .badge {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.profile-hero__badges .badge--prem {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}
.profile-hero__badges .badge--token {
  background: #fef3c7;
}

.profile-hero__name {
  font-family: 'Maybug', system-ui, sans-serif;
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #111;
  margin: 0 0 0.3rem;
  line-height: 1.15;
  font-weight: 700;
}

.profile-hero__breed {
  margin: 0 0 1rem;
  color: #4b5563;
  font-size: 0.95rem;
}

.profile-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.inline-form {
  display: inline;
}

.profile-page .j-btn-block {
  width: 100%;
  margin-top: 0.4rem;
}

/* ================================================================
 * Фильтры / лимиты (QR-специфика)
 * ================================================================ */

.profile-page .j-filter-pills,
.profile-page .j-limit-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.profile-page .j-filter-pills button,
.profile-page .j-limit-pills button {
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.profile-page .j-filter-pills button.is-on,
.profile-page .j-limit-pills button.is-on {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.profile-page .j-limit-pills button {
  min-width: 2.2rem;
  padding: 0.3rem 0.5rem;
}

/* ================================================================
 * Лента активности
 * ================================================================ */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.act-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 1rem;
  padding: 0.75rem 0.9rem;
}

.act-card.is-overdue {
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.95), rgba(252, 231, 243, 0.9));
  border-color: #fecdd3;
}

.act-card.is-done {
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.95), rgba(209, 250, 229, 0.9));
  border-color: #a7f3d0;
}

.act-card__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.act-card__date {
  margin-left: auto;
  font-size: 0.75rem;
  color: #9ca3af;
}

.act-card__del {
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #6b7280;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.act-card__del:hover {
  background: #ffe4e6;
  color: #e11d48;
}

.act-card__title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #111;
}

.act-card__body {
  margin-top: 0.25rem;
  font-size: 0.88rem;
  color: #4b5563;
  white-space: pre-wrap;
  line-height: 1.4;
}

.act-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.act-badge--today { background: #fef3c7; color: #92400e; }
.act-badge--care { background: #e0e7ff; color: #3730a3; border-color: rgba(99, 102, 241, 0.25); }
.act-badge--health { background: #dbeafe; color: #1e40af; border-color: rgba(59, 130, 246, 0.25); }
.act-badge--event { background: #fce7f3; color: #9d174d; border-color: rgba(236, 72, 153, 0.25); }
.act-badge--photo { background: #f3e8ff; color: #6b21a8; border-color: rgba(168, 85, 247, 0.25); }
.act-badge--note { background: #f1f5f9; color: #334155; border-color: rgba(100, 116, 139, 0.2); }
.act-badge--memory { background: #ffe4e6; color: #9f1239; border-color: rgba(244, 63, 94, 0.25); }

.act-status {
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.35rem;
}

.act-status--overdue {
  color: #e11d48;
  background: #ffe4e6;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
}

.act-status--done {
  color: #059669;
}

/* ================================================================
 * Форма создания поста
 * ================================================================ */

.create-post-form .label {
  display: block;
  margin: 0.75rem 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-msg {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.form-msg--err {
  color: #b91c1c;
}

.create-post-form .j-btn-block {
  margin-top: 1rem;
}

/* ================================================================
 * Правая колонка / fold
 * ================================================================ */

/* Правая колонка — компактный заголовок, стрелка в кружке */
.profile-page .profile-aside .j-fold-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-bottom: none;
  border-radius: 0;
  padding: 0;
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  gap: 0.5rem;
  -webkit-appearance: none;
  appearance: none;
}
.profile-page .profile-aside .j-fold-chevron,
.profile-page .profile-aside .j-fold-arrow {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(255, 255, 255, 0.75);
  color: #92400e;
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.2s ease, background 0.15s, border-color 0.15s;
}
.profile-page .profile-aside .j-fold-head:hover .j-fold-chevron,
.profile-page .profile-aside .j-fold-head:hover .j-fold-arrow {
  background: rgba(254, 243, 199, 0.95);
  border-color: #f59e0b;
}

.j-fold-chevron {
  transition: transform 0.2s;
}

.j-fold.is-collapsed .j-fold-chevron {
  transform: rotate(-90deg);
}

.j-fold.is-collapsed .j-fold-body {
  display: none;
}

.aside-dl {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.aside-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(251, 191, 36, 0.12);
}

.aside-dl > div:last-child {
  border-bottom: none;
}

.aside-dl dt {
  color: #9ca3af;
  font-weight: 500;
}

.aside-dl dd {
  margin: 0;
  font-weight: 650;
  text-align: right;
  color: #111;
}

.aside-public {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
  font-weight: 650;
}

.aside-public select {
  padding: 0.3rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: #fff;
  font-size: 0.85rem;
  font-family: inherit;
}

/* ================================================================
 * Профиль dl / info
 * ================================================================ */

.profile-dl {
  margin: 0;
  display: grid;
  gap: 0;
}

.profile-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(251, 191, 36, 0.15);
}

.profile-dl > div:last-child {
  border-bottom: none;
}

.profile-dl dt {
  color: #9ca3af;
  font-weight: 500;
  flex-shrink: 0;
}

.profile-dl dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  color: #111;
  word-break: break-word;
}

.phone-pretty .phone-sep {
  opacity: 0.4;
  margin: 0 0.1em;
}

.phone-line {
  display: block;
}

.info-card {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.info-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: #111;
}

.info-card--emergency {
  background: rgba(254, 226, 226, 0.85);
  border-color: rgba(252, 165, 165, 0.5);
}

/* ================================================================
 * QR
 * ================================================================ */

.qr-block {
  text-align: center;
}

.qr-img {
  border-radius: 1rem;
  background: #fff;
  padding: 0.75rem;
  box-shadow: 0 8px 24px -8px rgba(17, 24, 39, 0.12);
}

.qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.85rem 0 0.5rem;
}

/* ================================================================
 * FAB (если journal не задал)
 * ================================================================ */

.profile-page .j-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.3rem;
  z-index: 80;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.45rem;
}

.profile-page .j-fab__main {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #111;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45);
  transition: transform 0.15s;
  font-family: inherit;
}

.profile-page .j-fab.is-open .j-fab__main {
  transform: rotate(45deg);
}

.profile-page .j-fab__menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

.profile-page .j-fab__menu[hidden] {
  display: none !important;
}

.profile-page .j-fab__menu button {
  padding: 0.55rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  font-size: 0.88rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  color: #374151;
}

.profile-page .j-fab__menu button:hover {
  background: #fffbeb;
  color: #92400e;
}

/* ================================================================
 * Journal list
 * ================================================================ */

.journal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ================================================================
 * Mobile
 * ================================================================ */

@media (max-width: 860px) {
  .profile-hero__photo-wrap {
    width: min(240px, 72vw);
  }

  .profile-hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-hero__actions .j-btn,
  .profile-hero__actions .inline-form,
  .profile-hero__actions .inline-form .j-btn {
    width: 100%;
    display: flex;
  }

  .profile-page .j-filter-pills,
  .profile-page .j-limit-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }

  .profile-page .j-filter-pills::-webkit-scrollbar,
  .profile-page .j-limit-pills::-webkit-scrollbar {
    display: none;
  }

  .profile-page .j-filter-pills button,
  .profile-page .j-limit-pills button {
    flex: 0 0 auto;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .profile-page .j-fab {
    right: max(0.85rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  .qr-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    max-width: 20rem;
    margin-left: auto;
    margin-right: auto;
  }
  .qr-actions .j-btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 8.5rem;
    width: auto;
  }
}

/* Hero: одинаковая ширина «Потерялся» / «Объявление» */
.profile-hero__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.profile-hero__actions .hero-action-form {
  display: contents; /* кнопка участвует в grid */
}

.profile-hero__actions .hero-action-btn,
.profile-hero__actions .j-btn {
  width: 100%;
  min-height: 46px;
}

@media (max-width: 480px) {
  .profile-hero__actions {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

/* ===== Lost card ===== */
.lost-section {
  padding: 0 !important;
  overflow: hidden;
  border-color: rgba(252, 165, 165, 0.45) !important;
}
.lost-card {
  padding: 1.25rem 1.15rem 1.2rem;
  background: linear-gradient(160deg, rgba(255, 241, 242, 0.75) 0%, rgba(255, 255, 255, 0.5) 55%);
  text-align: center;
}
.lost-card__icon {
  font-size: 2.1rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}
.lost-card__title {
  margin: 0 0 0.45rem !important;
  font-size: 1.15rem !important;
}
.lost-card__lead {
  margin: 0 auto 1rem;
  max-width: 26rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #4b5563;
}
.lost-card__hint {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: #6b7280;
}
.lost-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.lost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3rem;
  padding: 0.7rem 1.15rem;
  border-radius: 1.1rem;
  font-weight: 700;
  font-size: 0.92rem;
  font-family: inherit;
  text-decoration: none;
  color: #111827;
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, filter 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.lost-btn:active {
  transform: scale(0.98);
}
.lost-btn-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.lost-btn-call {
  background: linear-gradient(135deg, #93c5fd, #60a5fa);
  border-color: rgba(37, 99, 235, 0.22);
}
.lost-btn-wa {
  background: linear-gradient(135deg, #6ee7b7, #34d399);
  border-color: rgba(5, 150, 105, 0.22);
}
.lost-btn-geo {
  background: linear-gradient(135deg, #86efac, #4ade80);
  border-color: rgba(22, 163, 74, 0.25);
  width: 100%;
  max-width: 22rem;
}
.lost-phone {
  margin: 0 0 1rem;
  font-weight: 600;
  font-size: clamp(1.1rem, 4vw, 1.35rem);
}
.lost-geo {
  border-top: 1px solid rgba(252, 165, 165, 0.35);
  padding-top: 1rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}
.lost-geo-status {
  margin: 0;
  font-size: 0.85rem;
  min-height: 1.2em;
  color: #6b7280;
}
@media (max-width: 480px) {
  .lost-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .lost-actions .lost-btn {
    width: 100%;
  }
}

/* Навигация: гарантированный тач-скролл на iOS/Android */
.profile-page .j-sec-nav {
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  /* важные для iOS, чтобы не «обрезало» и можно было тянуть */
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.profile-page .j-sec-nav a {
  -webkit-user-select: none;
  user-select: none;
}

/* ===== Premium entry under photo (как в старом profile) ===== */
.profile-prem-entry {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  width: 100%;
}
.profile-prem-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 22rem;
  min-height: 3.25rem;
  padding: 0.65rem 1rem 0.65rem 0.9rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 55%, #f97316 100%);
  color: #111827;
  font-family: inherit;
  cursor: pointer;
  box-shadow:
    0 8px 22px -8px rgba(245, 158, 11, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}
.profile-prem-btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -10px rgba(245, 158, 11, 0.6);
}
.profile-prem-btn:active {
  transform: scale(0.98);
}
.profile-prem-btn__star {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}
.profile-prem-btn__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.profile-prem-btn__title {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}
.profile-prem-btn__sub {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-prem-btn__chev {
  font-size: 1.1rem;
  font-weight: 700;
  opacity: 0.75;
  flex-shrink: 0;
}
/* активный Premium — чуть «спокойнее» градиент */
.profile-prem-btn.is-premium {
  background: linear-gradient(135deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
  border-color: rgba(180, 83, 9, 0.35);
}

/* ===== Beta / update notice ===== */
.profile-beta-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  margin: 0 0 0.15rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 45%, #fecdd3 100%);
  border: 1px solid #f87171;
  box-shadow: 0 4px 14px -8px rgba(239, 68, 68, 0.28);
}
.profile-beta-note__ico {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.35;
}
.profile-beta-note__text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #9f1239;
  font-weight: 500;
}
@media (max-width: 860px) {
  .profile-beta-note {
    margin: 0 0 0.1rem;
    padding: 0.55rem 0.75rem;
  }
  .profile-beta-note__text {
    font-size: 0.78rem;
  }
}

/* ===== FAB как в journal ===== */
.j-fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.j-fab-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}
.j-fab-wrap {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1.15rem, env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.5rem;
}
.j-fab-btn {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #fbbf24 0%, #f59e0b 55%, #ea580c 100%);
  color: #111827;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    0 8px 24px rgba(245, 158, 11, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
}
.j-fab-wrap.open .j-fab-btn {
  transform: rotate(45deg);
  background: linear-gradient(145deg, #fcd34d, #f59e0b);
}
.j-fab-btn:active {
  transform: scale(0.94);
}
.j-fab-wrap.open .j-fab-btn:active {
  transform: rotate(45deg) scale(0.94);
}
.j-fab-menu {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  padding-bottom: 0.15rem;
}
.j-fab-menu[hidden] {
  display: none !important;
}
.j-fab-item {
  min-height: 2.65rem;
  padding: 0.55rem 1.05rem;
  border-radius: 9999px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  font-size: 0.88rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  color: #374151;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.j-fab-item:hover {
  background: #fffbeb;
  color: #92400e;
}
.j-fab-item:active {
  transform: scale(0.97);
}
html.j-fab-open,
html.j-fab-open body {
  overflow: hidden;
}
/* старый .j-fab в profile можно не трогать — id уже другие */

.profile-view-as {
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.profile-view-as__form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.profile-view-as__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4f46e5;
}
.profile-view-as__select {
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
}
.profile-view-as__hint {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
  width: 100%;
}

.j-fold-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.j-fold-arrow {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  font-size: 1.1rem;
  line-height: 1;
  color: #9ca3af;
}
.j-fold.is-collapsed .j-fold-arrow {
  transform: rotate(-90deg); /* ▾ → › */
}
.j-fold.is-collapsed .j-fold-body {
  display: none;
}

/* Fold в основных секциях QR-профиля — шапка как у Forest */
.profile-page .j-section.j-fold > .j-fold-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 1rem 1.1rem 0.95rem;
  border: none;
  border-bottom: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 1.35rem 1.35rem 0 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
  background: linear-gradient(
    90deg,
    rgba(255, 251, 235, 0.95) 0%,
    rgba(255, 247, 237, 0.92) 50%,
    rgba(254, 243, 199, 0.88) 100%
  );
  -webkit-appearance: none;
  appearance: none;
}
.profile-page .j-section.j-fold > .j-fold-head .sec-title,
.profile-page .j-section.j-fold > .j-fold-head h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  text-align: center;
  font-family: 'Maybug', system-ui, sans-serif;
  font-size: clamp(1.05rem, 3.2vw, 1.25rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: #111827;
}
/* Подзаголовок (если добавите <p class="j-fold-sub">) */
.profile-page .j-section.j-fold > .j-fold-head .j-fold-sub {
  display: block;
  margin: 0.2rem 0 0;
  font-family: 'Maybug', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.45);
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Текст заголовка по центру, стрелка справа */
.profile-page .j-section.j-fold > .j-fold-head .j-fold-head-text {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.profile-page .j-fold-arrow,
.profile-page .j-fold-chevron {
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  margin-top: 0.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(255, 255, 255, 0.75);
  transition: transform 0.2s ease, background 0.15s, border-color 0.15s;
  font-size: 0.95rem;
  line-height: 1;
  color: #92400e;
}
.profile-page .j-fold-head:hover .j-fold-arrow,
.profile-page .j-fold-head:hover .j-fold-chevron {
  background: rgba(254, 243, 199, 0.95);
  border-color: #f59e0b;
}
.profile-page .j-fold.is-collapsed .j-fold-arrow,
.profile-page .j-fold.is-collapsed .j-fold-chevron {
  transform: rotate(-90deg);
}
.profile-page .j-fold.is-collapsed > .j-fold-body {
  display: none;
}
@media (max-width: 480px) {
  .profile-page .j-section.j-fold > .j-fold-head {
    padding: 0.85rem 0.75rem 0.8rem;
    gap: 0.4rem;
  }
  .profile-page .j-section.j-fold > .j-fold-head .sec-title,
  .profile-page .j-section.j-fold > .j-fold-head h2 {
    font-size: 1.05rem;
  }
  .profile-page .j-fold-arrow,
  .profile-page .j-fold-chevron {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.85rem;
  }
}

.profile-lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 2rem 1rem;
  text-align: center;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px dashed rgba(156, 163, 175, 0.45);
}
.profile-lock__icon {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.15rem;
}
.profile-lock__title {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #374151;
}
.profile-lock__text {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
  max-width: 16rem;
  line-height: 1.4;
}

/* Заглушка Premium-разделов */
.prem-stub {
  padding: 0.25rem 0;
}
.prem-stub__row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: nowrap;
}
.prem-stub__ico {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}
.prem-stub__text {
  flex: 1 1 auto;
  min-width: 0;
}
.prem-stub__title {
  margin: 0 0 0.2rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #111;
}
.prem-stub__desc {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.35;
}
.prem-stub__eye {
  margin-left: auto;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(255, 251, 235, 0.95);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}
.prem-stub__eye:hover {
  background: #fef3c7;
}
@media (max-width: 480px) {
  .prem-stub__row {
    gap: 0.5rem;
  }
  .prem-stub__ico {
    font-size: 1.25rem;
  }
  .prem-stub__title {
    font-size: 0.9rem;
  }
  .prem-stub__desc {
    font-size: 0.75rem;
  }
  .prem-stub__eye {
    width: 2.35rem;
    height: 2.35rem;
  }
}

/* Ближайшие события (QR profile) */
.profile-upcoming {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--j-radius-sm, 0.85rem);
  background: var(--j-card-bg, rgba(255,255,255,0.72));
  border: var(--j-border, 1px solid rgba(255,255,255,0.55));
  box-shadow: var(--j-shadow, 0 4px 24px rgba(30,20,60,0.08));
  backdrop-filter: var(--j-blur, blur(16px));
}
.profile-upcoming__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.profile-upcoming__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.profile-upcoming__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.profile-upcoming__btn {
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.profile-upcoming__page {
  font-size: 0.8rem;
  color: var(--j-muted, #6b6580);
  min-width: 1.5rem;
  text-align: center;
}
.profile-upcoming__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.profile-upcoming__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.35rem;
  border-radius: 0.65rem;
  background: rgba(255,255,255,0.45);
}
.profile-upcoming__item.is-hidden {
  display: none;
}
.profile-upcoming__ico {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}
.profile-upcoming__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.profile-upcoming__name {
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-upcoming__when {
  font-size: 0.75rem;
  color: var(--j-muted, #6b6580);
}
.profile-upcoming__open {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--j-accent, #f5a623);
  padding: 0.25rem;
}
.profile-upcoming--empty {
  text-align: center;
  padding: 0.75rem;
}