/* =============================
   3. Layout & Containers
============================= */
/* =============================
   2. Главный контейнер
============================= */
/* — На всех страницах (index, register, cabinet и т.д.) */

main.container,
.container,
.form-container {
  flex: 1;
  width: 100%;
  max-width: 376px;

  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Form blocks should align their contents to the left */
.form-container {
  align-items: flex-start;
}

/* Убираем внешний отступ у основного контейнера */
main.container {
  margin-top: 0;
}

/* Первый элемент внутри контейнера без верхнего отступа */
main.container > :first-child {
  margin-top: 0;
}

/* =============================
   Safe UI layout layer
   Use these classes on new/cleaned pages instead of changing specialist cards.
============================= */
.ui-page,
.ui-page * {
  box-sizing: border-box;
  margin: 0;
}

.ui-page {
  width: 100%;
  max-width: calc(var(--control-width) + (var(--space-16) * 2));
  margin: 0 auto;
  padding: var(--space-16);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-24);
}

.ui-stack {
  width: 100%;
  max-width: var(--control-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-16);
}

.ui-stack--tight {
  gap: var(--space-8);
}

.ui-control {
  width: 100%;
  max-width: var(--control-width);
}

.ui-page .btn,
.ui-page button.btn,
.ui-page .telegram-web-login {
  width: 100%;
  max-width: var(--control-width);
  margin-left: auto;
  margin-right: auto;
}

.ui-page .form-control,
.ui-page input:not([type=radio]):not([type=checkbox]):not([type=range]),
.ui-page textarea,
.ui-page select {
  width: 100%;
  max-width: var(--control-width);
  margin-left: auto;
  margin-right: auto;
}

/* Unified specialist search suggestions */
.specialist-suggestions {
  z-index: 3000;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 0 0 20px 20px;
  background: var(--surface-soft);
  box-shadow:
    6px 6px 14px var(--shadow-dark),
   -6px -6px 14px var(--shadow-light);
}

.specialist-suggestions[hidden] {
  display: none !important;
}

.specialist-suggestion {
  width: 100%;
  height: auto;
  margin: 0;
  min-height: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-raised);
  color: var(--color-text);
  font-family: var(--font-base);
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--shadow-soft);
  letter-spacing: 0;
  text-transform: none;
}

.specialist-suggestion + .specialist-suggestion {
  margin-top: 8px;
}

.specialist-suggestion:hover,
.specialist-suggestion:focus,
.specialist-suggestion:active {
  outline: none;
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
}

.specialist-suggestion__name {
  margin: 0;
  font-size: var(--cl-type-body);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text);
  text-transform: none;
  text-shadow: var(--text-emboss);
  letter-spacing: 0;
}

.specialist-suggestion__meta {
  margin: 0;
  font-size: var(--cl-type-meta);
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-muted);
  text-transform: none;
  text-shadow: var(--text-emboss);
  letter-spacing: 0;
}

.specialist-suggestion__meta:empty {
  display: none;
}

.specialist-suggestion-note {
  color: var(--color-muted);
  cursor: default;
}

/* Rating must follow the same simple header/list layout as Favorites. */
.rating-page .rating-view-toggle {
  display: none !important;
}

.rating-page .filters,
.rating-page #cards-container {
  align-self: center;
}

.ui-page ul,
.ui-page ol {
  width: 100%;
  padding-left: var(--space-16);
}

.ui-page li + li {
  margin-top: var(--space-8);
}

.ui-page .accordion {
  width: 100%;
  margin: 0;
}

.ui-page .accordion__content > * + * {
  margin-top: var(--space-8);
}

.ui-page .consent-box {
  width: 100%;
}

.ui-page .page-subtitle,
.ui-page .telegram-login-note,
.ui-page .tg-username,
.ui-page .form-hint,
.ui-page .form-error {
  margin: 0;
}

.ui-form {
  width: 100%;
  max-width: var(--control-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.ui-form .step {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.ui-form .form-label {
  width: 100%;
}

.ui-form .form-label + .form-control,
.ui-form .form-label + input,
.ui-form .form-label + select,
.ui-form .form-label + textarea {
  margin-top: 0;
}

.ui-form .auth-buttons {
  margin: 0;
}

.landing-page {
  min-height: 100vh;
  justify-content: flex-start;
  padding-top: var(--space-48);
  padding-bottom: var(--space-36);
}

.landing-page .landing-stack {
  gap: var(--space-24);
}

.landing-page .logo-link {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}

.landing-page .logo-link img {
  width: 64px;
  height: 64px;
}

.landing-page .landing-seo-intro,
.landing-page .landing-legal,
.landing-page .telegram-login-note {
  max-width: var(--control-width);
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.45;
  text-align: center;
  text-transform: none;
}

.web-entry-actions {
  width: 100%;
  max-width: var(--control-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-16);
  margin-top: var(--space-16);
}

.web-entry-actions .btn,
.web-entry-actions .telegram-web-login {
  min-height: 56px;
  margin: 0;
}

.web-entry-primary {
  color: #fff !important;
  background: var(--btn-accent-gradient) !important;
}

.web-entry-secondary {
  background: var(--surface-raised);
}

.web-entry-telegram {
  color: var(--color-accent-strong);
  background: var(--surface-raised);
}

.web-auth-page {
  min-height: 100vh;
  justify-content: center;
  padding-top: var(--space-24);
  padding-bottom: var(--space-24);
}

.web-auth-panel {
  padding: var(--space-24) var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  box-shadow: var(--shadow-raised);
}

.web-auth-form {
  gap: var(--space-16);
  margin-top: var(--space-8);
}

.web-auth-form .form-label {
  margin-bottom: calc(var(--space-8) * -1);
}

.web-auth-form .form-control {
  min-height: 56px;
}

.web-auth-form .consent-box {
  margin: 0;
}

.web-auth-submit {
  min-height: 56px;
  color: #fff !important;
  background: var(--btn-accent-gradient) !important;
}

.web-auth-switch,
.web-auth-back {
  color: var(--color-accent-strong);
  font-size: var(--cl-type-meta);
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.web-auth-switch:hover,
.web-auth-switch:focus,
.web-auth-back:hover,
.web-auth-back:focus {
  color: var(--color-accent-strong);
  text-decoration: none;
}

.web-auth-page .form-error {
  width: 100%;
  padding: var(--space-16);
  border-radius: var(--radius-pill);
  color: var(--color-danger);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  font-size: var(--cl-type-meta);
  line-height: 1.35;
  text-align: center;
  text-transform: none;
}

.role-form {
  width: 100%;
  max-width: var(--control-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.role-card {
  width: 100%;
  max-width: var(--control-width);
  min-height: 148px;
  height: auto;
  margin: 0;
  padding: var(--space-24) var(--space-16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  color: var(--color-text);
  font-family: var(--font-base);
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.role-card:active {
  box-shadow: var(--shadow-inset);
  background: var(--surface-pressed);
}

.role-icon {
  font-size: var(--cl-icon-role);
  line-height: 1;
}

.role-title {
  font-size: var(--cl-type-title-sm);
  font-weight: 700;
  color: #333333;
}

.role-desc {
  max-width: 260px;
  font-size: var(--cl-type-meta);
  line-height: 1.35;
  color: var(--color-muted);
}

.cabinet-page .profile-card,
.cabinet-page .profile-header,
.cabinet-page .cabinet-form-fields,
.cabinet-page .cabinet-action {
  width: 100%;
  min-width: 0;
}

.cabinet-page,
.cabinet-page .profile-card,
.cabinet-page .cabinet-section,
.cabinet-page .cabinet-section > *,
.cabinet-page .calendar-connections-settings {
  min-width: 0;
}

.cabinet-page {
  overflow-x: hidden;
}

.cabinet-page .profile-header {
  gap: var(--space-8);
}

.cabinet-page .cabinet-section {
  width: 100%;
  max-width: var(--control-width);
  margin: 0 auto;
  scroll-margin-top: calc(64px + max(12px, env(safe-area-inset-top, 0px)) + var(--space-16));
}

.cabinet-page .cabinet-section__header {
  display: grid;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
  text-align: left;
}

.cabinet-page .cabinet-section__header h2 {
  color: var(--color-text);
  font-size: var(--cl-type-section);
  line-height: 1.1;
}

.cabinet-page .cabinet-section__header p {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.4;
}

.cabinet-section-nav {
  width: 100%;
  max-width: var(--control-width);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin: var(--space-16) auto var(--space-8);
}

.cabinet-section-nav a {
  flex: 1 1 calc(33.333% - var(--space-8));
  min-width: 112px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) 10px;
  border-radius: var(--radius-pill);
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  font-size: var(--cl-type-caption);
  line-height: 1.15;
  text-align: center;
  text-decoration: none !important;
}

.cabinet-section-nav a:hover,
.cabinet-section-nav a:focus-visible {
  color: var(--color-text);
  box-shadow: var(--shadow-inset);
}

.cabinet-save-status {
  width: 100%;
  max-width: var(--control-width);
  min-height: 18px;
  margin: 0 auto;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.3;
  text-align: center;
}

.cabinet-save-status.is-saving {
  color: var(--color-accent-strong);
}

.cabinet-save-status.is-success {
  color: var(--color-success, #148c66);
}

.cabinet-save-status.is-error,
.cabinet-avatar-status.is-error {
  color: var(--color-danger, #a11b3e);
}

.cabinet-avatar-status {
  min-height: 16px;
  margin: 0;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
}

.cabinet-avatar-status.is-ready {
  color: var(--color-accent-strong);
}

.cabinet-avatar-status.is-loading {
  color: var(--color-muted);
}

.cabinet-page .cabinet-section--appearance,
.cabinet-page .cabinet-section--calendar {
  display: grid;
  gap: var(--space-8);
}

.cabinet-page .cabinet-section--calendar .calendar-connections-settings {
  width: 100%;
  margin: 0;
}

.cabinet-page .cabinet-section__header,
.cabinet-page .cabinet-section__header p,
.cabinet-page .calendar-connections-settings__header,
.cabinet-page .calendar-connections-settings__header p {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.cabinet-page #personal-avatar-submit[hidden] {
  display: none !important;
}

.cabinet-page .role-city {
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.cabinet-page .profile-header .badge {
  margin: 0;
}

.cabinet-page .rating-widget {
  width: 100%;
  max-width: var(--control-width);
  margin: var(--space-8) auto var(--space-16);
}

.cabinet-page .brand-toggle,
.cabinet-page .brand-section,
.cabinet-page #video-fields {
  width: 100%;
  max-width: var(--control-width);
  margin-left: auto;
  margin-right: auto;
}

.cabinet-page .brand-toggle {
  margin-top: 0;
  margin-bottom: 0;
}

.cabinet-page .brand-section {
  gap: var(--space-16);
}

.cabinet-page .brand-section.expanded {
  margin-top: var(--space-16);
  margin-bottom: 0;
}

.cabinet-page #video-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.cabinet-page #video-fields .form-control {
  margin: 0;
}

.cabinet-page .cabinet-form-fields {
  max-width: var(--control-width);
  margin-left: auto;
  margin-right: auto;
  gap: var(--space-16);
}

.cabinet-page .cabinet-field {
  width: 100%;
  max-width: var(--control-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-8);
}

.cabinet-page .cabinet-field .form-label {
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: left;
  line-height: 1.2;
}

.cabinet-page .cabinet-field .form-control,
.cabinet-page .cabinet-field #video-fields {
  width: 100%;
  max-width: none;
  margin: 0;
}

.cabinet-page .cabinet-input-wrap {
  width: 100%;
  position: relative;
}

.cabinet-page .cabinet-input-wrap .char-counter {
  right: var(--space-8);
  bottom: var(--space-8);
}

.cabinet-page #style,
.cabinet-page #about {
  padding-right: 72px;
}

.cabinet-page textarea.form-control {
  min-height: 88px;
  height: auto;
  padding-top: var(--space-8);
  padding-bottom: var(--space-24);
  line-height: 1.35;
  resize: none;
}

.cabinet-page #styleUniqueHint {
  min-height: 16px;
  margin: 0;
  padding: 0;
  text-align: left;
  line-height: 1.2;
}

.cabinet-page #addVideoField,
.cabinet-page .cabinet-main-submit,
.cabinet-page .btn-tour,
.cabinet-page .logout-btn,
.cabinet-page .file-btn,
.cabinet-page .brand-section .btn {
  width: 100%;
  max-width: var(--control-width);
  min-height: 44px;
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-base);
  font-size: var(--cl-type-body);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none !important;
}

.cabinet-page #addVideoField {
  margin-top: var(--space-8);
}

.cabinet-page .save-hint {
  max-width: var(--control-width);
  margin: var(--space-8) auto 0;
  line-height: 1.35;
}

.cabinet-page .cabinet-action {
  max-width: var(--control-width);
  text-align: center;
}

.cabinet-page .cabinet-personal-avatar {
  width: 100%;
  max-width: var(--control-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  text-align: center;
}

.cabinet-personal-avatar__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.cabinet-personal-avatar__copy h2 {
  color: var(--color-text);
  font-size: var(--cl-type-section);
  line-height: 1.1;
}

.cabinet-personal-avatar__copy p {
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.35;
}

.cabinet-personal-avatar__image {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-soft);
  box-shadow: var(--shadow-inset);
}

.cabinet-page .cabinet-personal-avatar .file-btn,
.cabinet-page .cabinet-personal-avatar .btn {
  width: 100%;
  max-width: var(--control-width);
  min-height: var(--control-height, 44px);
}

.account-security-page {
  min-height: 100vh;
  justify-content: center;
  padding-top: var(--space-24);
  padding-bottom: var(--space-24);
}

.account-security-card {
  padding: var(--space-24) var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  text-align: center;
}

.account-security-card h1 {
  color: var(--color-text);
  font-size: var(--cl-type-display);
  line-height: 1.1;
}

.account-security__name {
  color: var(--color-muted);
  font-size: var(--cl-type-body);
}

.account-security__immutable {
  display: block;
  margin-top: calc(var(--space-8) * -1);
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
  text-align: left;
}

.account-security__password-heading {
  margin: var(--space-8) 0 0;
  color: var(--color-text);
  font-weight: 600;
}

.account-security-form input[readonly] {
  color: var(--color-muted);
  cursor: not-allowed;
}

.account-avatar-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  box-shadow: var(--shadow-inset);
}

.account-avatar-card h2 {
  color: var(--color-text);
  font-size: var(--cl-type-section);
  line-height: 1.1;
}

.account-avatar-card__image {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
}

.account-avatar-card p {
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.35;
}

.account-avatar-form,
.account-security-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.account-avatar-form .btn,
.account-security-form .btn {
  width: 100%;
  min-height: var(--control-height, 44px);
}

.account-security-form > .btn {
  margin-block: var(--space-8);
}

.account-avatar-form .file-btn {
  height: 44px;
  min-height: 44px;
}

.account-security__support {
  color: var(--color-accent-strong);
  font-size: var(--cl-type-meta);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tester-page .profile-card,
.tester-page .profile-header,
.tester-page .tester-actions,
.tester-page .tester-form-wrap,
.tester-page .tester-logout {
  width: 100%;
}

.tester-page .profile-card {
  gap: var(--space-24);
}

.tester-page .profile-header {
  gap: var(--space-8);
}

.tester-page .role-city {
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-16);
}

.tester-page .profile-header .badge {
  margin: 0;
}

.tester-page .tester-form-wrap {
  padding: 0;
}

.tester-page .tester-logout {
  margin-top: var(--space-8);
  text-align: center;
}

.miniapp-auth-page {
  min-height: 100vh;
  justify-content: center;
}

.miniapp-auth-panel {
  width: 100%;
  max-width: var(--control-width);
  padding: var(--space-24) var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  box-shadow:
    var(--shadow-raised);
  text-align: center;
}

.miniapp-auth-logo {
  width: 72px;
  height: 72px;
  display: block;
}

.miniapp-auth-status {
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.45;
}

.miniapp-auth-status.is-error {
  color: #dc2626;
}

.backfill-page .backfill-grid,
.backfill-page .backfill-result {
  width: 100%;
  max-width: var(--control-width);
}

.backfill-page .backfill-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin: 0;
}

.backfill-page .form-col {
  width: 100%;
}

.backfill-page .backfill-result {
  margin-top: 0;
  padding: var(--space-24) var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  box-shadow:
    var(--shadow-raised);
}

.backfill-page .backfill-result ul {
  margin-top: var(--space-16);
}

.user-page .profile-header,
.user-page .favorites-section,
.user-page .contact-buttons,
.user-page .myself-buttons,
.user-page .video-container,
.user-page .about,
.user-page .video-vpn-notice {
  width: 100%;
  max-width: var(--control-width);
  margin-left: auto;
  margin-right: auto;
}

.user-page .profile-header {
  gap: var(--space-16);
}

.user-page .role-city {
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.user-page .profile-header .badge {
  margin: 0;
}

.user-page .rating-widget {
  width: 100%;
  max-width: var(--control-width);
  margin: var(--space-8) auto var(--space-16);
}

.user-page .favorites-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
}

.user-page .profile-action-buttons {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-8);
}

.user-page .profile-action-button,
.user-page .profile-action-buttons .fav-btn {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
  font-size: var(--cl-type-meta);
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  transition: box-shadow .2s, background .2s;
}

.user-page .profile-action-buttons .fav-btn .text {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.user-page .profile-action-button:hover,
.user-page .profile-action-button:focus,
.user-page .profile-action-buttons .fav-btn:hover,
.user-page .profile-action-buttons .fav-btn:focus {
  box-shadow: var(--shadow-inset);
  background: var(--surface-pressed);
}

.user-page .profile-action-button:active,
.user-page .profile-action-buttons .fav-btn:active {
  box-shadow: var(--shadow-inset);
}

.user-page .profile-action-buttons .fav-btn.active,
.user-page .profile-action-buttons .fav-btn.active:hover,
.user-page .profile-action-buttons .fav-btn.active:focus {
  background: linear-gradient(145deg, var(--color-accent), var(--color-accent-strong));
  color: #fff;
  text-shadow: none;
}

.user-page .contact-buttons {
  gap: var(--space-8);
  margin-bottom: var(--space-24);
}

.user-page .myself-buttons {
  gap: var(--space-8);
  margin-bottom: var(--space-24);
}

.user-page .profile-completion {
  width: 100%;
  max-width: var(--control-width);
  margin: 0 auto var(--space-16);
  padding: var(--space-16);
  box-sizing: border-box;
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  box-shadow: var(--shadow-raised);
}

.profile-completion__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-16);
}

.profile-completion__header h2,
.profile-completion__header p {
  margin: 0;
}

.profile-completion__header h2 {
  font-size: var(--cl-type-body);
  font-weight: 700;
}

.profile-completion__header p {
  margin-top: 4px;
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.35;
}

.profile-completion__header strong {
  flex: 0 0 auto;
  color: var(--color-accent-strong);
  font-size: var(--cl-type-section);
  font-weight: 700;
  line-height: 1;
}

.profile-completion__bar {
  height: 8px;
  margin-top: var(--space-16);
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
}

.profile-completion__bar span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--btn-accent-gradient);
  transition: width .25s ease;
}

