.f7-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.f7-modal[hidden] {
  display: none;
}
.f7-modal-box {
  background: #fff;
  padding: 1.5rem;
  border-radius: 10px;
  max-width: 400px;
  width: 90%;
  position: relative;
}
.f7-login-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 1rem;
  border-bottom: 1px solid #ddd;
}
.f7-login-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: #f0f0f0;
  cursor: pointer;
  font: inherit;
  border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
}
.f7-login-tab.is-active {
  background: #fff;
  border: 1px solid #ddd;
  border-bottom-color: #fff;
  font-weight: 600;
}
.f7-cabinet-modal-title {
  margin-top: 0;
}

.f7-cabinet-modal .f7-cabinet-modal-title,
.f7-cabinet-modal .f7-login-tab,
.f7-cabinet-modal .f7-cabinet-login-form label {
  color: #000;
}

.f7-recovery-wrap {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.f7-recovery-link {
  display: inline;
  color: #000;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.f7-recovery-link:hover,
.f7-recovery-link:focus-visible {
  color: #222;
}
.f7-modal-close {
  position: absolute;
  right: 8px;
  top: 4px;
  border: 0;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Сообщения в модалке и в кабинете — плашки */
.f7-cabinet-msg,
.f7-cabinet-login-msg {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.35;
  min-height: 0;
}
.f7-cabinet-msg:empty,
.f7-cabinet-login-msg:empty {
  display: none;
  padding: 0;
  margin: 0;
}
.f7-cabinet-msg:not(:empty),
.f7-cabinet-login-msg:not(:empty) {
  display: block;
}
.f7-cabinet-msg.is-success,
.f7-cabinet-login-msg.is-success {
  background: #e6f4ea;
  color: #1e4620;
  border: 1px solid #a3cfac;
}
.f7-cabinet-msg.is-error,
.f7-cabinet-login-msg.is-error {
  background: #fce8e6;
  color: #5c1d1d;
  border: 1px solid #f0b4b0;
}

/* Кнопка-чип: аватар + имя */
.f7-cabinet-logged .f7-cabinet-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fafafa;
  max-width: 100%;
  box-sizing: border-box;
}
.f7-cabinet-chip:hover {
  border-color: #bbb;
  background: #f3f3f3;
}
.f7-cabinet-chip-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.f7-cabinet-chip-ph {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ddd;
  flex-shrink: 0;
}
.f7-cabinet-chip-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

/* Сетка кабинета 50/50 */
.f7-cabinet-grid {
  display: grid;
  grid-template-columns: 4fr 3fr;
  gap: 1.25rem 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .f7-cabinet-grid {
    grid-template-columns: 1fr;
  }
}
.f7-cabinet-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.f7-cabinet-history-inner {
  font-size: 0.9rem;
  overflow-x: auto;
}
.f7-cabinet-history-inner table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.f7-cabinet-history-inner th,
.f7-cabinet-history-inner td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.f7-cabinet-history-inner th {
  font-size: 12px;
}

.f7-cabinet-history-inner .f7-place-emoji {
  font-size: 1.75rem;
  line-height: 1;
  display: inline-block;
}

.f7-cabinet-history-inner .f7-col-place-headless {
  width: 3rem;
  padding: 0.35rem 0.25rem;
}

.f7-cabinet-col-profile .f7-cabinet-avatar-wrap {
  margin-bottom: 0.5rem;
}
.f7-avatar-upload-target {
  position: relative;
  display: inline-block;
  max-width: 200px;
  width: 100%;
}
.f7-avatar-remove-x {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 6;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.f7-avatar-remove-x:hover,
.f7-avatar-remove-x:focus-visible {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
}
.f7-avatar-upload-target:not(:has(img.f7-avatar-preview)) .f7-avatar-remove-x {
  display: none;
}
.f7-avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.f7-avatar-hit {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}
.f7-cabinet-profile .f7-avatar-preview,
.f7-avatar-placeholder {
  width: 100%;
  max-width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
  display: block;
}
.f7-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 8px;
  pointer-events: none;
}
.f7-avatar-hit:hover .f7-avatar-overlay,
.f7-avatar-hit:focus-within .f7-avatar-overlay {
  opacity: 1;
}
.f7-crop-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.f7-profile-form-compact .f7-profile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
}
.f7-profile-form-compact .f7-profile-fields > p {
  margin: 0;
}
.f7-profile-form-compact .f7-profile-fields > p label {
  font-size: 0.8rem;
}
.f7-profile-form-compact .f7-profile-fields input.widefat {
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
  min-height: 2rem;
}
@media (max-width: 520px) {
  .f7-profile-form-compact .f7-profile-fields {
    grid-template-columns: 1fr;
  }
}
.f7-profile-inline {
  grid-column: span 1;
}
.f7-crop-wrap {
  max-width: 100%;
  margin-top: 0.5rem;
}
.f7-crop-wrap img {
  max-width: 100%;
  display: block;
}
.f7-cabinet-logout-wrap {
  margin: 50px 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e5e5;
}
.button.f7-cabinet-logout {
  display: inline-block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  padding: 15px;
}