.profile-completion__items {
  display: grid;
  gap: 6px;
  margin: var(--space-16) 0 0;
  padding: 0;
  list-style: none;
}

.profile-completion__item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.25;
}

.profile-completion__item.is-done {
  color: var(--color-text);
}

.profile-completion__mark {
  width: 18px;
  flex: 0 0 18px;
  color: var(--color-accent-strong);
  font-size: var(--cl-type-body);
  font-weight: 700;
  text-align: center;
}

.profile-completion__item.is-missing .profile-completion__mark {
  color: var(--color-muted);
}

.profile-completion__label {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.profile-completion__state {
  flex: 0 0 auto;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  text-align: right;
}

.profile-completion__item.is-done .profile-completion__state {
  color: var(--color-accent-strong);
}

.user-page .myself-buttons .btn-contact {
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.user-page .contact-buttons .btn {
  flex: 1 1 0;
  min-width: 0;
}

.user-page .about {
  padding: var(--space-24) var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  box-shadow:
    var(--shadow-raised);
  position: relative;
  text-align: left;
}

.user-page .video-vpn-notice {
  box-sizing: border-box;
  margin-top: 8px;
  padding: 0;
  color: var(--color-muted);
  font-size: var(--cl-type-caption, 12px);
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
}

.user-page .about h2 {
  margin: 0;
  text-align: left;
}

.user-page .about__header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-16);
}

.user-page .about__empty {
  color: var(--color-muted);
}

.user-page .about__empty-action,
.user-page .profile-posts__empty-action {
  width: 100%;
  min-height: 44px;
  margin-top: var(--space-16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
}

.user-page .about-notice {
  width: 100%;
  max-width: var(--control-width);
  margin: 0 auto;
  text-align: center;
}

.user-page .about-dialog-counter {
  align-self: flex-end;
  margin-top: -4px;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
}

.user-page #aboutDialogInput {
  min-height: 144px;
  height: auto;
  padding-top: var(--space-8);
  padding-bottom: var(--space-24);
  line-height: 1.35;
  resize: vertical;
}

.user-page .about p {
  margin: 0;
  color: var(--color-text);
  line-height: 1.45;
}





/* Ссылки */
a {
  color: #555555;
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}
/* =============================
   3. Отступы между элементами
============================= */
input, select, textarea, .accordion {
  margin-bottom: var(--space-8);
}
form > :last-child,
.container > :last-child {
  margin-bottom: 0;
}


/* Кнопка-логотип с неоморфным кругом */
.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--bg-neu);
  box-shadow:
    5px 5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  transition: box-shadow 0.2s;
}

.logo-link:hover {
  box-shadow:
    4px 4px 8px var(--shadow-dark),
   -4px -4px 8px var(--shadow-light);
}
.logo-link:active {
  box-shadow:
    inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);
}
.logo-link img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}



/* ==================================================
   ГЛОБАЛЬНЫЙ НЕОМОРФНЫЙ СТИЛЬ ДЛЯ ВСЕХ ПОЛЕЙ
================================================== */
input:not([type=radio]):not([type=checkbox]):not([type=range]),
textarea,
select,
.form-control {
  /* 1) Растягиваем на 100% контейнера (его max-width = 376px) */
  width: 344px;
  max-width: 100%;

  /* 2) Фиксированная высота как у аккордеона */
  height: 44px;

  /* 3) Фон и тень */
  background: var(--surface-raised);
  box-shadow: var(--shadow-input);

  /* 4) Скругления и отступы */
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 var(--space-16);

  /* 5) Типографика */
  font-family: var(--font-base);
  font-size: var(--cl-type-body);
  color: var(--color-text);

  outline: none;
  transition: box-shadow 0.18s ease, background 0.18s ease;
  box-sizing: border-box;
}

input[type=range] {
  height: auto;
  padding: 0;
}


/* ==================================================
   Inset-эффект при фокусе
================================================== */
input:not([type=radio]):not([type=checkbox]):not([type=range]):focus,
textarea:focus,
select:focus,
.form-control:focus {
  box-shadow: var(--shadow-focus);
}

select:active,
select.form-control:active {
  box-shadow: var(--shadow-inset);
}

/* Error state for invalid fields */
.form-control--error,
input.form-control--error,
select.form-control--error,
textarea.form-control--error {
  border: 1px solid var(--color-danger, #dc2626);
}

/* ==================================================
   Стрелка у всех select
================================================== */
select,
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;

  background-repeat: no-repeat;
  background-position: right var(--space-16) center;
  background-size: 12px 8px;
  background-image: url('/assets/icons/tabler/chevron-down-muted.svg');
}

/* ==================================================
   Вертикальные отступы между полями
================================================== */
/* На всех страницах, внутри форм */
.form-container > * + * {
  margin-top: var(--space-16);
}


/* =============================
   6. КНОПКИ
============================= */
/* общий стиль для всех кнопок */
button,
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none !important;
  background: var(--btn-gradient);
  box-shadow: var(--shadow-soft);

  border: none;
  border-radius: var(--radius-pill);
  padding: var(--space-12) var(--space-16);
  font-family: var(--font-base);
  font-size: var(--cl-type-body);
  color: var(--color-text);
  text-shadow: var(--text-emboss);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  width: 344px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  /* фиксированная высота 44px */
  height: 44px;
}
button:hover,
.btn:hover {
  box-shadow: var(--shadow-raised);
}
button:active,
.btn:active {
  transform: translateY(1px);
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
}
button:disabled,
.btn:disabled {
  box-shadow: var(--shadow-soft);
  opacity: 0.6;
  cursor: default;
}

/* стиль для кнопок primary — наследует общий вид */
.btn-primary {
}
.btn-primary:hover {
}
.btn-primary:active {
}






/* =============================
   7. НЕОМОРФНЫЙ АККОРДЕОН
============================= */
.accordion {
  width: 100%;
  max-width: 100%;
  background: var(--surface-raised);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.accordion > summary::-webkit-details-marker {
  display: none;
}
.accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-12,12px) var(--space-16);
  cursor: pointer;
  background: transparent;
  font-family: var(--font-base);
  font-size: var(--cl-type-body);
  text-shadow: var(--text-emboss);
}
.accordion > summary::after {
  content: '';
  width: 12px;
  height: 8px;
  background: currentColor;
  -webkit-mask: url('/assets/icons/tabler/chevron-down.svg') center / contain no-repeat;
  mask: url('/assets/icons/tabler/chevron-down.svg') center / contain no-repeat;
  transition: transform 0.2s;
}
.accordion[open] {
  box-shadow: var(--shadow-inset);
}
.accordion[open] > summary::after {
  transform: rotate(180deg);
}
.accordion__content {
  background: transparent;
  padding: var(--space-12,12px) var(--space-16);
  font-family: var(--font-base);
  font-size: var(--cl-type-body);
  line-height: 1.4;
}

/* ============ ВТЯНУТЫЙ ЭФФЕКТ ДЛЯ H1 ============ */
.page-title, .title {
  /* Оставляем прежние свойства заголовка */
  display: block;               /* или inline по желанию */
  font-size: var(--cl-type-display);
  font-weight: 700;
  color: #555555;
  text-align: center;

  /* Текстовый inset-эффект */
  text-shadow:
    2px  2px 3px var(--shadow-dark),
   -2px -2px 3px var(--shadow-light);
  background: transparent;      /* убираем фон */
  padding: 0;                   /* убираем padding */
  border-radius: 0;             /* сбрасываем скругления */
}








/* =============================
   Чекбокс согласия
============================= */
.consent-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  cursor: pointer;

  text-align: center;
}

/* Скрываем нативный вид и усиливаем чекбокс */
.consent-box input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  /* background: var(--bg-neu);*/
  box-shadow:
    3px 3px 12px rgba(0,0,0,0.12),
   -3px -3px 12px var(--shadow-light);
  border: 1px solid var(--color-danger, #dc2626);
  position: relative;
  transition: box-shadow 0.2s;
  cursor: pointer;
  margin-top: 4px; /* выравниваем с текстом */
}

/* Hover/Active */
.consent-box input[type="checkbox"]:hover {
  box-shadow:
    2px  2px 4px rgba(0,0,0,0.2),
   -2px -2px 4px var(--shadow-light);
}
.consent-box input[type="checkbox"]:active {
  box-shadow:
    inset 3px  3px 6px rgba(0,0,0,0.2),
    inset -3px -3px 6px var(--shadow-light);
}

/* Галочка */
.consent-box input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 12px;
  width: 20px;
  height: 12px;
border-left: 3px solid #555555;
  border-bottom: 3px solid #555555;
  transform: translate(-50%, -50%) rotate(-45deg);
}
/* Текст соглашения */
.consent-text {
  display: block;
  font-size: var(--cl-type-caption);
  color: #555555;
  line-height: 1.2;
  margin-top: var(--space-8);
}
.consent-text a {
  color: #555555;
  text-decoration: none;
}
.consent-note {
  font-size: var(--cl-type-caption);
  color: var(--color-muted);
  text-align: center;
  margin-top: -12px;
  margin-bottom: var(--space-16);
}
/* ============ КНОПКА ВХОДА ЧЕРЕЗ TELEGRAM ============ */
.auth-buttons {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  width: 100%;
}

.telegram-widget-slot {
  min-height: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.telegram-fallback,
.telegram-fallback-note {
  display: none;
}

.telegram-web-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 344px;
  max-width: 100%;
  min-height: 44px;
  padding: 0 var(--space-16);
  border-radius: var(--radius-pill);
  background: linear-gradient(145deg, #8FD6CC, #c9efea);
  box-shadow: 4px 4px 6px var(--shadow-dark), -4px -4px 6px var(--shadow-light);
  color: #174d49;
  font-size: var(--cl-type-body);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.telegram-login-note {
  width: 344px;
  max-width: 100%;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
  text-align: center;
}

.auth-buttons.widget-failed .telegram-widget-slot {
  display: none;
}

.auth-buttons.widget-failed .telegram-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 344px;
  max-width: 100%;
  height: 44px;
  border-radius: var(--radius-pill);
  background: linear-gradient(145deg, #8FD6CC, #c9efea);
  box-shadow: 4px 4px 6px var(--shadow-dark), -4px -4px 6px var(--shadow-light);
  color: #174d49;
  font-size: var(--cl-type-body);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.auth-buttons.widget-failed .telegram-fallback-note {
  display: block;
  width: 344px;
  max-width: 100%;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
  text-align: center;
}

/* ============ ВИЗУАЛЬНОЕ СОСТОЯНИЕ DISABLED ============ */
/* Снижаем непрозрачность и делаем серой */
.auth-buttons:not(.enabled) {
  opacity: 0.7;
  filter: grayscale(40%) brightness(1.2);
  cursor: not-allowed;
}

/* Делаем то же для самой Telegram-кнопки внутри */
.auth-buttons:not(.enabled) .telegram-login-button {
  filter: grayscale(40%) brightness(1.2);
  opacity: 0.8 !important;
}

/* Вернуть нормальное состояние, когда enabled */
.auth-buttons.enabled {
  opacity: 1;
  filter: none;
  cursor: pointer;
}
.auth-buttons.enabled .telegram-login-button {
  filter: none;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* =============================
 12. ФУТЕР
============================= */
.site-footer {
  text-align: center;
  font-size: var(--cl-type-caption);
  color: #555555;
  padding: var(--space-8) 0;
  margin-top: auto; /* прижимает футер к низу контента */
  text-decoration: none
}
.site-footer a {
  font-size: var(--cl-type-caption);
  color: #555555;
  text-decoration: none;
}

/* Всплывающие уведомления в неоморфном стиле */
.notification-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  margin: 0;
  background: var(--bg-neu);
  padding: var(--space-16);
  width: var(--control-width);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  font-size: var(--cl-type-meta);
  z-index: 1001;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}

/* Баннер согласия на cookie без затемнения */
.cookie-consent {
  position: fixed;
  left: 50%;
  bottom: var(--space-24);
  background: var(--bg-neu);
  padding: var(--space-16);
  width: calc(100% - 2 * var(--space-16));
  max-width: var(--control-width);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  font-size: var(--cl-type-meta);
  z-index: 1001;
  text-align: center;
  transform: translateX(-50%) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}

.notification-popup.show,
.cookie-consent.show {
  opacity: 1;
  pointer-events: auto;
}

.notification-popup.show {
  transform: translate(-50%, -50%) scale(1);
}

.cookie-consent.show {
  transform: translate(-50%, 0) scale(1);
}

/* Кнопки во всплывающих уведомлениях */
.notification-popup button {
  margin-top: var(--space-8);
  padding: var(--space-8) var(--space-16);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--btn-gradient);
  color: var(--btn-text);
  cursor: pointer;
  box-shadow: 4px 4px 6px var(--shadow-dark), -4px -4px 6px var(--shadow-light);
  font-size: var(--cl-type-body);
  width: 100%;
}
  .notification-popup .call-number {
    font-size: var(--cl-type-metric-xl);
  }
.notification-popup input,
.notification-popup select,
.notification-popup textarea {
  width: 100%;
}
.notification-popup button:active {
  box-shadow: inset 4px 4px 6px var(--shadow-dark), inset -4px -4px 6px var(--shadow-light);
}

/* Баннер согласия на cookie */
.cookie-consent {
  /* additional cookie styles can go here */
}

.cookie-consent button {
  margin-left: var(--space-8);
  padding: var(--space-8) var(--space-16);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--btn-gradient);
  color: var(--btn-text);
  cursor: pointer;
  box-shadow: 4px 4px 6px var(--shadow-dark), -4px -4px 6px var(--shadow-light);
  font-size: var(--cl-type-body);
  width: 100%;
}
.cookie-consent button:active {
  box-shadow: inset 4px 4px 6px var(--shadow-dark), inset -4px -4px 6px var(--shadow-light);
}

/* ============ НЕОМОРФНЫЙ СТИЛЬ ДЛЯ AVATAR-TOGGLE ============ */
.avatar-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-neu);
  box-shadow:
    5px 5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: box-shadow 0.2s;

	/*
  margin-top: var(--space-8)!important;;
  margin-bottom: var(--space-24)!important;; */
}

.avatar-toggle:hover {
  box-shadow:
    4px 4px 8px var(--shadow-dark),
   -4px -4px 8px var(--shadow-light);
}

.avatar-toggle:active {
  box-shadow:
    inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);
}

.avatar-toggle__img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}

/* Telegram username below avatar on registration page */
.tg-username {
  font-size: var(--cl-type-caption);
  color: var(--color-muted);
  margin: var(--space-8) 0;
  text-align: center;
}



/* =============================
   Form Labels & Fields spacing
============================= */

/* 1) Метки остаются блочными, без «gap» */
.form-label {
  display: block;
  margin: 0;
  font-weight: 300;
  font-size: var(--cl-type-meta);
  color: #555555;
}

.form-hint {
  font-size: var(--cl-type-micro);
  color: var(--color-muted);
  margin-top: var(--space-8);
}

/* Красная подсказка около кнопки сохранения */
.form-hint.save-hint {
  color: var(--color-danger, red);
  font-size: var(--cl-type-caption);
  text-align: center;
  margin-top: var(--space-8);
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}

/* Звёздочка обязательных полей */
.required-star {
  color: var(--color-danger, #dc2626);
  margin-left: 4px;
}

/* 2) Между .form-label и следующим полем (input/select/textarea) — 8px */
.form-label + .form-control,
.form-label + input,
.form-label + select,
.form-label + textarea {
  margin-top: var(--space-8); /* 8px */
}
.form-label + #video-fields {
  margin-top: var(--space-8);
}
#video-fields {
  margin-left: 0;
  margin-right: 0;
}

/* 3) Между «группами» label+field — ваш существующий отступ (например 24px) */
.form-container > * + * {
  margin-top: var(--space-24); /* 24px */
}


/* =============================
   1. Жёсткий размер textarea и отключение ресайза
============================= */
.form-container textarea {
  resize: none;            /* запретить ручное изменение размера */
  height: 160px;           /* фиксированная высота (подберите под ваш дизайн) */
  box-sizing: border-box;  /* чтобы padding не влиял на итоговый размер */
}

/* =============================
   2. Позиционирование счетчика символов внутри textarea
============================= */
.form-label {
  position: relative;      /* контекст для абсолютного позиционирования */
}

/* 1. Делаем лейбл относительно позиционированным */
.form-container .form-label {
  position: relative;      /* контекст для абсолютного позиционирования */
  width: 100%;             /* выравниваем подписи слева */
  text-align: left;
}

/* 2. Счётчик символов в правом нижнем углу */
.char-counter {
  position: absolute;
  bottom: var(--space-8);  /* отступ снизу 8px */
  right: var(--space-8);   /* отступ справа 8px */
  font-size: var(--cl-type-caption);
  color: var(--color-muted);
  background: var(--surface-raised); /* мягкий тематический фон */
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  pointer-events: none;
}

/* Выравнивание полей в строке и кнопок по левому краю */
.form-container .form-row {
  width: 360px;
  margin-left: 0;
  margin-right: 0;
  display: flex;
  gap: var(--space-8);
}
.form-container .place-row {
  align-items: center;
}
.place-row #place {
  flex: 1;
  width: auto;
}
.add-venue-btn {
  border: none;
  font-size: var(--cl-type-display);
  color: var(--color-text);
  padding: 0;
}

/* Дополнительный специалист - поля вертикально */
.form-container .extra-row {
  width: var(--control-width);
  margin-left: 0;
  margin-right: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.btn-left {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}

/* =============================
   Custom file input
============================= */
input[type="file"].file-input {
  display: none;
}

.file-input + .file-btn {
  margin-top: var(--space-8);
}




/* ==================================
   Header / Register-style avatar
================================== */

/* Круглый неоморфный аватар-тоггл */
.avatar-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-neu);
  box-shadow:
    5px  5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

/* Hover / active */
.avatar-toggle:hover {
  box-shadow:
    4px  4px  8px var(--shadow-dark),
   -4px -4px  8px var(--shadow-light);
}
.avatar-toggle:active {
  box-shadow:
    inset 4px  4px  8px var(--shadow-dark),
    inset -4px -4px  8px var(--shadow-light);
}

/* Сама картинка внутри */
.avatar-toggle__img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}


/* =============================
   Profile Header Tweaks
============================= */

/* 1) Никнейм — очень мелкий шрифт */
.profile-header .username {
  font-size: var(--cl-type-caption);  /* 12px */
  color: var(--color-muted);
  margin-bottom: var(--space-8);
}

/* 2) Бейджи для профессии и города */
.profile-header .role-city .badge {
  display: inline-block;
  font-size: var(--cl-type-caption);
  font-weight: 500;
  color: #555555;
  border-radius: var(--radius-pill);
  line-height: 1;
	background: var(--surface-raised);
}


/* =============================
   Profile Header
============================= */

.profile-header {
  text-align: center;              /* 1) выравнивание по центру */
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
}

/* 2) отступ после H1 = 16px */
.profile-header .name {
  margin: 0 0 var(--space-8) 0;
}

/* Ник (мелкий и нейтральный) */
.profile-header .username {
  font-size: var(--cl-type-caption);
  color: var(--color-muted);
  margin: 0;
  margin-bottom: 8px;
}

/* Стили для текста со стилем специалиста */
.profile-header .style-text {
  font-size: var(--cl-type-body);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-8);
	text-shadow: -2px -2px 3px var(--shadow-dark), 2px 2px 3px var(--shadow-light);
}

/* Контейнер для бейджей */
.profile-header .role-city {
  display: flex;
  flex-wrap: wrap;
	margin-top: 16px;
}

/* Стили бейджа, чуть похожие на «Share»-кнопку из референса */
.profile-header .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  font-size: var(--cl-type-meta);
  font-weight: 500;
  color: #ffffff;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  text-decoration: none;
  box-shadow:
    3px  3px 6px var(--shadow-dark),
   -3px -3px 6px var(--shadow-light);
  transition: box-shadow 0.2s;
}
.profile-header .badge:hover {
  box-shadow:
    2px  2px 4px var(--shadow-dark),
   -2px -2px 4px var(--shadow-light);
}
.profile-header .badge:active {
  box-shadow:
    inset 3px  3px 6px var(--shadow-dark),
    inset -3px -3px 6px var(--shadow-light);
}


/* =============================
   Badges в шапке профиля
============================= */
.profile-header {
  text-align: center; /* уже есть */
}

.profile-header .badge {
  display: inline-block;
  margin: 0 var(--space-8) var(--space-16); /* отступы слева-справа и снизу */
  padding: var(--space-8) var(--space-16);
  font-size: var(--cl-type-caption);
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;

  background: var(--bg-neu);
  border-radius: var(--radius-pill);
  box-shadow:
    5px  5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  transition: box-shadow 0.2s;
}
.profile-header .badge:hover {
  box-shadow:
    4px 4px 8px var(--shadow-dark),
   -4px -4px 8px var(--shadow-light);
}
.profile-header .badge:active {
  box-shadow:
    inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);
}

.profile-header {
  text-align: center;
}
.profile-header .avatar {
  display: inline-block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: var(--space-8);
}
.profile-header .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* user */

.fav-section {
  width: 344px;
  margin: var(--space-24) auto var(--space-16);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: var(--space-12) var(--space-16);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-neu);
  box-shadow:
    5px  5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  font-size: var(--cl-type-body);
  cursor: pointer;
  transition: box-shadow .2s;
}
.fav-btn:hover {
  box-shadow:
    4px 4px 8px var(--shadow-dark),
   -4px -4px 8px var(--shadow-light);
}
.fav-btn:active {
  box-shadow:
    inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);
}
.fav-btn .icon {
  width: 24px;
  height: 24px;
  margin-right: var(--space-8);
}
.fav-btn .text {
  font-size: var(--cl-type-meta);
}
.fav-btn.active {
  /* розовый градиент при нажатии */
  background: linear-gradient(145deg, #e5c2d4, #f6eaf0);
}
.fav-count {
  margin-top: var(--space-8);
  font-size: var(--cl-type-meta);
  color: var(--color-muted);
}





.contact-buttons {
  width: 344px;
  display: flex;
  gap: var(--space-16);
}
.myself-buttons {
  width: 344px;
  display: flex;
  gap: var(--space-16);
}
.btn-contact {
  flex: 1;
  padding: var(--space-12) 0;
  font-size: var(--cl-type-meta);
  text-align: center;
  background: var(--bg-neu);
  box-shadow:
    5px  5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: box-shadow .2s;
}
.btn-contact:hover {
  box-shadow:
    4px 4px 8px var(--shadow-dark),
   -4px -4px 8px var(--shadow-light);
}










.profile-header .badge {
  display: inline-block;
  margin: 0 var(--space-8);
  padding: var(--space-8) var(--space-16);
  font-size: var(--cl-type-meta);
  color: var(--color-text);
  background: var(--bg-neu);
  border-radius: var(--radius-pill);
  box-shadow:
    5px  5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  transition: box-shadow .2s;
}
.profile-header .badge:hover {
  box-shadow:
    4px 4px 8px var(--shadow-dark),
   -4px -4px 8px var(--shadow-light);
}


/* Большой аватар в шапке */
.avatar-big {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-neu);
  box-shadow:
    5px 5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-16) auto;
}
.avatar-big img {
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  pointer-events: none;
}


/* Кнопка «Подписаться» */
.fav-btn {
  width: 344px;
  background: #dcdcdc;
  color: #555555;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.fav-btn:hover {
  box-shadow:
    4px 4px 8px var(--shadow-dark),
   -4px -4px 8px var(--shadow-light);
}
.fav-btn:active {
  box-shadow:
    inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);
}
.fav-btn.active {
  background: linear-gradient(145deg, #ead2de, #f8eef3);
}
.fav-btn .text {
  font-size: var(--cl-type-body);
}
.fav-count {
  color: #555555;
  margin-top: var(--space-8);
}

.contact-btn {
  flex: 1;
  background: var(--surface-raised);
  color: #555555;
  padding: var(--space-12);
  border: none;
  border-radius: var(--radius-pill);
  box-shadow:
    5px 5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.contact-btn:hover {
  box-shadow:
    4px 4px 8px var(--shadow-dark),
   -4px -4px 8px var(--shadow-light);
}
.contact-btn:active {
  box-shadow:
    inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);
}

.avatar-big img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--bg-neu);
  object-fit: cover;
}

/* —————— Подписки —————— */
.fav-btn {
 background: var(--surface-raised);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-pill);
  padding: var(--space-12) var(--space-16);
  font-size: var(--cl-type-meta);
  cursor: pointer;
  transition: box-shadow .2s;
}
.fav-btn:hover {
  box-shadow:
    4px 4px 8px var(--shadow-dark),
   -4px -4px 8px var(--shadow-light);
}
.fav-btn:active {
  box-shadow:
    inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);
}
.fav-btn.active {
  background: linear-gradient(145deg, #e5c2d4, #f6eaf0);
}
.fav-btn .text {
  color: #555555;
}
.fav-count {
  color: #555555;
  margin-top: var(--space-8);
  text-align: center;
}

.contact-btn {
  flex: 1;
  height: 44px;
  background: #dcdcdc;
  color: #555555;
  border: none;
  border-radius: var(--radius-pill);
  font-size: var(--cl-type-meta);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow .2s;
}
.contact-btn:hover {
  box-shadow:
    4px  4px  8px var(--shadow-dark),
   -4px -4px  8px var(--shadow-light);
}

/* —————— Видео: пропорции сохраняются, вертикальные ролики получают portrait-контейнер —————— */

.video-container {
  position: relative;
  width: 100%;
  max-width: 344px;
  --video-aspect: 16 / 9;
  aspect-ratio: var(--video-aspect);
  margin: 0 auto 16px;
  background: var(--bg-neu);
  box-shadow:
    5px 5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
    background: #111;
}
.video-container--poster {
  cursor: pointer;
}
.video-container__poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}
.video-container__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 72px;
  height: 50px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: var(--btn-accent-gradient, linear-gradient(145deg, #087f75, #004b56));
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 16px 21px 16px 21px;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -2px 0 rgba(0, 0, 0, .16);
  transform: translate(-50%, -50%) rotate(-1.5deg);
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.video-container__play:hover,
.video-container__play:focus-visible {
  filter: brightness(1.08);
  transform: translate(-50%, -50%) rotate(0deg) scale(1.06);
  box-shadow:
    0 12px 25px rgba(0, 0, 0, .32),
    inset 0 1px 0 rgba(255, 255, 255, .34),
    inset 0 -2px 0 rgba(0, 0, 0, .14);
}
.video-container__play:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .9);
  outline-offset: 4px;
}
.video-container__play:active {
  transform: translate(-50%, -50%) rotate(0deg) scale(.96);
}
.video-container__play .ui-icon {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  filter: none;
}
.video-container--portrait {
  --video-aspect: 9 / 16;
  max-width: 320px;
}
.video-container--external {
  min-height: 80px;
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  max-width: 344px;
}
.video-container__link {
  color: var(--color-text);
  font-size: var(--cl-type-body);
  text-decoration: none;
}
/* —————— Ссылки в футере одного цвета —————— */
.site-footer a {
  color: #555555;
  text-decoration: none;
}

/* Dark theme contrast for legacy labels and form counters. */
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .theme-hint,
html[data-theme="dark"] .form-hint,
html[data-theme="dark"] .char-counter {
  color: var(--color-muted);
}

html[data-theme="dark"] .char-counter {
  background: rgba(22, 45, 39, 0.92);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

html[data-theme="dark"] .page-title,
html[data-theme="dark"] .page-header__title,
html[data-theme="dark"] .feed-page .feed-error,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .site-footer a {
  color: var(--color-text);
}


/* ————— Большой аватар */
.avatar-big {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-neu);
  box-shadow: 5px 5px 15px var(--shadow-dark), -5px -5px 15px var(--shadow-light);
  overflow: hidden;
  margin: 0 auto 16px;
}
.avatar-big img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ————— Контактные кнопки */

.contact-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  text-decoration: none !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 500;
}
.myself-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  text-decoration: none !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 500;
}
.contact-buttons .btn {
  box-shadow: 5px 5px 15px var(--shadow-dark), -5px -5px 15px var(--shadow-light);
}


/* ————— Тень у виджета рейтинга */

.rating-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: var(--space-24);
  margin-bottom: var(--space-16); /* меньший отступ снизу */
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow:
    var(--shadow-raised);
  width: 344px;
  height: 418px;
}

/* Блок с брендом в кабинете */
.brand-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
  border-radius: var(--radius-card);
  background: none;
  box-shadow: none;
  width: 344px;
  opacity: 0;
  transition: max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

.brand-section.expanded {
  max-height: 1000px;
  margin-top: var(--space-16);
  margin-bottom: var(--space-16);
  padding: var(--space-16);
  opacity: 1;
}

/* Контейнер для включения режима бренда */
.brand-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-8);
  margin-bottom: var(--space-16);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  width: 344px;
}
.brand-toggle.disabled {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
  cursor: not-allowed;
}
.brand-avatar-block {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: var(--space-8);
  box-shadow: 4px 4px 6px var(--shadow-dark), -4px -4px 6px var(--shadow-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-avatar-block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ————— Большой размер хедера-аватара */
.avatar-toggle--large {
  width: 96px;
  height: 96px;
}
.avatar-toggle--large .avatar-toggle__img {
  width: 94px;
  height: 94px;
}

/* Средний размер аватара, как в карточке */
.avatar-toggle--card {
  width: 72px;
  height: 72px;
}
.avatar-toggle--card .avatar-toggle__img {
  width: 70px;
  height: 70px;
}


/* :root block удалён, чтобы не переопределять --shadow-dark и --shadow-light */

/* =============================
   Bottom navigation
   The menu is rendered by header.php and remains data-driven by PHP roles.
============================= */
:root {
  --bottom-nav-offset: 8px;
  --bottom-nav-space: 96px;
  --bottom-nav-max-width: calc(var(--control-width) + (var(--space-16) * 2));
  --shadow-navigation: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
}

body:has(.bottom-navigation) {
  padding-bottom: var(--bottom-nav-space);
  padding-bottom: calc(var(--bottom-nav-space) + constant(safe-area-inset-bottom));
  padding-bottom: calc(var(--bottom-nav-space) + env(safe-area-inset-bottom, 0px));
}

.page-header {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 16px;
  display: block;
  background: transparent;
}

/* В ленте публикаций кнопка «Назад» всегда остаётся доступной при скролле. */
body.profile-posts-feed-open .page-header {
  position: sticky;
  top: 0;
  z-index: 220;
  background: var(--app-bg-gradient);
  box-shadow: 0 6px 14px rgba(20, 24, 28, 0.12);
  isolation: isolate;
}

/* Верхняя панель: заголовок страницы всегда находится между двумя круглыми
   кнопками. Размер текста повторяет профильный .page-title. */
.page-header__topbar {
  width: min(100%, var(--control-width, 344px));
  min-height: 64px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top, 0px)) 0 8px;
  box-sizing: content-box;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
}

.page-header__button {
  width: 48px;
  height: 48px;
  margin: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  text-decoration: none !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.page-header__button:hover {
  box-shadow: var(--shadow-raised);
}

.page-header__button:active,
.page-header__button.active {
  transform: translateY(1px) scale(0.97);
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
}

.page-header__button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.page-header__button--logo img {
  width: 36px;
  height: 36px;
  margin: 0;
  display: block;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  object-fit: contain;
}

.page-header__button--back {
  color: var(--color-text);
  font-size: 0;
  text-shadow: var(--text-emboss);
}

.page-header__button--notifications .notification-shortcut-icon {
  width: 18px;
  height: 18px;
}

.page-header__button--placeholder {
  visibility: hidden;
  pointer-events: none;
}

.page-header__title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #555555;
  font-family: var(--font-base);
  font-size: var(--cl-type-display);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow:
    2px 2px 3px var(--shadow-dark),
    -2px -2px 3px var(--shadow-light);
}

/* Старые заголовки остаются в HTML для структуры страниц, но единый текст
   теперь показывается в верхней панели и не дублируется в контенте. */
body:has(.page-header__title) .page-title,
body:has(.page-header__title) h1.title,
body:has(.page-header__title) > main > .title,
body:has(.page-header__title) h1.event-view__title {
  display: none;
}

.bottom-navigation,
.bottom-navigation__capsule,
.fw-header-row,
.bottom-navigation .menu-item,
.bottom-navigation .menu-icon,
.bottom-navigation .menu-plus {
  box-sizing: border-box;
  margin: 0;
}

.bottom-navigation {
  position: fixed;
  left: 50%;
  bottom: var(--bottom-nav-offset);
  bottom: calc(var(--bottom-nav-offset) + constant(safe-area-inset-bottom));
  bottom: calc(var(--bottom-nav-offset) + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  width: min(var(--bottom-nav-max-width), calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 0;
  pointer-events: none;
}

/* The navigation is portalled to body for iOS standalone Web Apps. Keep this
   contract explicit so page-level styles cannot turn it back into a flow item. */
body > .bottom-navigation {
  position: fixed !important;
  left: 50%;
  bottom: var(--bottom-nav-offset, 8px);
  bottom: calc(var(--bottom-nav-offset, 8px) + constant(safe-area-inset-bottom));
  bottom: calc(var(--bottom-nav-offset, 8px) + env(safe-area-inset-bottom, 0px));
  transform: translate3d(-50%, 0, 0);
}

.bottom-navigation__capsule {
  position: relative;
  width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-navigation);
  overflow: visible;
  isolation: isolate;
}

.fw-header-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  gap: clamp(2px, 1.6vw, 8px);
  padding: 0;
  overflow: visible;
}

.bottom-navigation .menu-item {
  /* Не даём flex-контейнеру растягивать кнопки в эллипсы. */
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  height: 48px;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  color: var(--color-text);
  cursor: pointer;
  pointer-events: auto;
  text-decoration: none;
  overflow: visible;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.bottom-navigation .menu-item:hover,
.bottom-navigation .menu-item:focus,
.bottom-navigation .menu-item:active {
  text-decoration: none !important;
}

.bottom-navigation .menu-item--add-publication .menu-plus {
  display: block;
  width: 20px;
  height: 20px;
  color: var(--color-text);
  background: currentColor;
  -webkit-mask: url('/assets/icons/tabler/plus.svg') center / contain no-repeat;
  mask: url('/assets/icons/tabler/plus.svg') center / contain no-repeat;
  filter:
    drop-shadow(-1px -1px 1.5px var(--icon-shadow-dark))
    drop-shadow(2px 2px 2.5px var(--icon-shadow-light));
  text-decoration: none !important;
}

.bottom-navigation .menu-item--add-publication,
.bottom-navigation .menu-item--add-publication:hover,
.bottom-navigation .menu-item--add-publication:focus,
.bottom-navigation .menu-item--add-publication:active {
  text-decoration: none !important;
}

.bottom-navigation .menu-icon {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  padding: 0;
  pointer-events: none;
  filter:
    drop-shadow(-1px -1px 1.5px var(--icon-shadow-dark))
    drop-shadow(2px 2px 2.5px var(--icon-shadow-light));
}

.bottom-navigation .menu-logo .logo-img {
  width: 36px;
  height: 36px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  flex: 0 0 auto;
  object-fit: contain;
}

.bottom-navigation .menu-profile-avatar {
  overflow: hidden;
}

.bottom-navigation .menu-profile-avatar__img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  filter: none;
}

/* Tabler Icons: one local outline language for navigation. */
.bottom-navigation .menu-icon--trophy,
.bottom-navigation .menu-icon--calendar,
.bottom-navigation .menu-icon--heart,
.bottom-navigation .menu-icon--user {
  background: currentColor;
}

.bottom-navigation .menu-icon--trophy { -webkit-mask-image: url('/assets/icons/tabler/trophy.svg'); mask-image: url('/assets/icons/tabler/trophy.svg'); }
.bottom-navigation .menu-icon--calendar { -webkit-mask-image: url('/assets/icons/tabler/calendar-event.svg'); mask-image: url('/assets/icons/tabler/calendar-event.svg'); }
.bottom-navigation .menu-icon--heart { -webkit-mask-image: url('/assets/icons/tabler/heart.svg'); mask-image: url('/assets/icons/tabler/heart.svg'); }
.bottom-navigation .menu-icon--user { -webkit-mask-image: url('/assets/icons/tabler/user-circle.svg'); mask-image: url('/assets/icons/tabler/user-circle.svg'); }

.bottom-navigation .menu-item:active,
.bottom-navigation .menu-item.active {
  transform: translateY(1px) scale(0.97);
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
}

.bottom-navigation .menu-item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.bottom-navigation .menu-item .menu-badge {
  position: absolute;
  top: -9px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  margin: 0;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(145deg, #b71d1d, #7f1212);
  color: #fff;
  font-size: var(--cl-type-caption);
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.18),
    inset 1px 1px 2px rgba(255, 255, 255, 0.4);
  pointer-events: none;
  z-index: 5;
}

/* Hover is intentionally unavailable on touch devices. */
@media (hover: hover) and (pointer: fine) {
  .bottom-navigation .menu-item:hover {
    box-shadow: var(--shadow-raised);
  }
}

.notification-shortcut-icon {
  width: 18px;
  height: 18px;
  margin: 0;
  background: currentColor;
  -webkit-mask: url('/assets/icons/bell.svg') center / contain no-repeat;
  mask: url('/assets/icons/bell.svg') center / contain no-repeat;
  filter:
    drop-shadow(-1px -1px 1.5px var(--icon-shadow-dark))
    drop-shadow(2px 2px 2.5px var(--icon-shadow-light));
}

.notification-shortcut-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0 4px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: #b71d1d;
  font-size: var(--cl-type-caption, 12px);
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  pointer-events: none;
}

@media (max-width: 380px) {
  .page-header {
    padding-right: 8px;
    padding-left: 8px;
  }

  .page-header__topbar {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .page-header__button {
    width: 44px;
    height: 44px;
  }

  .page-header__button--logo img {
    width: 34px;
    height: 34px;
    margin: 0;
  }

  .page-header__button--back {
    font-size: var(--cl-type-title-md);
  }

  .page-header__title {
    font-size: var(--cl-type-section);
  }

  .bottom-navigation {
    width: calc(100vw - 16px);
  }

  .bottom-navigation__capsule {
    padding-right: 8px;
    padding-left: 8px;
  }

  .fw-header-row {
    gap: 2px;
  }
}

/* Seven 44px hit areas still fit on the narrowest supported viewport. */
@media (max-width: 340px) {
  .bottom-navigation {
    width: calc(100vw - 8px);
  }

  .bottom-navigation__capsule {
    padding-right: 2px;
    padding-left: 2px;
  }

  .fw-header-row {
    gap: 0;
  }
}

/* 1. Восстанавливаем контраст бейджей */
.profile-header .badge {
}

/* 2. Возвращаем оформление блока рейтинга */

.radial-progress {
  box-shadow:
    6px 6px 16px var(--shadow-dark),
   -6px -6px 16px var(--shadow-light);
}

/* 4. Отступ после “В подписках у X человека” */
.fav-count {
  margin-bottom: var(--space-8);
}

/* 5. Сильнее тени для кнопок, аватара, видео */
.btn,
.action-btn,
.profile-header .avatar,
.profile-video,
.radial-progress {
  box-shadow:
    var(--shadow-raised);
	 background: var(--surface-raised);
}

/* ================================
   Дополнительные ваши пункты
   ================================ */


/* A. “Позвонить / Написать / Сайт” – сбрасываем подчёркивание и
   выравниваем текст по центру */
.contact-buttons .btn {
  text-decoration: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 500;
}

/* Кнопка выхода из сессии */
.logout-btn {
  color: #ffffff;
  font-weight: 500; /* чуть менее жирный текст */
  background: linear-gradient(145deg, #800020, #b22222);
}

/* Кнопка перезапуска обучения */
.btn-tour {
  color: #ffffff;
  font-weight: 600;
  text-shadow: none;
  background: var(--btn-accent-gradient);
}

/* Поле статуса и кнопка обновления */

/* Поле статуса и кнопка обновления */

.status-wrapper {
  display: flex;
  align-items: center;
  width: var(--control-width, 344px);
  margin: 0 0 var(--space-8);
}

.status-input {
  flex: 1 1 auto;
  width: 100%;
  margin-right: 0;
}

#daily_status {
  flex: 1 1 auto;
  width: 100%;
  margin-right: 0;
}

/* Контейнер для аватарки, используется в карточках и на форме */
.avatar-container {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
}


/* сам фон с выпуклыми тенями */
.avatar-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-neu, #F0F0F3);
  box-shadow:
    5px 5px 12px var(--shadow-dark, rgba(0,0,0,0.06)),
    -5px -5px 12px var(--shadow-light);
}

/* оригинальный .avatar теперь просто клип-площадка для изображения */
.avatar-container .avatar {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: none; /* убираем старые тени */
}

/* index.php */
.page-title {
  margin-top: 0;
  margin-bottom: 0 !important;
}
.landing-tagline {
  max-width: 100%;
  margin: 0;
  font-size: var(--cl-type-section);
  line-height: 1.2;
  text-transform: none;
}
.page-subtitle {
  font-size: var(--cl-type-section); /* подобрать стиль по макету */
  text-align: center;
}
.landing-seo-intro {
  width: min(100%, 680px);
  margin: 0 auto;
  color: var(--text-muted);
  font-family: var(--font-base);
  font-size: var(--cl-type-meta);
  line-height: 1.45;
  text-align: center;
}

/* Сообщение о уже учтённом голосе */
.already-voted-note {
  font-size: var(--cl-type-meta);
  text-align: center;
}

/* ==== Legal pages === */
.legal-page {
  font-family: var(--font-base);
  font-size: var(--cl-type-meta);
  line-height: 1.6;
  padding: 20px;
  background-color: #f9f9f9;
  color: #333;
}
.legal-logo {
  /* keep same centering as .logo-link */
  margin: 0 auto 20px;
}
.legal-page h1, .legal-page h2 {
  color: #004B56;
  text-align: center;
}
.legal-page h2 {
  margin-top: 1.5em;
  font-size: var(--cl-type-title-sm);
}
.legal-page ul {
  padding-left: 20px;
}
.legal-page a {
  color: #555555;
  text-decoration: none;
}
@media (max-width: 600px) {
  .legal-page {
    padding: 12px;
    font-size: var(--cl-type-lead);
  }
}

/* ==== Not found page === */
.not-found-page {
  min-height: 100vh;
  justify-content: center;
}

.not-found-card {
  width: 100%;
  max-width: var(--control-width);
  padding: var(--space-24) var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  box-shadow:
    6px 6px 12px var(--shadow-dark),
    -6px -6px 12px var(--shadow-light);
  text-align: center;
}

.not-found-card p {
  color: var(--color-muted);
}

/* --- Filters form (rating & favorites) --- */
.filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 16px 0;
}
#feed-filters label {
  margin-right: var(--space-8);
}
#feed-filters label:last-child {
  margin-right: 0;
}
/* --- Favorites groups --- */
.fav-group {
  width: 344px;
  margin: var(--space-24) auto;
  padding: var(--space-16);
  background: var(--bg-neu);
  box-shadow:
    5px 5px 10px var(--shadow-dark),
   -5px -5px 10px var(--shadow-light);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fav-prof-title {
  width: 100%;
  margin: 0 0 var(--space-8);
  font-size: var(--cl-type-section);
  font-weight: 700;
  color: #555555;
  text-align: center;
}

/* Заголовки ролей на странице просмотра события */
.profession-title {
  width: 100%;
  margin: var(--space-16) 0;
  font-size: var(--cl-type-section);
  font-weight: 700;
  color: #555555;
  text-align: center;
}

/* ==== Demo page === */
.demo-body {
  font-family: var(--font-base);
  padding: 2rem;
}
.demo-body label {
  display: block;
  margin: .5rem 0;
}
.demo-body input {
  width: 100%;
  padding: .5rem;
  margin-top: .25rem;
}
.demo-body button {
  margin-top: 1rem;
  padding: .5rem 1rem;
}
.demo-body pre {
  background: var(--surface-soft);
  padding: 1rem;
  margin-top: 1rem;
}

/* Шаги формы создания мероприятия */
.step { display: none; }
.step.active { display: block; }


/* ==== Summary block on create_event === */
.event-summary {
  margin: var(--space-16) -8px;
  padding: var(--space-16);
  width: calc(100% + 16px);
  max-width: calc(var(--control-width, 344px) + 16px);
  text-align: center;
  background: var(--bg-neu);
  border-radius: var(--radius-card);
  box-shadow: 5px 5px 10px var(--shadow-dark),
              -5px -5px 10px var(--shadow-light);

}


/* Контейнер для дополнительных специалистов на шаге 5 */
#extra-container {
  width: 100%;
  max-width: 344px;
  margin-left: auto;
  margin-right: auto;
}

/* Сообщения об успешном действии */
.success-message {
  width: 100%;
  max-width: 344px;
  margin: var(--space-16) auto;
  padding: var(--space-16);
  text-align: center;
  background: var(--bg-neu);
  border-radius: var(--radius-card);
  box-shadow: 5px 5px 10px var(--shadow-dark),
              -5px -5px 10px var(--shadow-light);
  font-size: var(--cl-type-body);
}


/* Таймер обратного отсчёта */
.countdown {
  font-size: var(--cl-type-body);
  margin-bottom: var(--space-16);
}

/* Ежедневный статус специалиста */
.daily-status {
  margin-top: var(--space-8);
  font-size: var(--cl-type-meta);
  color: var(--color-primary, #006897);
  word-break: break-word;
}

/* Статус в блоке рейтинга */
.radial-wrapper {
  position: relative;
}
.status-bubble {
  position: absolute;
  top: -8px;
  right: -8px;
  max-width: 10ch;
  padding: 2px 6px;
  font-size: var(--cl-type-caption);
  line-height: 1.2;
  background: var(--bg-neu, #F0F0F3);
  border-radius: var(--radius-pill, 16px);
  box-shadow: 2px 2px 4px rgba(0,0,0,0.2), -2px -2px 4px var(--shadow-light);
  text-align: center;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  z-index: 3;
}

/* Pinned badges */
.pinned-badges {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 0 0 var(--space-8,8px);
}
.pinned-badges .badge-icon,
.pinned-badges .badge-placeholder {
  width: 24px;
  height: 24px;
  display: inline-block;
}
.pinned-badges .badge-icon {
  object-fit: contain;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  background: rgba(0,0,0,0.1);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--surface-soft);
  padding: 16px;
  width: var(--control-width);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.modal button {
  width: 100%;
}
.modal input,
.modal select,
.modal textarea {
  width: 100%;
}

/* =============================
   Feed card styles
============================= */
.card, .card * {
  margin: 0;
  padding: 0;
}
.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 344px;
  margin: 0 auto;
  background: var(--surface-raised);
  box-shadow:
    var(--shadow-raised);
  border-radius: var(--radius-card, 20px);
  padding: 16px 12px;
  box-sizing: border-box;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none !important;
  color: inherit;
}
.card:hover {
  transform: translateY(-2px);
  text-decoration: none !important;
  box-shadow:
    var(--shadow-soft);
}
.card:active {
  transform: translateY(2px);
  box-shadow:
    var(--shadow-inset);
}
.avatar-container {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
}
.avatar-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-neu, #F0F0F3);
  box-shadow:
    5px 5px 12px var(--shadow-dark, rgba(0,0,0,0.5)),
    -5px -5px 12px var(--shadow-light);
}
.avatar-container .avatar {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #efefef;
  box-sizing: border-box;
}
.avatar-container .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.info {
  flex: 1 1 auto;
  margin: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.info .name {
  font-size: var(--cl-type-body);
  font-weight: 700;
  color: #555555;
  margin: 0;
  text-shadow:
    2px  2px 3px var(--shadow-dark),
   -2px -2px 5px var(--shadow-light);
  background: transparent;
  padding: 0;
  border-radius: 0;
}
.info .sub {
  font-size: var(--cl-type-caption);
  color: var(--color-text, #555555);
  margin: 0;
}
.stats-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--cl-type-caption);
  color: var(--color-muted, #888888);
}
.stat-item.favorites .heart-icon::before { content: "\2764"; font-size: var(--cl-icon-xs); }
.like-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.like-btn.active .heart-icon {
  color: #dc2626;
}
.radial-wrapper {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.outer-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gradient-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(farthest-side, transparent 78%, black 79%);
  mask-image: radial-gradient(farthest-side, transparent 78%, black 79%);
}
.center-island {
  width: 56px;
  height: 56px;
  background: var(--surface-raised);
  border-radius: 50%;
  z-index: 2;
  box-shadow:
    var(--shadow-raised);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring-label {
  font-size: var(--cl-type-section);
  font-weight: 600;
  text-shadow:
    -2px -2px 3px var(--shadow-dark, rgba(0,0,0,0.3)),
    2px 2px 3px var(--shadow-light);
}



.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(6px);
  background-color: rgba(0, 0, 0, 0.2); /* полупрозрачный затемнённый фон */
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay > * {
  z-index: 1000;
}

/* Stats page */
.stats-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  background: var(--bg-neu);
  min-height: calc(100vh - 120px);
}

.stats-title {
  font-size: var(--cl-type-title-lg);
  font-weight: 700;
  margin: 0;
  color: #1f2937;
}

.stats-subtitle {
  margin: 0;
  color: #6b7280;
  max-width: 520px;
}

.stats-alert {
  border-radius: 12px;
  padding: 12px 16px;
  background: rgba(248, 113, 113, 0.2);
  color: #b91c1c;
  font-weight: 500;
}

.stats-summary {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stats-card {
  background: var(--surface-soft);
  border-radius: 18px;
  padding: 20px;
  box-shadow:
    6px 6px 12px var(--shadow-dark),
    -6px -6px 12px var(--shadow-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card:hover {
  transform: translateY(-4px);
  box-shadow:
    4px 4px 8px var(--shadow-dark),
    -4px -4px 8px var(--shadow-light);
}

.stats-card__label {
  font-size: var(--cl-type-caption);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.stats-card__value {
  font-size: var(--cl-type-metric-xl);
  font-weight: 700;
  color: #111827;
}

.stats-card__hint {
  font-size: var(--cl-type-small);
  color: #6b7280;
}

.stats-card--trend .stats-card__value,
.stats-card--trend .stats-card__hint {
  color: #0f766e;
}

.stats-card--votes .stats-card__value {
  color: #6366f1;
}

.stats-section {
  background: var(--surface-soft);
  border-radius: 24px;
  padding: 24px;
  box-shadow:
    6px 6px 12px var(--shadow-dark),
    -6px -6px 12px var(--shadow-light);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stats-section__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-section__title {
  margin: 0;
  font-size: var(--cl-type-section);
  font-weight: 600;
  color: #1f2937;
}

.stats-section__description {
  margin: 0;
  color: #6b7280;
  font-size: var(--cl-type-meta);
}

.stats-section__body {
  position: relative;
  min-height: 280px;
}

.stats-chart {
  width: 100%;
  height: 100%;
}

.stats-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: var(--cl-type-meta);
  background: var(--surface-soft);
  border-radius: 16px;
}

@media (max-width: 768px) {
  .stats-page {
    padding: 24px 12px 40px;
  }

  .stats-card {
    padding: 16px;
  }

  .stats-card__value {
    font-size: var(--cl-type-metric-lg);
  }

  .stats-section {
    padding: 20px;
  }
}

/* Extended stats blocks */
.stats-kpis,
.stats-grid {
  display: grid;
  gap: 12px;
}

.stats-kpis {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stats-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stats-kpi,
.stats-mini-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
}

.stats-kpi__label,
.stats-mini-card__title {
  margin: 0;
  font-size: var(--cl-type-caption);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
}

.stats-kpi__value,
.stats-mini-card__value {
  display: block;
  margin-top: 8px;
  font-size: var(--cl-type-section);
  font-weight: 700;
  color: #0f172a;
}

.stats-mini-card__value {
  margin-bottom: 0;
}

.stats-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.stats-table th,
.stats-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: var(--cl-type-meta);
}

.stats-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
}

.stats-table__empty {
  text-align: center;
  color: #94a3b8;
}

/* Final touch states: keep tactile feedback consistent after legacy blocks. */
.profile-header .badge,
.profile-header .role-city .badge,
.role-city .badge {
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.profile-header .badge:active,
.profile-header .role-city .badge:active,
.role-city .badge:active {
  transform: translateY(1px) scale(0.98);
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
}

.btn-final-create:active,
button.btn-final-create:active,
.btn.btn-final-create:active {
  color: #ffffff;
  background: linear-gradient(145deg, var(--color-accent-strong), var(--color-accent));
  box-shadow: var(--shadow-inset);
  text-shadow: none;
}

/* User profile final layout: compact profile spacing and list return. */
.user-page {
  gap: var(--space-8);
  padding-top: 0;
}

.profile-back-btn {
  width: 100%;
  max-width: var(--control-width);
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-8);
  padding: 0 var(--space-16);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
  text-decoration: none !important;
  font-size: var(--cl-type-meta);
  line-height: 1.2;
  text-shadow: var(--text-emboss);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.profile-back-btn:hover,
.profile-back-btn:focus,
.profile-back-btn:active {
  color: var(--color-text);
  text-decoration: none !important;
}

.profile-back-btn:active {
  transform: translateY(1px) scale(0.99);
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
}

/* Profile publications: external media links, with no server-side file storage. */
.profile-posts-manager {
  width: 100%;
  max-width: var(--control-width);
  margin: var(--space-24) auto 0;
}

.profile-posts {
  width: 100%;
  max-width: var(--control-width);
  margin: var(--space-16) auto 0;
}

.profile-posts-manager__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  margin: 0 0 var(--space-16);
}

.profile-posts-manager__header h2 {
  margin: 0;
  font-size: var(--cl-type-section);
  font-weight: 700;
}

.profile-posts-add {
  margin: 0;
  border: 0;
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  text-shadow: var(--text-emboss);
  cursor: pointer;
}

.profile-posts-add {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  font-size: var(--cl-type-display);
  line-height: 1;
}

.profile-posts__items {
  width: 100%;
  margin: 0;
}

.profile-posts__empty {
  display: grid;
  justify-items: center;
  gap: var(--space-8);
  padding: var(--space-24) var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  box-shadow: var(--shadow-raised);
  text-align: center;
}

.profile-posts__empty h2,
.profile-posts__empty p {
  margin: 0;
}

.profile-posts__empty h2 {
  font-size: var(--cl-type-section);
  font-weight: 700;
}

.profile-posts__empty p {
  max-width: 34em;
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.45;
}

.profile-posts__items--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-16);
  row-gap: 8px;
}

.profile-posts__items--feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.profile-posts__items--feed .profile-post {
  width: 100%;
  cursor: default;
  display: block !important;
  scroll-margin-top: calc(64px + max(12px, env(safe-area-inset-top, 0px)) + var(--space-16));
}

.profile-post {
  position: relative;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
}

.profile-post__media {
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg-neu);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  font-size: 0;
}

.profile-post__media > img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  object-fit: cover;
}

.profile-post__media .video-container {
  position: relative;
  top: 0;
  transform: none;
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.profile-post__media iframe,
.profile-post__media video {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
}

.profile-posts__items--grid .profile-post__media {
  aspect-ratio: 1 / 1;
}

.profile-posts__items--grid .profile-post__media .video-container,
.profile-posts__items--grid .profile-post__media .video-container--portrait,
.profile-posts__items--grid .profile-post__media .video-container--external {
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: 1 / 1;
  margin: 0;
  overflow: hidden;
}

.profile-posts__items--grid .profile-post__media > img,
.profile-posts__items--grid .profile-post__media iframe,
.profile-posts__items--grid .profile-post__media video {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.profile-posts__items--grid .profile-post__media iframe,
.profile-posts__items--grid .profile-post__media video {
  object-fit: cover;
}

/* Grid cards are deliberately content-independent: only the column width
   controls their size, while the title and actions always occupy fixed zones. */
.profile-posts__items--grid .profile-post {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: visible;
}

.profile-posts__items--grid .profile-post__content {
  display: flex;
  flex: 0 0 88px;
  flex-direction: column;
  height: 88px;
  min-height: 88px;
  max-height: 88px;
  box-sizing: border-box;
  overflow: hidden;
  padding: 10px 12px;
}

.profile-post__content {
  margin: 0;
  padding: var(--space-16);
}

.profile-post__content h3,
.profile-post__content p,
.profile-post__content time {
  display: block;
  margin: 0;
}

.profile-post__content h3 {
  font-size: var(--cl-type-body);
  line-height: 1.2;
}

.profile-posts__items--grid .profile-post__content h3,
.profile-posts__items--grid .profile-post__content p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.profile-posts__items--grid .profile-post__content h3 {
  display: -webkit-box;
  min-height: 2.4em;
  max-height: 2.4em;
  margin-bottom: var(--space-8);
  font-size: var(--cl-type-meta);
  line-height: 1.2;
  -webkit-line-clamp: 2;
}

/* Body text and date belong to the feed view, not the compact grid. */
.profile-posts__items--grid .profile-post__content p,
.profile-posts__items--grid .profile-post__content time {
  display: none;
}

.profile-posts__items--grid .profile-post__content .feed-share-status {
  display: none;
}

.profile-post__content p {
  margin-top: var(--space-8);
  font-size: var(--cl-type-meta);
  line-height: 1.35;
}

.profile-post__content a {
  color: var(--color-accent);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-post__content time {
  margin-top: var(--space-8);
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
}

/* Profile publications use the same compact social controls as feed cards. */
.profile-post__content .feed-post-actions[data-social-actions] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  min-height: 25px;
  margin: var(--space-8) auto 0;
}

.profile-posts__items--grid .profile-post__content .feed-post-actions[data-social-actions] {
  margin-top: auto;
}

.profile-post__content .feed-post-action-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
}

.profile-post__content .feed-post-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: none !important;
  transform: none !important;
}

.profile-post__content .feed-post-action:hover,
.profile-post__content .feed-post-action:focus {
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  transform: none !important;
  outline: none;
}

.profile-post__content .feed-post-action:focus-visible {
  outline: 2px solid #0b7285;
  outline-offset: 3px;
}

.profile-post__content .feed-post-action:active,
.profile-post__content .feed-post-action.active {
  color: var(--color-text);
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
  transform: none !important;
}

.profile-post__content .feed-post-icon {
  display: block;
  width: 13px;
  height: 13px;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.profile-post__content .feed-post-like.active .feed-post-heart-icon {
  color: var(--color-danger, #c51d34);
  fill: currentColor;
}

.profile-post__content .like-count,
.profile-post__content .comment-count {
  min-width: 1.25em;
  margin: 0;
  color: #777;
  font-size: var(--cl-type-caption, 12px);
  font-weight: 600;
  line-height: 1;
  text-align: left;
}

.profile-post__content .feed-share-status {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--cl-type-caption, 12px);
  white-space: nowrap;
}

.feed-comments-panel {
  width: min(100%, 320px);
  max-width: 100%;
  margin: var(--space-8) auto 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.feed-comments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-width: 0;
  max-height: 300px;
  margin: 0 0 var(--space-12);
  padding: 0;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

.feed-comments-list:empty {
  display: none;
}

.feed-comment {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--color-text);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.feed-comment__meta {
  margin: 0;
  color: var(--color-muted);
  font-weight: 600;
}

/* Lightweight comment row shared by feed and profile comments. */
.cartochka_comment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 8px 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-text);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
}

.cartochka_comment--alternate {
  background: color-mix(in srgb, var(--color-muted) 5%, transparent);
  border-radius: 8px;
  padding-left: 8px;
}

.feed-comment-thread {
  width: 100%;
  min-width: 0;
  padding: 6px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-muted) 12%, transparent);
}

.feed-comment-thread:last-child {
  border-bottom: 0;
}

.feed-comment-thread__replies {
  display: grid;
  gap: 2px;
  width: calc(100% - 14px);
  min-width: 0;
  margin: 8px 0 2px 14px;
  padding: 6px 0 4px 14px;
  box-sizing: border-box;
  border-left: 3px solid color-mix(in srgb, var(--color-accent) 48%, transparent);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--color-accent) 5%, transparent);
}

.feed-comment-thread__replies--depth-2 {
  width: calc(100% - 10px);
  margin-left: 10px;
  padding-left: 12px;
  border-left-width: 2px;
  border-left-color: color-mix(in srgb, var(--color-accent) 30%, transparent);
  background: color-mix(in srgb, var(--color-accent) 3%, transparent);
}

.cartochka_comment--reply {
  padding: 3px 0;
}

.cartochka_comment--reply-level-2 {
  padding-top: 5px;
  padding-bottom: 5px;
}

.cartochka_comment--reply .cartochka_comment__avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
}

.cartochka_comment--reply .cartochka_comment__author {
  grid-template-columns: 30px minmax(0, 1fr);
}

.cartochka_comment__reply,
.feed-comment-reply-cancel {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-accent, #006897);
  font: inherit;
  font-size: var(--cl-type-eyebrow);
  cursor: pointer;
}

.cartochka_comment__reply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  color: var(--color-muted);
  font-size: 0;
  line-height: 1;
  opacity: .72;
  transition: color .15s ease, background-color .15s ease, opacity .15s ease;
}

.cartochka_comment__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  grid-column: 2;
  grid-row: 1 / span 2;
  gap: 4px;
  width: auto;
  min-height: 26px;
  margin-right: 8px;
  align-self: center;
}

.cartochka_comment__action-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.cartochka_comment__like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-muted);
  font-family: var(--cl-icon-font);
  font-size: var(--cl-type-meta);
  line-height: 1;
  opacity: .72;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, opacity .15s ease;
}

/* Comment actions share one tactile circular button treatment. */
.cartochka_comment__like,
.cartochka_comment__reply,
.feed-comment-form button {
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  opacity: 1;
}

.cartochka_comment__like .feed-post-icon {
  display: block;
  width: 13px;
  height: 13px;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.cartochka_comment__like:hover,
.cartochka_comment__like:focus-visible,
.cartochka_comment__like.active {
  color: var(--color-danger, #c51d34);
  background: color-mix(in srgb, var(--color-danger, #c51d34) 10%, transparent);
  opacity: 1;
}

.cartochka_comment__like.active .feed-post-heart-icon {
  fill: currentColor;
}

.cartochka_comment__like:focus-visible,
.cartochka_comment__reply:focus-visible {
  outline: 2px solid #0b7285;
  outline-offset: 3px;
}

.cartochka_comment__like-count {
  min-width: 1.25em;
  color: var(--color-muted);
  font-size: var(--cl-type-eyebrow);
  font-weight: 600;
  line-height: 1;
  text-align: left;
}

.cartochka_comment__body {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
}

.cartochka_comment__reply::before {
  content: '';
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: var(--cl-icon-base);
  line-height: 1;
  transform: translateY(1px);
}

.cartochka_comment__reply:hover,
.cartochka_comment__reply:focus-visible {
  color: var(--color-accent, #006897);
  background: color-mix(in srgb, var(--color-accent, #006897) 10%, transparent);
  opacity: 1;
}

.cartochka_comment__reply:disabled {
  opacity: .35;
  cursor: default;
}

.feed-comment-reply-cancel:hover,
.feed-comment-reply-cancel:focus-visible {
  text-decoration: none;
}

.feed-comment-reply-context {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0 4px;
  color: var(--color-muted);
  font-size: var(--cl-type-eyebrow);
}

.feed-comment-reply-context[hidden] {
  display: none;
}

.feed-comment-reply-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cartochka_comment__author {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-8);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  color: inherit;
  text-decoration: none;
}

.cartochka_comment__author:hover,
.cartochka_comment__author:focus,
.cartochka_comment__author:active {
  color: inherit;
  text-decoration: none;
  transform: none;
}

.cartochka_comment__avatar {
  display: block;
  width: 34px;
  height: 34px;
  min-width: 34px;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-soft);
  box-shadow: none;
}

.cartochka_comment__name {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: var(--cl-type-caption);
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: none;
}

.cartochka_comment__body {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--color-muted);
  font-size: var(--cl-type-small);
  line-height: 1.4;
  text-align: left;
}

.feed-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: var(--space-8);
  width: 100%;
  margin: 0;
}

.feed-comments-panel .feed-comment-form input {
  min-width: 0;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--color-muted) 18%, transparent);
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--color-text);
  font: inherit;
}

.feed-comments-panel .feed-comment-form input:focus {
  border-color: color-mix(in srgb, var(--color-accent) 46%, transparent);
  box-shadow: none;
}

.feed-comment-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
  font-family: var(--cl-icon-font);
  font-size: var(--cl-icon-sm);
  line-height: 1;
  opacity: 1;
  margin: 0;
  cursor: pointer;
  transition: none !important;
  transform: none !important;
}

.feed-comment-form button:hover,
.feed-comment-form button:focus {
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
  opacity: 1;
  outline: none;
  transform: none !important;
}

.feed-comment-form button:active {
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
}

.feed-comment-form button:focus-visible {
  outline: 2px solid #0b7285;
  outline-offset: 3px;
}

.feed-comment-submit-icon {
  display: block;
  width: 17px;
  height: 17px;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.profile-posts__items .profile-post[data-post-card] {
  cursor: pointer;
}

.profile-posts__items .profile-post[data-post-card]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.profile-posts__items--grid .profile-post[data-post-card] * {
  pointer-events: none;
}

.profile-post__manage {
  position: absolute;
  z-index: 4;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.profile-post__manage-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-family: var(--cl-icon-font);
  font-size: var(--cl-icon-button);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.22), -2px -2px 5px var(--shadow-light);
  pointer-events: auto;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.profile-post__manage-button:hover,
.profile-post__manage-button:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.profile-post__manage-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.profile-post__manage-button:active {
  transform: translateY(1px) scale(0.96);
}

.profile-post__manage-button--edit {
  color: #4a3600;
  background: #f2c94c;
  font-size: var(--cl-type-section);
}

.profile-post__manage-button--delete {
  background: #d52b35;
  font-size: var(--cl-icon-delete);
  font-weight: 400;
}

.profile-posts__items--grid .profile-post[data-post-card] .profile-post__manage,
.profile-posts__items--grid .profile-post[data-post-card] .profile-post__manage * {
  pointer-events: auto;
}

.profile-posts__items--feed .profile-post__manage {
  display: flex;
  top: var(--space-12);
  right: var(--space-12);
}

.profile-posts__items--feed .profile-post__media > img {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.profile-posts__items--feed .profile-post__content h3,
.profile-posts__items--feed .profile-post__content p,
.profile-posts__items--feed .profile-post__content time {
  display: block;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  -webkit-line-clamp: unset;
}

.profile-posts__items--feed .profile-post__content h3 {
  font-size: var(--cl-type-section);
}

.profile-posts__items--feed .profile-post__content p {
  font-size: var(--cl-type-body);
}

.profile-posts-manager__hint {
  margin: 0 0 var(--space-16);
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.35;
}

.profile-posts-manager__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin: 0;
}

.profile-posts-manager__item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 44px;
  align-items: center;
  gap: var(--space-16);
  margin: 0;
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
}

.profile-posts-manager__preview {
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--bg-neu);
  box-shadow: var(--shadow-inset);
}

.profile-posts-manager__preview > img,
.profile-posts-manager__preview .video-container {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.profile-posts-manager__preview > img {
  object-fit: cover;
}

.profile-posts-manager__preview .video-container {
  aspect-ratio: auto;
}

.profile-posts-manager__item strong,
.profile-posts-manager__item span,
.profile-posts-manager__item-copy,
.profile-posts-manager__delete-form,
.profile-posts-manager__delete {
  margin: 0;
}

.profile-posts-manager__item-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
}

.profile-posts-manager__item-copy strong,
.profile-posts-manager__item-copy span,
.profile-posts-manager__item-copy p {
  overflow-wrap: anywhere;
}

.profile-posts-manager__item-copy strong {
  line-height: 1.2;
}

.profile-posts-manager__item-copy p {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.3;
}

.profile-posts-manager__item span {
  color: var(--color-muted);
}

.profile-posts-manager__delete-form {
  flex: 0 0 auto;
}

.profile-posts-manager__delete {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #d52b35;
  box-shadow: var(--shadow-soft);
  font-family: var(--cl-icon-font);
  font-size: var(--cl-type-title-lg);
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.profile-posts-manager__delete:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: var(--shadow-inset);
}

.profile-post-dialog[hidden] {
  display: none !important;
}

.profile-post-dialog {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  padding: var(--space-16);
  background: rgba(20, 24, 28, 0.46);
}

.profile-post-dialog__panel {
  width: min(100%, 420px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  margin: 0 !important;
  padding: var(--space-24);
  border-radius: var(--radius-card);
  background: var(--app-bg-gradient);
  box-shadow: 12px 12px 24px rgba(0, 0, 0, 0.24), -8px -8px 18px var(--shadow-light);
}

.profile-post-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  margin: 0 0 var(--space-16);
}

.profile-post-dialog__header h2,
.profile-post-dialog__close {
  margin: 0;
}

.profile-post-dialog__header h2 {
  font-size: var(--cl-type-section);
}

.profile-post-dialog__close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
  font-size: var(--cl-type-section);
  cursor: pointer;
}

.profile-post-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin: 0;
}

.profile-post-form .form-label,
.profile-post-form .form-control,
.profile-post-form .form-hint,
.profile-post-form .form-error {
  margin: 0;
}

.profile-post-form .form-control {
  width: 100%;
  max-width: none;
}

.profile-post-dialog__actions {
  display: flex;
  gap: var(--space-8);
  margin: var(--space-16) 0 0;
}

.profile-post-dialog__actions .btn {
  flex: 1 1 0;
  margin: 0;
}

.form-success {
  margin: 0 0 var(--space-16);
  color: var(--color-success);
  font-size: var(--cl-type-meta);
}

@media (max-width: 520px) {
  .profile-posts-manager__item {
    grid-template-columns: 72px minmax(0, 1fr) 40px;
    gap: var(--space-8);
    padding: var(--space-8);
  }

  .profile-posts-manager__preview {
    width: 72px;
    height: 72px;
  }

  .profile-posts-manager__delete {
    width: 40px;
    height: 40px;
    font-size: var(--cl-type-section);
  }
}

.user-page .profile-header {
  gap: 0;
  padding-top: 0;
}

.user-page .page-title {
  margin-top: 0;
  margin-bottom: 0;
}

.user-page .style-text,
.user-page .username {
  margin-top: 0;
  margin-bottom: 0;
}

/* На user первым видимым элементом профиля является style-text: поднимаем
   его на 8px, чтобы убрать лишний воздух сразу под шапкой. */
.page-header + main.user-page .profile-header > .style-text {
  margin-top: -8px;
}

.user-page .favorites-section {
  gap: 6px;
  margin-top: 16px;
  margin-bottom: var(--space-8);
}

.user-page .role-city {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.cabinet-page .role-city {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.cabinet-page .profile-header .role-city .badge {
  min-width: 72px;
  min-height: 28px;
  margin: 0;
  padding: 6px var(--space-16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-base);
  font-size: var(--cl-type-meta);
  font-weight: 500;
  line-height: 1;
  color: var(--color-text);
  text-align: center;
  text-decoration: none !important;
  border-radius: var(--radius-pill);
  background: var(--bg-neu);
  box-shadow:
    5px 5px 10px var(--shadow-dark),
    -5px -5px 10px var(--shadow-light);
}

.user-page .rating-widget {
  margin-top: var(--space-8);
  margin-bottom: 12px;
}

.user-page .contact-buttons {
  margin-top: 0;
  margin-bottom: var(--space-16);
}

.user-page .myself-buttons {
  margin-top: 16px;
  margin-bottom: var(--space-16);
}

.user-page .video-container {
  margin-top: var(--space-8);
  margin-bottom: var(--space-16);
}

/* Publication media must meet the rounded tile at its top edge. */
.user-page .profile-post__media .video-container,
.user-page .profile-post__media .video-container--portrait,
.user-page .profile-post__media .video-container--external {
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.user-page .profile-post__media .video-container > iframe,
.user-page .profile-post__media .video-container > video {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

.user-page .about {
  margin-top: 0;
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

/* Final button typography: keep button text consistent on hover/tap. */
button,
.btn,
.fav-btn,
.btn-contact,
.contact-btn,
.action-btn,
.profile-back-btn,
.pagination__link,
.telegram-web-login {
  font-family: var(--font-base);
  font-size: var(--cl-type-body);
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none !important;
}

button:hover,
button:focus,
button:active,
.btn:hover,
.btn:focus,
.btn:active,
.fav-btn:hover,
.fav-btn:focus,
.fav-btn:active,
.btn-contact:hover,
.btn-contact:focus,
.btn-contact:active,
.contact-btn:hover,
.contact-btn:focus,
.contact-btn:active,
.action-btn:hover,
.action-btn:focus,
.action-btn:active,
.profile-back-btn:hover,
.profile-back-btn:focus,
.profile-back-btn:active,
.pagination__link:hover,
.pagination__link:focus,
.pagination__link:active,
.telegram-web-login:hover,
.telegram-web-login:focus,
.telegram-web-login:active {
  text-decoration: none !important;
  letter-spacing: 0;
}

/* Final colored button relief: same typography, readable engraved text. */
.btn-tour,
.logout-btn,
.btn-final-create,
button.btn-final-create,
.btn.btn-final-create {
  color: rgba(255, 255, 255, 0.94);
  font-family: var(--font-base);
  font-size: var(--cl-type-body);
  font-weight: 500;
  letter-spacing: 0;
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.42),
     1px  1px 1px rgba(255, 255, 255, 0.22);
}

.btn-tour:hover,
.btn-tour:focus,
.btn-tour:active,
.logout-btn:hover,
.logout-btn:focus,
.logout-btn:active,
.btn-final-create:hover,
.btn-final-create:focus,
.btn-final-create:active,
button.btn-final-create:hover,
button.btn-final-create:focus,
button.btn-final-create:active,
.btn.btn-final-create:hover,
.btn.btn-final-create:focus,
.btn.btn-final-create:active {
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none !important;
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.42),
     1px  1px 1px rgba(255, 255, 255, 0.22);
}

.btn-tour:active {
  background: var(--btn-accent-gradient-active);
  box-shadow: var(--shadow-inset);
}

.logout-btn:active {
  background: linear-gradient(145deg, #800020, #b22222);
  box-shadow: var(--shadow-inset);
}

@media (max-width: 980px) {
  .stats-grid--4,
  .stats-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .stats-grid--2,
  .stats-grid--3,
  .stats-grid--4,
  .stats-kpis {
    grid-template-columns: 1fr;
  }

  .stats-grid--stack-mobile {
    grid-template-columns: 1fr;
  }
}

/* Public web authentication. Keep it isolated from the Mini App controls. */
.landing-page .landing-auth {
  display: grid;
  width: min(100%, var(--control-width));
  margin: 0 auto;
  gap: var(--space-16);
}

.landing-choice {
  width: min(100%, var(--control-width));
  margin: 24px auto 0;
  padding: 20px 16px;
  border-radius: 24px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-raised);
  text-align: center;
}

.landing-choice__title {
  color: var(--color-text);
  font-size: var(--cl-type-section);
  line-height: 1.2;
  text-transform: none;
}

.landing-choice__hint {
  margin: 8px auto 16px;
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.4;
  text-transform: none;
}

.landing-choice__actions {
  display: grid;
  gap: 12px;
}

.landing-choice__button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-raised);
  color: var(--color-text);
  font-size: var(--cl-type-meta);
  font-weight: 700;
  text-decoration: none;
  text-transform: none;
}

.landing-choice__button--primary {
  color: #fff;
  background: var(--btn-accent-gradient);
}

.landing-choice__button--secondary {
  background: var(--surface-raised);
}

.landing-choice__button:active {
  box-shadow: var(--shadow-inset);
}

.landing-page .landing-roles {
  display: grid;
  width: 100%;
  max-width: var(--control-width);
  gap: var(--space-16);
  margin-top: 0;
}

.landing-page .landing-role-list {
  display: grid;
  width: min(100%, var(--control-width));
  gap: var(--space-16);
}

.landing-page .landing-roles__title {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: var(--cl-type-body);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-transform: none;
}

.landing-page .landing-role {
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s ease;
}

.landing-page .landing-role.is-open {
  box-shadow: var(--shadow-inset);
}

.landing-page .landing-role__toggle {
  position: relative;
  display: flex;
  width: 100%;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: var(--space-12, 12px) 40px var(--space-12, 12px) var(--space-16);
  color: var(--color-text);
  background: transparent;
  box-shadow: none;
  font-size: var(--cl-type-body);
  font-weight: 400;
  text-align: center;
}

.landing-page .landing-role__toggle:hover,
.landing-page .landing-role__toggle:focus {
  background: transparent;
  box-shadow: none;
}

.landing-page .landing-role__toggle:active {
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
  transform: translateY(1px);
}

.landing-page .landing-role__toggle:focus-visible,
.landing-page .landing-role__action:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.landing-page .landing-role__name {
  min-width: 0;
  text-align: center;
}

.landing-page .landing-role__toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  right: var(--space-16);
  width: 12px;
  height: 8px;
  background: currentColor;
  -webkit-mask: url('/assets/icons/tabler/chevron-down.svg') center / contain no-repeat;
  mask: url('/assets/icons/tabler/chevron-down.svg') center / contain no-repeat;
  transform: translateY(-50%);
  transition: transform 0.2s ease;
}

.landing-page .landing-role.is-open .landing-role__toggle::after {
  transform: translateY(-50%) rotate(180deg);
}

.landing-page .landing-role__panel {
  display: grid;
  gap: var(--space-16);
  padding: var(--space-12, 12px) var(--space-16) var(--space-16);
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.4;
  text-align: left;
}

.landing-page .landing-role__panel[hidden] {
  display: none;
}

.landing-page .landing-role__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8);
}

.landing-page .landing-role__action {
  display: flex;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-base);
  font-size: var(--cl-type-meta);
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}

.landing-page .landing-role__action:hover,
.landing-page .landing-role__action:focus {
  color: var(--color-text);
  box-shadow: var(--shadow-raised);
  text-decoration: none;
}

.landing-page .landing-role__action:active {
  box-shadow: var(--shadow-inset);
}

.landing-page .landing-role__action--primary {
  color: #fff;
  background: var(--btn-accent-gradient);
}

.landing-page .landing-role__action--primary:hover,
.landing-page .landing-role__action--primary:focus,
.landing-page .landing-role__action--primary:active {
  color: #fff;
}

.landing-page .landing-role__action--disabled {
  color: var(--color-muted);
  background: var(--surface-soft);
  cursor: not-allowed;
  opacity: .72;
}

.landing-page .landing-auth__title {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: var(--cl-type-body);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  text-shadow: none;
  text-transform: none;
}

.landing-page .landing-auth__back {
  justify-self: center;
  color: var(--color-accent-strong);
  font-size: var(--cl-type-caption);
  text-decoration: none;
  text-transform: none;
}

.landing-page .auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 18px 16px;
  border-radius: 22px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-raised);
}

.landing-page .auth-form label {
  margin-top: 4px;
  color: var(--color-text);
  font-size: var(--cl-type-meta);
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  text-transform: none;
}

.landing-page .auth-form input:not([type="checkbox"]):not([type="file"]) {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}

.landing-page .auth-form input[type="file"] {
  width: 100%;
  height: auto;
  min-height: 42px;
  margin-top: 4px;
  padding: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  font-size: var(--cl-type-caption);
}

.landing-page .auth-form small,
.landing-page .landing-auth__notice {
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.4;
  text-align: left;
  text-transform: none;
}

.landing-page .auth-form button {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius-pill);
  color: #fff;
  background: var(--btn-accent-gradient);
  box-shadow: var(--shadow-raised);
  cursor: pointer;
  font-family: var(--font-base);
  font-size: var(--cl-type-meta);
  font-weight: 700;
  text-transform: none;
}

.landing-page .auth-form button:active {
  box-shadow: var(--shadow-inset);
}

.landing-page .landing-consent {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: var(--space-16);
  color: var(--color-text);
  background: var(--surface-raised);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-base);
  font-size: var(--cl-type-caption);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  text-shadow: none;
  text-transform: none;
  cursor: pointer;
}

.landing-page .landing-consent input {
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin: 1px 0 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.landing-page .landing-consent a,
.landing-page .landing-consent a:hover,
.landing-page .landing-consent a:focus {
  color: var(--color-accent-strong);
  text-decoration: none;

}

.landing-page .web-entry-actions {
  display: grid;
  width: 100%;
  max-width: none;
  margin: 0;
  gap: 12px;
}

.landing-page .telegram-login-inline {
  display: grid;
  width: 100%;
  justify-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 0;
}

.landing-page .telegram-login-inline__hint {
  margin: 0;
  color: var(--color-muted);
  font-family: var(--font-base);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
  text-align: center;
  text-transform: none;
}

.landing-page .telegram-login-inline__widget {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
}

.landing-page .telegram-login-inline__widget iframe {
  max-width: 100%;
}

.landing-page .telegram-login-inline.is-loading {
  opacity: .7;
  pointer-events: none;
}

.landing-page .auth-provider,
.landing-page .auth-account-switch {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 56px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 12px 64px 12px 20px;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font-base);
  font-size: var(--cl-type-meta);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0 !important;
  text-align: center;
  text-decoration: none !important;
  text-shadow: none !important;
  text-transform: none;
  transform: none !important;
  transition: box-shadow 120ms ease;
}

.landing-page .auth-provider:hover,
.landing-page .auth-provider:focus,
.landing-page .auth-provider:active,
.landing-page .auth-account-switch:hover,
.landing-page .auth-account-switch:focus,
.landing-page .auth-account-switch:active {
  letter-spacing: 0 !important;
  text-decoration: none !important;
  text-shadow: none !important;
  transform: none !important;
}

.landing-page .auth-provider:focus-visible,
.landing-page .auth-account-switch:focus-visible,
.landing-page .landing-consent input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.landing-page .auth-provider--telegram {
  padding-right: 20px;
  color: #124b47;
  background: linear-gradient(145deg, #b8eee8, #89d6cc);
  box-shadow: var(--shadow-raised);
  cursor: pointer;
}

.landing-page .auth-provider--telegram:active {
  box-shadow: var(--shadow-inset);
}

.landing-page .auth-provider--disabled,
.landing-page .auth-provider:disabled {
  color: var(--color-muted);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  opacity: 1;
  cursor: not-allowed;
}

.landing-page .auth-provider__note {
  position: absolute;
  right: var(--space-16);
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  font-weight: 500;
  line-height: 1;
}

.landing-page .landing-auth__divider {
  width: 100%;
  height: 1px;
  margin: 4px 0;
  background: rgba(79, 79, 82, 0.16);
}

.landing-page .auth-account-switch {
  padding-right: 20px;
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
}

.landing-page .auth-account-switch--primary {
  color: #fff;
  background: var(--btn-accent-gradient);
}

.landing-page .auth-account-switch--primary:hover,
.landing-page .auth-account-switch--primary:focus,
.landing-page .auth-account-switch--primary:active {
  color: #fff;
}

.landing-page .auth-account-switch:active {
  box-shadow: var(--shadow-inset);
}

.landing-page .landing-auth__status {
  min-height: 20px;
  margin: 0;
  color: var(--color-muted);
  font-family: var(--font-base);
  font-size: var(--cl-type-caption);
  line-height: 1.4;
  letter-spacing: 0;
  text-align: center;
  text-shadow: none;
  text-transform: none;
}

.landing-page .landing-auth__status.is-error {
  color: var(--color-danger);
}

.landing-page .landing-auth__role-note {
  margin: 0;
  color: var(--color-muted);
  font-family: var(--font-base);
  font-size: var(--cl-type-meta);
  line-height: 1.4;
  text-align: center;
  text-transform: none;
}

.landing-page .telegram-recovery-link {
  display: block;
  color: var(--color-accent-strong);
  font-family: var(--font-base);
  font-size: var(--cl-type-meta);
  line-height: 1.35;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.landing-page .telegram-recovery-link:hover,
.landing-page .telegram-recovery-link:focus {
  color: var(--color-accent-strong);
}

.landing-page .telegram-recovery-identity {
  display: grid;
  width: 100%;
  gap: var(--space-8);
  padding: var(--space-16);
  color: var(--color-text);
  background: var(--surface-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.landing-page .telegram-recovery-identity__label,
.landing-page .telegram-recovery-identity > span:last-child {
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
}

.landing-page .telegram-recovery-identity strong {
  font-size: var(--cl-type-section);
}

.landing-page .telegram-recovery-confirm {
  color: #fff;
  background: var(--btn-accent-gradient);
}

.landing-page .telegram-recovery-confirm:hover,
.landing-page .telegram-recovery-confirm:focus,
.landing-page .telegram-recovery-confirm:active {
  color: #fff;
}

/* Specialist registration onboarding */
.register-page {
  min-height: 100vh;
  max-width: 720px;
  padding-top: clamp(20px, 5vw, 48px);
  padding-bottom: clamp(32px, 7vw, 72px);
}

.register-card {
  width: min(100%, 520px);
  padding: clamp(22px, 5vw, 36px) clamp(16px, 5vw, 32px);
  border-radius: 28px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-raised);
}

.register-card__logo {
  display: flex;
  width: 68px;
  height: 68px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
}

.register-card__logo img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
}

.register-card__eyebrow {
  color: var(--color-accent-strong);
  font-size: var(--cl-type-caption);
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

.register-card__title,
.register-card__subtitle {
  text-align: center;
}

.register-card__title {
  margin-top: 8px;
  color: var(--color-text);
  font-size: var(--cl-type-title-hero);
  line-height: 1.05;
}

.register-card__subtitle {
  max-width: 410px;
  margin: 12px auto 0;
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.45;
  text-transform: none;
}

.register-progress {
  margin-top: 24px;
}

.register-progress__meta {
  display: flex;
  justify-content: space-between;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  text-transform: none;
}

.register-progress__track {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-inset);
}

.register-progress__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b6f68, #4ecfb5);
  transition: width .2s ease;
}

.register-form {
  gap: 20px;
  margin-top: 24px;
}

.register-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.register-step__heading {
  margin-bottom: 8px;
}

.register-step__heading h2 {
  color: var(--color-text);
  font-size: var(--cl-type-section);
  line-height: 1.15;
  text-align: left;
  text-transform: none;
}

.register-step__heading p {
  margin-top: 6px;
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.4;
  text-align: left;
  text-transform: none;
}

.register-step .form-label {
  margin-top: 4px;
  color: var(--color-text);
  font-size: var(--cl-type-meta);
  font-weight: 700;
  text-align: left;
  text-transform: none;
}

.register-step .form-hint {
  margin-top: -6px;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
  text-align: left;
  text-transform: none;
}

.register-field-error {
  margin-top: -5px;
  color: var(--color-danger, #a11b3e);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
  text-align: left;
  text-transform: none;
}

.register-password-field {
  position: relative;
}

.register-password-field .form-control {
  padding-right: 104px;
}

.register-password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--color-accent-strong);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: var(--cl-type-caption);
  text-transform: none;
  transform: translateY(-50%);
}

.register-password-toggle:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 2px;
}

/* The global .ui-page button rule makes every button full-width. The
   password toggle is an inline control inside the input wrapper, so it must
   keep its own compact hit area and leave the input available for typing. */
.ui-page .register-password-toggle {
  display: inline-flex;
  width: auto;
  max-width: none;
  height: auto;
  min-width: 0;
  margin: 0;
  padding: 4px 8px;
}

.register-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.register-summary__avatar {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-base);
  box-shadow: var(--shadow-inset);
}

.register-summary__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.register-summary__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  text-align: left;
  text-transform: none;
}

.register-summary__content strong {
  color: var(--color-text);
  font-size: var(--cl-type-meta);
}

.register-counter {
  align-self: flex-end;
  margin-top: -8px;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
}

.register-avatar {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.register-avatar__preview {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-base);
  box-shadow: var(--shadow-inset);
}

.register-avatar__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.register-avatar__body {
  width: 100%;
  min-width: 0;
}

.register-avatar__body strong {
  color: var(--color-text);
  font-size: var(--cl-type-meta);
}

.register-avatar__body p {
  margin: 4px 0 10px;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
  text-align: center;
  text-transform: none;
}

.register-avatar__status {
  min-height: 16px;
  margin-top: 8px;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
  text-align: center;
  text-transform: none;
}

.register-avatar__status.is-ready {
  color: var(--color-accent-strong);
}

.register-avatar__status.is-loading {
  color: var(--color-accent-strong);
}

.register-avatar__status.is-error {
  color: var(--color-danger, #a11b3e);
}

.register-avatar-crop[hidden] {
  display: none !important;
}

.register-avatar-crop {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(31, 31, 31, .56);
  -webkit-backdrop-filter: blur(11px) saturate(92%);
  backdrop-filter: blur(11px) saturate(92%);
}

.register-avatar-crop__backdrop {
  position: absolute;
  inset: 0;
}

.register-avatar-crop__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(720px, calc(100dvh - 32px));
  overflow: auto;
  padding: 20px;
  border-radius: 24px;
  background: var(--surface-modal);
  -webkit-backdrop-filter: blur(16px) saturate(96%);
  backdrop-filter: blur(16px) saturate(96%);
  box-shadow: var(--shadow-raised);
  transform: translateY(clamp(36px, 6vh, 56px));
}

.register-avatar-crop__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.register-avatar-crop__header h2 {
  color: var(--color-text);
  font-size: var(--cl-type-section);
  line-height: 1.15;
  text-align: left;
  text-transform: none;
}

.register-avatar-crop__header p,
.register-avatar-crop__hint {
  margin-top: 6px;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
  text-align: left;
  text-transform: none;
}

.register-avatar-crop__close {
  display: inline-flex;
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  height: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: var(--cl-icon-lg);
  line-height: 1;
}

.register-avatar-crop__stage {
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 18px auto 0;
  overflow: hidden;
  border: 8px solid var(--surface-raised);
  border-radius: 50%;
  background: var(--surface-base);
  box-shadow: var(--shadow-inset), var(--shadow-soft);
}

.register-avatar-crop__canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.register-avatar-crop__canvas:active {
  cursor: grabbing;
}

.register-avatar-crop__zoom {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  margin-top: 18px;
  color: var(--color-text);
  font-size: var(--cl-type-caption);
  text-align: left;
  text-transform: none;
}

.register-avatar-crop__zoom output {
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.register-avatar-crop__zoom input {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  accent-color: var(--color-accent);
}

.register-avatar-crop__hint {
  margin-top: 8px;
  text-align: center;
}

.register-avatar-crop__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.register-avatar-crop__actions .btn {
  width: 100%;
  max-width: none;
  min-height: 44px;
  margin: 0;
}

.register-avatar-crop__actions .register-avatar-crop__cancel {
  color: var(--color-text);
  background: var(--surface-raised);
}

body.register-avatar-crop-open {
  overflow: hidden;
}

.register-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.register-file-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: #fff;
  background: var(--btn-accent-gradient);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: var(--cl-type-caption);
  font-weight: 700;
  text-transform: none;
}

.register-file-button:active {
  box-shadow: var(--shadow-inset);
}

.register-consent {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.register-consent input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--color-accent);
}

.register-consent .consent-text {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.45;
  text-align: left;
  text-transform: none;
}

.register-consent .consent-text a {
  color: var(--color-accent-strong);
}

.register-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.register-actions--with-back {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
}

.register-actions__submit,
.register-actions__back {
  min-height: 52px;
  margin: 0 !important;
}

.register-actions__back {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  background: var(--surface-raised);
  text-decoration: none;
}

.register-actions__submit:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .register-card {
    border-radius: 22px;
  }

  .register-avatar {
    align-items: center;
  }

  .register-avatar__preview {
    flex-basis: 104px;
    width: 104px;
    height: 104px;
  }
}

.telegram-login-modal[hidden] {
  display: none !important;
}

.telegram-login-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: var(--space-24);
  background: rgba(12, 31, 28, 0.48);
}

.telegram-login-modal__dialog {
  position: relative;
  width: min(100%, 360px);
  box-sizing: border-box;
  padding: 32px var(--space-24) var(--space-24);
  color: var(--color-text);
  background: var(--surface-raised);
  border-radius: 20px;
  box-shadow: var(--shadow-raised);
  text-align: center;
}

.telegram-login-modal__dialog h2,
.telegram-login-modal__dialog p {
  margin: 0;
  font-family: var(--font-base);
  letter-spacing: 0;
  text-shadow: none;
  text-transform: none;
}

.telegram-login-modal__dialog h2 {
  font-size: var(--cl-type-meta);
  font-weight: 700;
}

.telegram-login-modal__dialog p {
  margin-top: var(--space-8);
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.45;
}

.telegram-login-modal__close {
  position: absolute;
  top: var(--space-8);
  right: var(--space-8);
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  color: var(--color-text);
  background: var(--surface-raised);
  border: 0;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  font-family: var(--cl-icon-font);
  font-size: var(--cl-icon-delete);
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.telegram-login-modal__widget {
  display: flex;
  min-height: 40px;
  justify-content: center;
  margin-top: var(--space-16);
}

/* ============================================
   UNIFIED BACK BUTTON COMPONENT
   ============================================ */

.back-button,
.profile-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: var(--control-width, 360px);
    min-height: 44px;
    padding: var(--space-12, 12px) var(--space-16, 16px);
    margin: 0 auto var(--space-16, 16px);
    border: none;
    border-radius: var(--radius-pill, 9999px);
    background: var(--surface-soft, #f5f5f7);
    color: var(--color-text, #1a1a1a);
    font-size: var(--cl-type-body);
    font-weight: 600;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: var(--shadow-raised, 0 2px 8px rgba(0,0,0,0.08));
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    position: relative;
    overflow: hidden;
}

.back-button::before,
.profile-back-btn::before {
    content: '';
    margin-right: 0.25rem;
    line-height: 1;
}

.back-button:hover,
.back-button:focus,
.profile-back-btn:hover,
.profile-back-btn:focus {
    background: var(--surface-hover, #ebebed);
    box-shadow: var(--shadow-raised-hover, 0 4px 12px rgba(0,0,0,0.12));
    color: var(--color-text, #1a1a1a);
    text-decoration: none !important;
    transform: translateY(-1px);
}

.back-button:active,
.profile-back-btn:active {
    transform: translateY(1px) scale(0.98);
    background: var(--surface-pressed, #e0e0e2);
    box-shadow: var(--shadow-inset, inset 0 2px 4px rgba(0,0,0,0.06));
}

/* Center alignment for event pages */
.back-button--center,
.event-view__back {
    margin-left: auto;
    margin-right: auto;
}

/* Small variant for compact layouts */
.back-button--small {
    min-height: 36px;
    padding: var(--space-8, 8px) var(--space-12, 12px);
    font-size: var(--cl-type-meta);
}

/* Secondary style (for multi-step forms) */
.back-button--secondary {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--color-border, #d1d1d6);
}

.back-button--secondary:hover {
    background: var(--surface-soft, #f5f5f7);
}

/* Disabled state */
.back-button--disabled,
.back-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Ensure proper stacking in main content */
main .back-button:first-child,
main .profile-back-btn:first-child {
    margin-top: var(--space-8, 8px);
}

/* Верхняя кнопка возврата — зеркальная пара к уведомлениям справа. */
.back-button--utility {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 0px));
    left: max(16px, calc((100vw - var(--bottom-nav-max-width)) / 2));
    z-index: 120;
    display: flex;
    width: 44px;
    height: 44px;
    min-height: 44px;
    max-width: none;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-raised);
    box-shadow: var(--shadow-soft);
    color: var(--color-text);
    font-size: 0;
    line-height: 1;
    text-decoration: none !important;
}

main .back-button--utility:first-child {
    margin: 0;
}

.back-button--utility::before {
    content: '';
    margin: 0;
    font-size: var(--cl-type-title-md);
    line-height: 1;
}

.back-button--utility .back-button__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.back-button--utility:hover,
.back-button--utility:focus {
    background: var(--surface-hover, var(--surface-raised));
    box-shadow: var(--shadow-raised);
    color: var(--color-text);
    text-decoration: none !important;
    transform: translateY(-1px);
}

.back-button--utility:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.back-button--utility:active {
    transform: translateY(1px) scale(0.97);
    background: var(--surface-pressed);
    box-shadow: var(--shadow-inset);
}

/* ===== СЕЛЕКТОР ТЕМ ===== */
.theme-selector {
  margin-top: var(--space-16);
  padding: var(--space-16);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  box-shadow: var(--shadow-raised);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 480px) {
  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

.theme-option {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: var(--control-height, 44px);
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: var(--cl-type-meta);
  line-height: 1.2;
}

.theme-option:hover {
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.theme-option.active {
  box-shadow: var(--shadow-inset);
  background: var(--surface-pressed);
  transform: translateY(0);
}


/* Единый отступ от общей верхней панели до первого элемента страницы. */
:root {
  --page-header-content-gap: var(--page-content-top);
}

.page-header + main {
  margin-top: 0 !important;
  padding-top: var(--page-header-content-gap) !important;
}

/* Единая рабочая колонка для всех экранов Mini App. Старые страницы используют
   .container, новые — .ui-page, но визуальная ось у них должна быть общей. */
.page-header + main.container,
.page-header + main.ui-page {
  width: 100%;
  max-width: calc(var(--control-width) + (var(--page-inline-padding) * 2));
  padding-right: var(--page-inline-padding);
  padding-left: var(--page-inline-padding);
}

.page-header + main > :first-child {
  margin-top: 0 !important;
}

/* На страницах с сохранённым скрытым h1 первым видимым блоком обычно
   становятся фильтры или список. Их верхний margin тоже не должен
   добавляться к общему отступу контейнера. */
.page-header + main > .page-title + * {
  margin-top: 0 !important;
}

.page-header + main.user-page > .profile-header {
  padding-top: 0 !important;
}

/* ========================================================================
   FINAL LAYOUT CONTRACT
   Один каркас для Mini App: header -> рабочая колонка -> нижняя навигация.
   Этот слой намеренно находится в самом низу файла и нормализует legacy-
   страницы (.container) без вмешательства во внутреннюю геометрию карточек.
======================================================================== */
:root {
  --layout-content-width: var(--control-width, 344px);
  --layout-inline-padding: var(--page-inline-padding, 16px);
  --layout-column-width: calc(var(--layout-content-width) + (var(--layout-inline-padding) * 2));
  /* Один baseline для всех экранов: шапка -> контент -> секции. */
  --layout-header-gap: 24px;
  --layout-section-gap: var(--space-24, 24px);
  --layout-control-gap: var(--space-16, 16px);
}

/* Header is the only owner of the top bar. Main starts after it with one,
   predictable inset on every route, regardless of container generation. */
.page-header + main.container,
.page-header + main.ui-page {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--layout-column-width);
  min-width: 0;
  margin: 0 auto;
  padding: var(--layout-header-gap) var(--layout-inline-padding) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* The old container used 376px while ui-page used a calculated width. Keep
   the content axis identical and prevent wide children from shifting it. */
.page-header + main.container > *,
.page-header + main.ui-page > * {
  max-width: 100%;
  box-sizing: border-box;
}

.page-header + main.container > :first-child,
.page-header + main.ui-page > :first-child {
  margin-top: 0 !important;
}

/* Никаких локальных компенсаций у первого блока: расстояние до него
   принадлежит только main и одинаково на каждой странице. */
.page-header + main.container > :first-child,
.page-header + main.ui-page > :first-child {
  padding-top: 0 !important;
  transform: none;
}

/* Header titles are rendered in the shared header. Hidden legacy headings
   must not reserve vertical space or create a second rhythm step. */
.page-header + main > .page-title,
.page-header + main > h1.title,
.page-header + main > h1.event-view__title {
  display: none !important;
  margin: 0 !important;
}

main.feed-page .fav-toggle {
  width: 100%;
  margin: 0;
}

main.feed-page #feed-container,
main.feed-page #feed-sentinel,
main.rating-page #cards-container,
main.favorites-page #cards-container {
  width: 100%;
  max-width: var(--layout-content-width);
  margin-right: auto;
  margin-left: auto;
  box-sizing: border-box;
}

main.rating-page #cards-container,
main.favorites-page #cards-container {
  margin-top: 0;
  padding: 0;
}

/* В рейтинге и подписках карточки специалистов идут единым вертикальным списком. */
main.rating-page #cards-container,
main.favorites-page #cards-container {
  gap: var(--space-8, 8px);
}

/* ------------------------------------------------------------------------
   Events and event creation: same axis, controlled section rhythm
------------------------------------------------------------------------ */
main.events-page {
  gap: var(--layout-section-gap);
}

main.events-page .events-tabs,
main.events-page .events-action,
main.events-page .events-container {
  width: 100%;
  max-width: var(--layout-content-width);
  margin-right: auto;
  margin-left: auto;
  box-sizing: border-box;
}

main.events-page .events-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8, 8px);
}

main.events-page .events-tabs a {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
}

main.events-page .events-funnel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-8, 8px);
}

main.events-page .events-funnel__item {
  min-height: 64px;
  padding: 8px 4px;
}

main.events-page .events-funnel__item span {
  font-size: var(--cl-type-eyebrow);
  line-height: 1.2;
}

main.events-page .events-action {
  margin-top: 0;
}

main.events-page .events-action .btn,
main.events-page .events-container {
  width: 100%;
}

main.create-event-page {
  gap: 0;
}

main.create-event-page .profile-card,
main.create-event-page .create-event-form,
main.create-event-page .ui-form,
main.create-event-page .event-summary-block {
  width: 100%;
  max-width: var(--layout-content-width);
  margin-right: auto;
  margin-left: auto;
  box-sizing: border-box;
}

main.create-event-page .profile-card,
main.create-event-page .create-event-form {
  align-self: center;
}

/* Profile pages used a one-off negative margin to visually compensate for
   the old header. The shared header gap now owns that space. */
.page-header + main.user-page .profile-header > .style-text {
  margin-top: 0 !important;
}

/* Поднимаем шапку только на публичном и собственном профиле,
   не затрагивая profile-header в cabinet.php и tester.php. */
main.user-page > .profile-header {
  margin-top: -24px;
}

/* Pages with a genuinely full-height empty state keep their own centering;
   the common header gap still remains the only top offset. */
.page-header + main.not-found-page,
.page-header + main.landing-page {
  padding-top: var(--layout-header-gap);
}

/* Fixed bottom navigation gets reserved space only from body, not from the
   content column. This keeps footer placement independent from main layout. */
.site-footer {
  width: 100%;
  max-width: var(--layout-column-width);
  margin-right: auto;
  margin-left: auto;
  padding: var(--space-16, 16px) var(--layout-inline-padding) 0;
  box-sizing: border-box;
}

/* ========================================================================
   FINAL NEUMORPHIC SURFACE CONTRACT
   Эталон визуальной глубины — .card из cartochka.php:
   raised surface + raised shadow, soft shadow при наведении и inset shadow
   при нажатии. Этот слой расположен последним, поэтому старые локальные
   правила меню и попапов больше не создают отдельную «версию» неоморфизма.
======================================================================== */

/* Любая самостоятельная поверхность сайта начинается ровно как .card. */
.page-header__button,
.bottom-navigation__capsule,
.bottom-navigation .menu-item,
.notification-popup,
.cookie-consent,
.modal,
.profile-post-dialog__panel,
.telegram-login-modal__dialog {
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
}

/* Верхняя навигация повторяет поведение карточки, включая направление
   движения: при наведении элемент чуть «поднимается», при нажатии — входит
   внутрь поверхности. */
.page-header__button:hover {
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.page-header__button:active,
.page-header__button.active {
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
  transform: translateY(2px);
}

.page-header__title {
  color: var(--color-text);
  text-shadow: var(--text-emboss);
}

.bottom-navigation__capsule {
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
}

.bottom-navigation .menu-item:hover {
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.bottom-navigation .menu-item:active,
.bottom-navigation .menu-item.active {
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
  transform: translateY(2px);
}

/* Неоморфные уведомления, cookie-баннер и JS-попапы используют одну и ту же
   геометрию карточки. */
.notification-popup,
.cookie-consent {
  box-sizing: border-box;
  border: 0;
  color: var(--color-text);
  background: var(--surface-modal);
  -webkit-backdrop-filter: blur(16px) saturate(96%);
  backdrop-filter: blur(16px) saturate(96%);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
  line-height: 1.35;
}

.notification-popup {
  width: min(var(--control-width), calc(100vw - (var(--space-16) * 2)));
  max-height: calc(100vh - (var(--space-24) * 2));
  overflow-y: auto;
  padding: var(--space-24) var(--space-16);
  transform: translate(-50%, calc(-50% + clamp(24px, 4vh, 40px))) scale(0.95);
}

.notification-popup.show {
  transform: translate(-50%, calc(-50% + clamp(24px, 4vh, 40px))) scale(1);
}

.cookie-consent {
  width: min(var(--control-width), calc(100vw - (var(--space-16) * 2)));
  padding: var(--space-16);
}

.notification-popup button,
.cookie-consent button {
  min-height: 44px;
  margin-top: var(--space-16);
  margin-left: 0;
  padding: var(--space-8) var(--space-16);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-base);
  font-size: var(--cl-type-body);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}

.notification-popup button:hover,
.cookie-consent button:hover {
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.notification-popup button:active,
.cookie-consent button:active {
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
  transform: translateY(2px);
}

.notification-popup input,
.notification-popup select,
.notification-popup textarea,
.modal input,
.modal select,
.modal textarea {
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-input);
}

/* Унифицированный overlay: затемнение остаётся функциональным, а сама
   поверхность диалога полностью повторяет карточку. */
.modal-overlay,
.telegram-login-modal,
.profile-post-dialog,
.register-avatar-crop {
  box-sizing: border-box;
  padding: var(--space-16);
  background: var(--popup-overlay, rgba(74, 78, 79, 0.22));
  backdrop-filter: blur(var(--popup-overlay-blur, 14px)) saturate(var(--popup-overlay-saturation, 92%));
  -webkit-backdrop-filter: blur(var(--popup-overlay-blur, 14px)) saturate(var(--popup-overlay-saturation, 92%));
}

.modal {
  width: min(var(--control-width), calc(100vw - (var(--space-16) * 2)));
  max-height: calc(100vh - (var(--space-16) * 2));
  overflow-y: auto;
  padding: var(--space-24) var(--space-16);
  border: 0;
  border-radius: var(--radius-card);
  color: var(--color-text);
  background: var(--surface-modal);
  -webkit-backdrop-filter: blur(16px) saturate(96%);
  backdrop-filter: blur(16px) saturate(96%);
  box-shadow: var(--shadow-raised);
  line-height: 1.35;
  transform: translateY(clamp(24px, 4vh, 40px));
}

.modal button {
  min-height: 44px;
  margin-top: var(--space-16);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
  transition: transform .2s, box-shadow .2s, background .2s;
}

.modal button:hover {
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.modal button:active {
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
  transform: translateY(2px);
}

.profile-post-dialog__panel,
.telegram-login-modal__dialog {
  border: 0;
  border-radius: var(--radius-card);
  color: var(--color-text);
  background: var(--surface-modal);
  -webkit-backdrop-filter: blur(16px) saturate(96%);
  backdrop-filter: blur(16px) saturate(96%);
  box-shadow: var(--shadow-raised);
  transform: translateY(clamp(24px, 4vh, 40px));
}

.profile-post-dialog__panel {
  padding: var(--space-24) var(--space-16);
}

.profile-post-dialog__close,
.telegram-login-modal__close {
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
  transition: transform .2s, box-shadow .2s, background .2s;
}

.profile-post-dialog__close:hover,
.telegram-login-modal__close:hover {
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.profile-post-dialog__close:active,
.telegram-login-modal__close:active {
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
  transform: translateY(2px);
}

/* Нейтральные кнопки внутри карточных поверхностей используют тот же
   порядок состояний, что и сама .card. Цветные action-кнопки (тур, logout,
   финальное создание) намеренно остаются со своими смысловыми цветами. */
.notification-popup button,
.cookie-consent button,
.modal button,
.profile-post-dialog__actions .btn:not(.btn-primary),
.profile-post-dialog__close,
.telegram-login-modal__close {
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.notification-popup button:hover,
.cookie-consent button:hover,
.modal button:hover,
.profile-post-dialog__actions .btn:not(.btn-primary):hover,
.profile-post-dialog__close:hover,
.telegram-login-modal__close:hover {
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.notification-popup button:active,
.cookie-consent button:active,
.modal button:active,
.profile-post-dialog__actions .btn:not(.btn-primary):active,
.profile-post-dialog__close:active,
.telegram-login-modal__close:active {
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
  transform: translateY(2px);
}

/* Кнопки «Подписки» и «Настройки» на myself.php используют тот же
   радиус и рельеф, что и остальные стандартные кнопки. Селектор повторяет
   специфичность старого правила, чтобы гарантированно перекрыть legacy-стили. */
.user-page .myself-buttons .btn-contact {
  box-sizing: border-box;
  border: 0;
  /* Защита от нескольких старых глобальных правил .btn-contact. */
  border-radius: var(--radius-pill) !important;
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  transition: transform .2s, box-shadow .2s, background .2s;
}

.user-page .myself-buttons .btn-contact:hover,
.user-page .myself-buttons .btn-contact:focus-visible {
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.user-page .myself-buttons .btn-contact:active {
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
  transform: translateY(2px);
}

/* В публичном профиле «Настройки профиля» — основной переход в кабинет.
   Он остаётся той же формы и высоты, но получает единый акцентный цвет. */
.user-page .myself-buttons .btn-contact--accent,
.user-page .myself-buttons .btn-contact--accent:hover,
.user-page .myself-buttons .btn-contact--accent:focus-visible {
  color: #fff !important;
  background: var(--btn-accent-gradient) !important;
  box-shadow: var(--shadow-raised);
  text-shadow: none;
}

.user-page .myself-buttons .btn-contact--accent:active {
  color: #fff !important;
  background: var(--btn-accent-gradient-active) !important;
  box-shadow: var(--shadow-inset);
  text-shadow: none;
}

.telegram-login-modal {
  padding: var(--space-16);
}

.telegram-login-modal__dialog {
  width: min(100%, var(--control-width));
  padding: var(--space-24) var(--space-16);
}

@media (max-width: 380px) {
  .notification-popup,
  .cookie-consent,
  .modal-overlay,
  .telegram-login-modal,
  .profile-post-dialog {
    padding-right: var(--space-8);
    padding-left: var(--space-8);
  }
}

/* Publication management controls keep their compact colored treatment after
   the global button typography rules above. */
.profile-post__manage-button,
.profile-post__manage-button:hover,
.profile-post__manage-button:focus,
.profile-post__manage-button:active {
  width: 32px;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  font-family: var(--cl-icon-font);
  font-size: var(--cl-icon-button);
  font-weight: 700;
  line-height: 1;
}

.profile-post__manage-button--edit {
  color: #4a3600;
  background: #f2c94c;
}

.profile-post__manage-button--delete {
  color: #fff;
  background: #d52b35;
  font-size: var(--cl-icon-delete);
  font-weight: 400;
}

/* UI rule: links and underlined text are never underlined in any interaction state. */
a,
a:hover,
a:focus,
a:focus-visible,
a:active,
u {
  text-decoration: none !important;
}

/* Final button alignment invariant: every button centers its label. */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn {
  box-sizing: border-box;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1.2;
}

/* The role selector is a button too; keep its label centered while the
   chevron stays pinned to the right edge of the control. */
.landing-page .landing-role__toggle {
  display: flex !important;
  position: relative;
  height: 44px;
  min-height: 44px;
  padding: var(--space-12, 12px) 40px var(--space-12, 12px) var(--space-16);
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.landing-page .landing-role__name {
  text-align: center;
}

/* ========================================================================
   WEB APP INSTALLATION PAGE
======================================================================== */
.webvers-page {
  min-height: 100svh;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  gap: 0;
}

.webvers-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 520px;
  padding: clamp(24px, 6vw, 40px);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  text-align: center;
}

.webvers-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.webvers-brand:hover,
.webvers-brand:focus-visible {
  text-decoration: none;
}

.webvers-brand img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.webvers-heading {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 24px;
}

.webvers-heading h1 {
  color: var(--color-text);
  font-size: var(--cl-type-title-app);
  font-weight: 600;
  line-height: 1.25;
  text-shadow: var(--text-emboss);
}

.webvers-heading h1 strong {
  color: var(--color-accent-strong);
  font-weight: 700;
}

.webvers-heading p {
  margin-top: 10px;
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.35;
}

.webvers-guide-media {
  width: 100%;
  margin: 24px 0 0;
}

.webvers-guide-media__placeholder {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 24px;
  border: 1px dashed color-mix(in srgb, var(--color-muted) 35%, transparent);
  border-radius: var(--radius-base);
  background: var(--surface-soft);
  box-shadow: var(--shadow-inset);
  color: var(--color-muted);
  font-size: var(--cl-type-meta);
  line-height: 1.35;
}

.webvers-guide-media__image {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: var(--radius-base);
  object-fit: contain;
  box-shadow: var(--shadow-soft);
}

.webvers-copy,
.webvers-tagline {
  width: 100%;
  margin: 20px 0 0;
  color: var(--color-muted);
  font-size: var(--cl-type-body);
  line-height: 1.35;
}

.webvers-status {
  width: 100%;
  min-height: 20px;
  margin-top: 12px;
  padding: 0 4px;
  background: transparent;
  box-shadow: none;
  color: var(--color-muted);
  font-size: var(--cl-type-caption);
  line-height: 1.35;
}

.webvers-status:empty {
  display: none;
}

.webvers-status[data-state="success"] {
  color: var(--color-success);
}

.webvers-status[data-state="warning"] {
  color: var(--color-danger);
}

.webvers-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 20px;
  gap: 12px;
}

.webvers-actions .btn {
  width: 100%;
  min-height: 44px;
}

.webvers-page [hidden] {
  display: none !important;
}

.webvers-actions .btn-primary {
  color: var(--surface-base);
  background: var(--btn-accent-gradient);
  box-shadow: var(--shadow-raised);
  text-shadow: none;
}

.webvers-actions .btn-primary:hover,
.webvers-actions .btn-primary:focus-visible {
  background: var(--btn-accent-gradient);
  box-shadow: var(--shadow-raised);
}

.webvers-actions .btn-primary:active {
  background: var(--btn-accent-gradient-active);
  box-shadow: var(--shadow-inset);
}

.webvers-page button:focus-visible,
.webvers-page .btn:focus-visible,
.webvers-page .webvers-brand:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.webvers-tagline {
  margin-top: 24px;
  color: var(--color-accent-strong);
  font-size: var(--cl-type-meta);
  font-weight: 600;
}

.landing-webapp-link {
  width: 100%;
  max-width: var(--control-width);
  min-height: 44px;
}

@media (max-width: 380px) {
  .webvers-page {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }

  .webvers-card {
    padding: 24px 16px;
  }

  .webvers-heading h1 {
    font-size: var(--cl-type-title-compact);
  }

  .webvers-guide-media__placeholder {
    min-height: 160px;
  }
}

/* Единый стиль полноразмерных тёмных акцентных кнопок дефолтной темы.
   Нейтральные, красные и маленькие жёлтые action-кнопки намеренно сюда не
   входят: у них остаётся собственная семантика и оформление. */
.btn-primary,
.btn-tour,
.btn-final-create,
button.btn-final-create,
.btn.btn-final-create,
.web-entry-primary,
.web-auth-submit,
.landing-choice__button--primary,
.landing-page .landing-role__action--primary,
.landing-page .auth-form button,
.landing-page .auth-account-switch--primary,
.landing-page .telegram-recovery-confirm,
.register-file-button,
.webvers-actions .btn-primary {
  color: #fff;
  background: var(--btn-accent-gradient);
  text-shadow: none;
}

.web-entry-primary,
.web-auth-submit {
  background: var(--btn-accent-gradient) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-tour:hover,
.btn-tour:focus,
.btn-final-create:hover,
.btn-final-create:focus,
button.btn-final-create:hover,
button.btn-final-create:focus,
.btn.btn-final-create:hover,
.btn.btn-final-create:focus,
.web-entry-primary:hover,
.web-entry-primary:focus,
.web-auth-submit:hover,
.web-auth-submit:focus,
.landing-choice__button--primary:hover,
.landing-choice__button--primary:focus,
.landing-page .landing-role__action--primary:hover,
.landing-page .landing-role__action--primary:focus,
.landing-page .auth-form button:hover,
.landing-page .auth-form button:focus,
.landing-page .auth-account-switch--primary:hover,
.landing-page .auth-account-switch--primary:focus,
.landing-page .telegram-recovery-confirm:hover,
.landing-page .telegram-recovery-confirm:focus,
.register-file-button:hover,
.register-file-button:focus,
.webvers-actions .btn-primary:hover,
.webvers-actions .btn-primary:focus {
  color: #fff;
  background: var(--btn-accent-gradient);
  text-shadow: none;
}

.web-entry-primary:hover,
.web-entry-primary:focus,
.web-auth-submit:hover,
.web-auth-submit:focus {
  background: var(--btn-accent-gradient) !important;
}

.btn-primary:active,
.btn-tour:active,
.btn-final-create:active,
button.btn-final-create:active,
.btn.btn-final-create:active,
.web-entry-primary:active,
.web-auth-submit:active,
.landing-choice__button--primary:active,
.landing-page .landing-role__action--primary:active,
.landing-page .auth-form button:active,
.landing-page .auth-account-switch--primary:active,
.landing-page .telegram-recovery-confirm:active,
.register-file-button:active,
.webvers-actions .btn-primary:active {
  color: #fff;
  background: var(--btn-accent-gradient-active);
  box-shadow: var(--shadow-inset);
  text-shadow: none;
}

.web-entry-primary:active,
.web-auth-submit:active {
  background: var(--btn-accent-gradient-active) !important;
}

/* Отключённые акцентные кнопки остаются цветными, но визуально приглушаются. */
button.btn-primary:disabled,
.btn.btn-primary:disabled {
  color: #fff;
  background: var(--btn-accent-gradient);
  opacity: 0.68;
  text-shadow: none;
}

/* Единый индикатор загрузки для первого открытия и обычных переходов. */
html.clevent-page-loading {
  /* Не переключаем overflow у корня: body уже держит scrollbar постоянно,
     поэтому ширина контента и его положение не меняются при показе лоадера. */
  scrollbar-gutter: stable;
}

html::before {
  content: '';
  position: fixed;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 250ms ease,
    background-color 250ms ease,
    -webkit-backdrop-filter 250ms ease,
    backdrop-filter 250ms ease,
    visibility 0s linear 250ms;
}

html::before {
  inset: 0;
  z-index: 10000;
  background: rgba(232, 230, 231, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  pointer-events: auto;
}

html.clevent-page-loading::before {
  opacity: 1;
  visibility: visible;
  background: rgba(232, 230, 231, 0.28);
  background: color-mix(in srgb, var(--app-bg, #e8e6e7) 28%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  html::before {
    transition-duration: 0.01ms;
    transition-delay: 0s;
  }
}

/* Glassmorphism skin -----------------------------------------------------
   Lemon remains the stored theme key for backward compatibility, but its
   visual language is now translucent glass: calm color fields behind the UI,
   a light glass edge, and a restrained backdrop blur. The opaque token
   fallbacks above keep text readable when backdrop-filter is unavailable. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  html:is([data-theme="light"], [data-theme="dark"]) :where(
    .card,
    .logo-link,
    .profile-card,
    .form-section,
    .accordion,
    .landing-role,
    .landing-role__action,
    .role-card,
    .register-card,
    .webvers-card,
    .modal,
    .modal-content,
    .modal-dialog,
    .notification-popup,
    .cookie-consent,
    .page-header__button,
    .bottom-navigation__capsule,
    .bottom-navigation .menu-item,
    .theme-option
  ) {
    -webkit-backdrop-filter: blur(10px) saturate(112%);
    backdrop-filter: blur(10px) saturate(112%);
  }
}

html:is([data-theme="light"], [data-theme="dark"]) .page-header {
  background-color: transparent;
}

html:is([data-theme="light"], [data-theme="dark"]) .bottom-navigation__capsule {
  background-color: rgba(255, 255, 255, 0.10);
}

html:is([data-theme="light"], [data-theme="dark"]) body {
  background-color: var(--app-bg);
  background-image: var(--app-bg-gradient);
  background-attachment: fixed;
}

html:is([data-theme="light"], [data-theme="dark"]) .logo-link {
  box-shadow: var(--shadow-soft);
}

/* Поля повторяют селект: одинаковая светлая сторона, глубина и размеры. */
html:is([data-theme="light"], [data-theme="dark"]) :where(
  input:not([type="radio"]):not([type="checkbox"]):not([type="range"]),
  textarea,
  select,
  .form-control
) {
  background: var(--surface-raised);
  box-shadow: var(--shadow-input);
}

html:is([data-theme="light"], [data-theme="dark"]) :where(input, textarea)::placeholder {
  color: rgba(79, 79, 82, 0.60);
  opacity: 1;
}

html:is([data-theme="light"], [data-theme="dark"]) .page-header__title,
html:is([data-theme="light"], [data-theme="dark"]) .page-title,
html:is([data-theme="light"], [data-theme="dark"]) .title {
  color: var(--color-text);
  text-shadow: var(--text-emboss);
}

html:is([data-theme="light"], [data-theme="dark"]) .btn-primary,
html:is([data-theme="light"], [data-theme="dark"]) .btn-tour,
html:is([data-theme="light"], [data-theme="dark"]) .btn-final-create,
html:is([data-theme="light"], [data-theme="dark"]) .web-entry-primary,
html:is([data-theme="light"], [data-theme="dark"]) .web-auth-submit {
  border-color: rgba(255, 255, 255, 0.28);
}

/* Иконки интерфейса — локальные монохромные outline-SVG. В тёмной теме
   перекрашиваем только служебные иконки меню и фильтров; логотипы и личные
   фотографии намеренно не затрагиваем. */
html[data-theme="dark"] .bottom-navigation .menu-item:not(.menu-logo):not(.menu-profile-avatar) .menu-icon,
html[data-theme="dark"] .bottom-navigation .menu-item--add-publication .menu-plus,
html[data-theme="dark"] .ui-icon,
html[data-theme="dark"] .notification-shortcut-icon {
  color: rgba(205, 214, 212, 0.76);
  filter:
    drop-shadow(-1px -1px 1.5px var(--icon-shadow-light))
    drop-shadow(2px 3px 3px var(--icon-shadow-dark));
}

html[data-theme="dark"] select,
html[data-theme="dark"] select.form-control {
  background-image: url('/assets/icons/tabler/chevron-down-light.svg');
}

html[data-theme="dark"] img[src$="/lock.png"] {
  filter:
    brightness(0) invert(1)
    drop-shadow(-2px -2px 2px var(--shadow-dark))
    drop-shadow(2px 2px 2px var(--shadow-light));
}

/* Без атрибута data-theme используется тот же стеклянный default-скин.
   Это покрывает standalone-страницы регистрации и webvers, где header.php
   не подключается и не успевает установить тему через JS. */
html:not([data-theme]) body {
  background-color: var(--app-bg);
  background-image: var(--app-bg-gradient);
  background-attachment: fixed;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  html:not([data-theme]) :where(
    .card,
    .logo-link,
    .profile-card,
    .form-section,
    .accordion,
    .landing-role,
    .landing-role__action,
    .role-card,
    .register-card,
    .webvers-card,
    .modal,
    .modal-content,
    .modal-dialog,
    .notification-popup,
    .cookie-consent,
    .page-header__button,
    .bottom-navigation__capsule,
    .bottom-navigation .menu-item,
    .theme-option
  ) {
    -webkit-backdrop-filter: blur(10px) saturate(112%);
    backdrop-filter: blur(10px) saturate(112%);
  }
}

/* Главная страница: единый ролевой аккордеон.
   Все три роли имеют одинаковую геометрию и не меняют размер при открытии:
   панель действий раскрывается внутри той же поверхности. */
.landing-page .landing-role {
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-raised);
  transition: box-shadow 180ms ease;
}

.landing-page .landing-role.is-open {
  box-shadow: var(--shadow-raised);
}

.landing-page .landing-role__toggle {
  height: 64px;
  min-height: 64px;
  padding: 0 48px 0 20px;
  border-radius: var(--radius-card);
  font-weight: 400;
}

.landing-page .landing-role__toggle:active {
  transform: none;
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
}

.landing-page .landing-role__toggle:focus-visible,
.landing-page .landing-role__action:focus-visible {
  outline: none;
}

.landing-page .landing-role__panel {
  padding: var(--space-8) 20px 20px;
  text-align: center;
}

.landing-page .landing-role__panel > p {
  color: var(--color-muted);
  text-align: center;
}

.landing-page .landing-role__actions {
  gap: var(--space-8);
}

.landing-page .landing-role__action {
  height: 48px;
  min-height: 48px;
  padding: 0 12px;
  font-weight: 400;
}

.landing-page .landing-role__toggle:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.landing-page .landing-role__action:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-accent), var(--shadow-soft);
}

.landing-page .landing-role__action--disabled,
.landing-page .auth-account-switch--disabled {
  color: var(--color-muted);
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  cursor: not-allowed;
  opacity: .72;
}

@media (max-width: 380px) {
  .landing-page .landing-role__actions {
    grid-template-columns: 1fr;
  }
}

/* Авторизация: пароль остаётся обычным полем, а переключатель видимости
   занимает только небольшую область внутри него. */
.landing-page .auth-password-field {
  position: relative;
  width: 100%;
}

.landing-page .auth-password-field input {
  padding-right: 88px;
}

.landing-page .auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 1;
  width: auto !important;
  min-width: 68px;
  min-height: 32px;
  height: 32px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-base);
  color: var(--color-muted);
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-base);
  font-size: var(--cl-type-caption);
  font-weight: 400;
  line-height: 1;
  text-transform: none;
  transform: translateY(-50%);
  cursor: pointer;
}

.landing-page .auth-form .auth-password-toggle {
  height: 32px;
  min-height: 32px;
  margin-top: 0;
  color: var(--color-muted);
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  font-weight: 400;
}

.landing-page .auth-password-toggle:hover,
.landing-page .auth-password-toggle:focus-visible {
  color: var(--color-text);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.landing-page .auth-password-toggle:active {
  color: var(--color-text);
  background: var(--surface-pressed);
  box-shadow: var(--shadow-inset);
  transform: translateY(-50%);
}

/* Финальная настройка всех всплывающих поверхностей. Она стоит после
   общих стеклянных правил, чтобы попапы не возвращались к более слабому
   blur из базовой темы. */
html:is([data-theme="light"], [data-theme="dark"]) :is(
  .notification-popup,
  .cookie-consent,
  .modal,
  .profile-post-dialog__panel,
  .telegram-login-modal__dialog,
  .register-avatar-crop__dialog,
  .events-calendar__dialog-surface
),
html:not([data-theme]) :is(
  .notification-popup,
  .cookie-consent,
  .modal,
  .profile-post-dialog__panel,
  .telegram-login-modal__dialog,
  .register-avatar-crop__dialog,
  .events-calendar__dialog-surface
) {
  background: var(--surface-modal);
  -webkit-backdrop-filter: blur(16px) saturate(94%);
  backdrop-filter: blur(16px) saturate(94%);
}

/* Служебная строка и пустое состояние страницы подписок. */
.favorites-results-meta {
  width: 100%;
  max-width: var(--control-width, 344px);
  min-height: 16px;
  margin: 0 auto var(--space-8, 8px);
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8, 8px);
  box-sizing: border-box;
  color: var(--color-muted, #5f5f64);
  font-size: var(--cl-type-caption);
  line-height: 1.25;
}

.favorites-filters-reset,
.favorites-empty-state__link {
  flex: 0 0 auto;
  color: var(--color-accent-strong, #004B56);
  font-size: var(--cl-type-eyebrow);
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none !important;
}

.favorites-filters-reset:hover,
.favorites-filters-reset:focus-visible,
.favorites-empty-state__link:hover,
.favorites-empty-state__link:focus-visible {
  color: var(--color-accent, #0b6f68);
  text-decoration: none !important;
}

.favorites-empty-state {
  width: 100%;
  max-width: var(--control-width, 344px);
  margin: 0 auto;
  padding: var(--space-16, 16px) 0;
  text-align: center;
}

.favorites-empty-state .no-results {
  margin: 0;
}

.favorites-empty-state__link {
  display: inline-flex;
  margin-top: var(--space-8, 8px);
}

/* Shared Tabler primitives for compact controls and icon-only actions. */
.ui-icon,
.feed-post-icon,
.feed-comment-submit-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--ui-icon) center / contain no-repeat;
  mask: var(--ui-icon) center / contain no-repeat;
  filter:
    drop-shadow(-1px -1px 1.5px var(--icon-shadow-dark))
    drop-shadow(2px 2px 2.5px var(--icon-shadow-light));
  pointer-events: none;
}

.ui-icon--arrow-left { --ui-icon: url('/assets/icons/tabler/arrow-left.svg'); }
.ui-icon--arrow-up { --ui-icon: url('/assets/icons/tabler/arrow-up.svg'); }
.ui-icon--arrow-down { --ui-icon: url('/assets/icons/tabler/arrow-down.svg'); }
.ui-icon--plus { --ui-icon: url('/assets/icons/tabler/plus.svg'); }
.ui-icon--heart { --ui-icon: url('/assets/icons/tabler/heart.svg'); }
.ui-icon--message-circle { --ui-icon: url('/assets/icons/tabler/message-circle.svg'); }
.ui-icon--phone { --ui-icon: url('/assets/icons/tabler/phone.svg'); }
.ui-icon--external-link { --ui-icon: url('/assets/icons/tabler/external-link.svg'); }
.ui-icon--x { --ui-icon: url('/assets/icons/tabler/x.svg'); }
.ui-icon--chevron-left { --ui-icon: url('/assets/icons/tabler/chevron-left.svg'); }
.ui-icon--chevron-right { --ui-icon: url('/assets/icons/tabler/chevron-right.svg'); }
.ui-icon--chevron-down { --ui-icon: url('/assets/icons/tabler/chevron-down.svg'); }
.ui-icon--user-circle { --ui-icon: url('/assets/icons/tabler/user-circle.svg'); }
.ui-icon--calendar-event { --ui-icon: url('/assets/icons/tabler/calendar-event.svg'); }
.ui-icon--settings { --ui-icon: url('/assets/icons/tabler/settings.svg'); }
.ui-icon--lock { --ui-icon: url('/assets/icons/tabler/lock.svg'); }
.ui-icon--pencil { --ui-icon: url('/assets/icons/tabler/pencil.svg'); }
.ui-icon--check { --ui-icon: url('/assets/icons/tabler/check.svg'); }
.ui-icon--play { --ui-icon: url('/assets/icons/tabler/player-play.svg'); }

span.feed-post-icon,
span.feed-comment-submit-icon {
  width: 13px;
  height: 13px;
}

span.feed-post-heart-icon { --ui-icon: url('/assets/icons/tabler/heart.svg'); }
span.feed-post-comment-icon { --ui-icon: url('/assets/icons/tabler/message-circle.svg'); }
span.feed-post-share-icon,
span.feed-comment-submit-icon { --ui-icon: url('/assets/icons/tabler/send.svg'); }

.cartochka_comment__reply::before {
  content: '';
  width: 16px;
  height: 16px;
  margin: 0;
  background: currentColor;
  -webkit-mask: url('/assets/icons/tabler/corner-up-left.svg') center / contain no-repeat;
  mask: url('/assets/icons/tabler/corner-up-left.svg') center / contain no-repeat;
  transform: none;
}

.feed-comment-reply-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 0;
}

.profile-post-dialog__close::before,
.telegram-login-modal__close::before,
.register-avatar-crop__close::before,
.events-calendar__dialog-close::before,
.calendar-connections-settings__close::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url('/assets/icons/tabler/x.svg') center / contain no-repeat;
  mask: url('/assets/icons/tabler/x.svg') center / contain no-repeat;
}

.profile-post-dialog__close,
.telegram-login-modal__close,
.register-avatar-crop__close,
.events-calendar__dialog-close,
.calendar-connections-settings__close {
  font-size: 0 !important;
}

.back-button::before,
.profile-back-btn::before,
.back-button--utility::before {
  content: '';
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  background: currentColor;
  -webkit-mask: url('/assets/icons/tabler/arrow-left.svg') center / contain no-repeat;
  mask: url('/assets/icons/tabler/arrow-left.svg') center / contain no-repeat;
  font-size: 0;
}

.back-button--utility::before {
  flex-basis: 22px;
  width: 22px;
  height: 22px;
}

.events-calendar__nav > .ui-icon,
.customer-calendar__nav > .ui-icon {
  width: 18px;
  height: 18px;
}

.rating-value .ui-icon--lock {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  filter: none;
}

.ring-label .ui-icon--lock {
  width: 48px;
  height: 48px;
}

.create-event-page .add-venue-btn .ui-icon--plus {
  width: 22px;
  height: 22px;
}

.notification-open .ui-icon,
.cc-section-link .ui-icon,
.customer-event-progress a .ui-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

/* Shared material, states and button geometry live in style.css.  The
   compatibility sheet ends with the legacy icon dimensions above. */
