:root {
  --color-black: #0a0a0a;
  --color-white: #ffffff;
  --color-red: #c41e3a;
  --color-red-hover: #a01830;
  --color-gray: #f5f5f5;
  --color-border: #ddd;
  --font-sans: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-black);
  background: var(--color-white);
}

body.modal-open,
body.lightbox-open {
  overflow: hidden;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  background: var(--color-black);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-top {
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0;
}
.header-top-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.header-contact {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.2rem 0;
  transition: color 0.15s ease;
}
.header-contact:hover {
  color: var(--color-red);
}

.site-footer {
  background: var(--color-black);
  color: var(--color-white);
  padding: 1rem 0;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}
.site-footer .container {
  display: flex;
  justify-content: center;
  align-items: center;
}
.footer-contact {
  font-size: 0.875rem;
  color: var(--color-white);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-contact:hover {
  color: var(--color-red);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 0;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-white);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.brand:hover {
  color: var(--color-white);
  opacity: 0.9;
}
.brand-logo {
  display: flex;
  align-items: center;
}
.brand-logo:hover {
  color: inherit;
}
.brand-img {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

.site-header .nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.site-header .nav a {
  color: var(--color-white);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
.site-header .nav a:hover {
  color: var(--color-red);
}

.nav-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  padding: 0.35rem;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-icon-link:hover {
  color: var(--color-red);
  background: rgba(255, 255, 255, 0.06);
}
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-icon svg {
  display: block;
}

.nav-user-dropdown {
  position: relative;
}
.nav-user-trigger {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-white);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.nav-user-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-white);
}
.nav-user-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}
.nav-user-icon {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.95;
}
.nav-user-icon svg {
  display: block;
}
.nav-user-label {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  min-width: 180px;
  padding: 0.4rem 0;
  background: var(--color-black);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
}
.nav-user-menu[hidden] {
  display: none;
}
.nav-user-menu a {
  display: block;
  padding: 0.55rem 1rem;
  color: var(--color-white);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-user-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-red);
}

.main-content {
  min-height: calc(100vh - 60px);
  padding: 2rem 0;
}

.flashes {
  margin-bottom: 1rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.flash-success {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #1b5e20;
}

.flash-error {
  background: #ffebee;
  border: 1px solid #ef9a9a;
  color: #b71c1c;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--color-red);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-red-hover);
  color: var(--color-white);
}

.btn-secondary {
  background: var(--color-black);
  color: var(--color-white);
}

.btn-secondary:hover {
  background: #333;
  color: var(--color-white);
}

.btn-outline {
  background: transparent;
  color: var(--color-red);
  border: 1px solid var(--color-red);
}

.btn-outline:hover {
  background: var(--color-red);
  color: var(--color-white);
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
}

.btn-full {
  width: 100%;
}

.input-text,
.input-select,
.input-textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-white);
  color: var(--color-black);
}

.input-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.form-hint {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.form-page h1,
.page-cabinet h1,
.page-lot-detail h1,
.page-admin h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.lead {
  margin-bottom: 1.5rem;
  color: #444;
}

.add-lot-section-top {
  margin-bottom: 2rem;
  padding-top: 0.5rem;
}

.add-lot-box {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1.75rem;
  background: var(--color-gray);
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.add-lot-section .add-lot-row {
  margin-bottom: 1rem;
}

.add-lot-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.auction-link {
  color: var(--color-red);
  border: 1px solid var(--color-red);
  background: transparent;
  text-decoration: none;
}

.auction-link:hover {
  background: var(--color-red);
  color: var(--color-white);
}

.add-lot-or {
  font-size: 0.9rem;
  color: #555;
}

.form-row-with-loading {
  position: relative;
}

.add-lot-section .add-lot-form-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.add-lot-section .input-text {
  flex: 1;
  min-width: 200px;
}

.page-index .hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.page-index .hero.hero-compact {
  margin-bottom: 2rem;
}

.page-index .hero h1 {
  font-size: 1.85rem;
  margin-bottom: 0.75rem;
}

.hero-lead {
  color: #444;
  font-size: 1.1rem;
  line-height: 1.5;
  max-width: 640px;
  margin: 0 auto;
}

.about-blocks {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
}

.about-blocks-title {
  font-size: 1.35rem;
  margin: 0 0 1.5rem;
  text-align: center;
}

.about-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.about-card {
  padding: 1.35rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.about-card:hover {
  border-color: var(--color-red);
  box-shadow: 0 2px 12px rgba(196, 30, 58, 0.08);
}

.about-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  color: var(--color-black);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-red);
}

.about-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #333;
}

.about-steps-block {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.about-steps-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--color-black);
}

.about-steps-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #333;
}

.about-step:last-child {
  margin-bottom: 0;
}

.about-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-red);
  color: var(--color-white);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 50%;
}

.nav-auction {
  font-weight: 500;
}

.loading-indicator {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem 0;
}

.loading-indicator[aria-hidden="false"] {
  display: flex;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-red);
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
}

.loading-text {
  font-size: 0.95rem;
  color: #555;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.form-auth,
.form-edit {
  max-width: 100%;
}

.form-edit-block {
  padding: 1.5rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.product-edit-lot-photo-wrap {
  margin-top: 0.5rem;
}

.product-edit-lot-photo-single {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.product-edit-lot-photo-single.js-lightbox {
  cursor: zoom-in;
}

.form-edit .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.error {
  color: var(--color-red);
  font-size: 0.9rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox label {
  margin-bottom: 0;
}

.back-link {
  color: var(--color-red);
  text-decoration: none;
  margin-bottom: 1rem;
  display: inline-block;
}

.back-link:hover {
  text-decoration: underline;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s;
}

.modal[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.modal-box {
  position: relative;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  width: 560px;
  overflow: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-black);
  z-index: 1;
}

.modal-close:hover {
  color: var(--color-red);
}

.modal-title {
  margin: 0;
  padding: 1.25rem 3rem 0.75rem 1.25rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}

.modal-body {
  padding: 1.25rem;
  position: relative;
}

.modal-progress {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
}
.modal-progress[aria-hidden="false"] {
  display: flex;
}
.modal-progress-bar {
  width: 100%;
  max-width: 280px;
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}
.modal-progress-fill {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--color-red);
  border-radius: 4px;
  animation: modal-progress-pulse 1.2s ease-in-out infinite;
}
@keyframes modal-progress-pulse {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(200%); }
}
.modal-progress-text {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
}

.lot-product-summary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0;
  background: var(--color-white);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.lot-summary-photos {
  width: 100%;
  padding: 1rem;
  background: var(--color-gray);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  align-content: flex-start;
  max-height: 280px;
  overflow: auto;
}

.lot-summary-photo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  display: block;
  flex-shrink: 0;
}

.lot-product-summary .lot-summary-no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  font-size: 0.9rem;
  color: #666;
  background: var(--color-white);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.lot-summary-info {
  padding: 0 1.25rem 1.25rem;
  min-width: 0;
}

.lot-summary-title {
  font-weight: 600;
  line-height: 1.4;
  font-size: 1.05rem;
  margin: 0 0 1rem;
  color: var(--color-black);
}

.lot-summary-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1.25rem;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.lot-summary-meta dt {
  margin: 0;
  color: #555;
  font-weight: 500;
}

.lot-summary-meta dd {
  margin: 0;
  color: var(--color-black);
}

.lot-summary-link {
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.lot-summary-link a {
  color: var(--color-red);
  font-size: 0.95rem;
}

.lot-summary-link a:hover {
  text-decoration: underline;
}

.confirm-form {
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.confirm-form .form-group {
  margin-bottom: 0.75rem;
}

.confirm-form .form-group .input-text {
  max-width: 160px;
}

.confirm-form .btn {
  margin-top: 0.5rem;
  padding: 0.6rem 1.5rem;
}

.lot-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.lot-card {
  margin: 0;
}

.lot-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--color-white);
}

.lot-card-link:hover {
  border-color: var(--color-red);
  box-shadow: 0 4px 12px rgba(196, 30, 58, 0.12);
}

.lot-card-img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-gray);
}

.lot-card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  font-size: 0.9rem;
  color: #666;
  background: var(--color-gray);
}

.lot-card-body {
  padding: 1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lot-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lot-card-status {
  font-size: 0.8rem;
  color: #555;
  margin-top: auto;
}

.cabinet-section {
  margin-bottom: 2rem;
}
.cabinet-section-title {
  font-size: 1.1rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
.cabinet-section-archive .lot-card {
  position: relative;
}
.lot-card-archived .lot-card-link {
  opacity: 0.9;
  border-radius: 10px 10px 0 0;
}
.lot-card-unarchive {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-gray);
  border-radius: 0 0 10px 10px;
}
.lot-unarchive-select {
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: inherit;
  min-width: 160px;
}

.cabinet-nav {
  display: flex;
  gap: 1rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.cabinet-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-black);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.cabinet-nav-link:hover {
  color: var(--color-red);
}
.cabinet-nav-link-active {
  font-weight: 600;
  border-bottom-color: var(--color-red);
  color: var(--color-red);
}
.cabinet-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cabinet-nav-icon svg {
  display: block;
}

.cabinet-profile-block {
  max-width: 480px;
}
.cabinet-profile-avatar-block {
  margin-bottom: 1.5rem;
}
.cabinet-profile-avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
}
.cabinet-profile-avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--color-gray);
  border: 2px solid var(--color-border);
}
.form-profile .form-group {
  margin-bottom: 1rem;
}
.form-hint {
  font-size: 0.85rem;
  color: #666;
  margin: 0.25rem 0 0;
}
.form-profile .input-text[readonly],
.form-profile .input-text[disabled] {
  background: var(--color-gray);
  cursor: not-allowed;
}
.cabinet-profile-password-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.cabinet-profile-password-title {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}
.form-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.empty-state {
  color: #555;
}

.empty-state a {
  color: var(--color-red);
}

.page-header-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header-block h1 {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.page-header-block .lead {
  margin-bottom: 0.75rem;
}

.page-header-actions {
  margin-top: 1rem;
}

.empty-state-block {
  padding: 2.5rem 1.5rem;
  background: var(--color-gray);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  text-align: center;
}

.empty-state-block p {
  margin: 0 0 1rem;
  color: #555;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.admin-nav-link {
  color: var(--color-black);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.admin-nav-link:hover {
  color: var(--color-red);
}
.admin-nav-link-active {
  font-weight: 600;
  border-bottom-color: var(--color-red);
  color: var(--color-red);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.admin-clients-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}
.admin-clients-search-input {
  min-width: 200px;
  max-width: 320px;
}

.filter-block {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--color-gray);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.admin-table-block {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
  background: var(--color-gray);
  color: var(--color-black);
}

.form-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.form-page-box {
  max-width: 420px;
  width: 100%;
  padding: 2rem 2rem 1.75rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.form-page-box h1 {
  margin: 0 0 1.5rem;
  text-align: center;
}

.form-page-hint {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--color-text-muted, #666);
}

.form-page-link {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.95rem;
}

.form-page-link a {
  color: var(--color-red);
}

.form-page-link a:hover {
  text-decoration: underline;
}

.lot-detail header.lot-detail-header {
  margin-bottom: 2rem;
  display: grid;
  gap: 1.25rem;
}

.lot-detail-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0;
}

.lot-detail-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  display: block;
}

.lot-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lot-detail-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
}

.lot-status {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  background: var(--color-gray);
  color: var(--color-black);
  border: 1px solid var(--color-border);
}

.lot-detail-yahoo-link {
  color: var(--color-red);
  font-size: 0.95rem;
}

.lot-detail-yahoo-link:hover {
  text-decoration: underline;
}

.lot-detail-img {
  max-width: 100%;
  width: 280px;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.lot-detail-img-placeholder {
  width: 280px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray);
  color: #666;
  border-radius: 8px;
}

.lot-summary,
.lot-timeline {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--color-gray);
  border-radius: 10px;
  border: 1px solid var(--color-border);
}

.lot-summary h2,
.lot-timeline h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.summary-list li {
  padding: 0.35rem 0;
  font-size: 0.95rem;
}

.section-hint {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.lot-warehouse-photos,
.lot-warehouse-comment {
  margin-top: 1.5rem;
}

.warehouse-comment {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--color-gray);
  border-radius: 4px;
}

/* Админка: загрузка фото со склада */
.warehouse-photos-current {
  margin-bottom: 0.75rem;
}

.warehouse-photos-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.warehouse-photo-item {
  margin: 0;
}

.warehouse-photo-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  border: 2px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.warehouse-photo-label:hover {
  background: var(--color-gray);
  border-color: var(--color-border);
}

.warehouse-photo-label:has(.warehouse-photo-remove:checked) {
  border-color: var(--color-red);
  background: #fef2f2;
}

.warehouse-photo-remove {
  margin: 0;
}

.warehouse-photo-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  display: block;
}

.warehouse-photo-remove-text {
  font-size: 0.8rem;
  color: #555;
}

.warehouse-photo-label:has(.warehouse-photo-remove:checked) .warehouse-photo-remove-text {
  color: var(--color-red);
  font-weight: 600;
}

.input-file {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--color-red);
  padding-left: 1rem;
  margin-left: 0.5rem;
}

.timeline li {
  margin-bottom: 0.75rem;
  position: relative;
}

.timeline-status {
  font-weight: 600;
  display: block;
}

.timeline-date {
  font-size: 0.85rem;
  color: #555;
}

.timeline-comment {
  display: block;
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.25rem;
}

.filter-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}

.filter-form label {
  margin: 0;
  font-weight: 600;
}

.filter-form select {
  padding: 0.4rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.admin-table th {
  font-weight: 600;
  background: var(--color-gray);
  color: var(--color-black);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.015em;
}

.admin-table tbody tr:hover td {
  background: #fafafa;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* Админка: список-лента лотов */
.admin-lot-list-block {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
}

.admin-lot-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-lot-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  min-width: 0;
}

.admin-lot-row:last-child {
  border-bottom: none;
}

.admin-lot-row:hover {
  background: #fafafa;
}

.admin-lot-row-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-gray);
}

.admin-lot-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-lot-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #888;
}

.admin-lot-row-content {
  flex: 1;
  min-width: 0;
}

.admin-lot-row-main {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-lot-sep {
  flex-shrink: 0;
  color: #555;
  margin: 0 0.25rem 0 0;
}

.admin-lot-id-link,
.admin-lot-id {
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.admin-lot-id-link {
  color: var(--color-red);
  text-decoration: none;
}

.admin-lot-id-link:hover {
  text-decoration: underline;
}

.admin-lot-title {
  font-size: 0.9rem;
  color: var(--color-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.admin-lot-row-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #555;
}

.admin-lot-yahoo-id {
  font-size: 0.8rem;
  color: #777;
}

.admin-lot-client {
  font-weight: 500;
}

.admin-lot-client-email {
  font-size: 0.8rem;
  color: #777;
}

.admin-lot-row-meta .status-badge {
  margin: 0;
}

.admin-lot-price {
  font-weight: 500;
}

.admin-lot-row-actions {
  flex-shrink: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-pagination {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-gray);
}

.admin-pagination-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.admin-pagination-link {
  color: var(--color-red);
  text-decoration: none;
  font-size: 0.95rem;
}

.admin-pagination-link:hover {
  text-decoration: underline;
}

.admin-pagination-link-disabled {
  color: #999;
  cursor: default;
  pointer-events: none;
}

.admin-pagination-info {
  font-size: 0.9rem;
  color: #555;
}

/* Цвета статусов только в админ-панели */
.page-admin .status-создан { background: #e5e7eb; color: #374151; }
.page-admin .status-в-обработке { background: #dbeafe; color: #1e40af; }
.page-admin .status-ставка-сделана { background: #bfdbfe; color: #1d4ed8; }
.page-admin .status-выкуплено { background: #d1fae5; color: #047857; }
.page-admin .status-не-выкуплено { background: #fee2e2; color: #b91c1c; }
.page-admin .status-в-пути-на-склад { background: #ccfbf1; color: #0f766e; }
.page-admin .status-доставлен-на-склад { background: #a7f3d0; color: #065f46; }
.page-admin .status-отправлен { background: #bbf7d0; color: #15803d; }
.page-admin .status-доставлено { background: #86efac; color: #166534; }
.page-admin .status-в-архиве { background: #9ca3af; color: #1f2937; }

@media (max-width: 640px) {
  .admin-lot-row {
    flex-wrap: wrap;
  }

  .admin-lot-row-content {
    flex-basis: 100%;
    order: 1;
    margin-top: 0;
  }

  .admin-lot-row-thumb {
    order: 0;
  }

  .admin-lot-row-actions {
    flex-basis: 100%;
    order: 2;
    justify-content: flex-start;
  }

  .admin-lot-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* Лайтбокс для фото в личном кабинете */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-white);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close:focus {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* Курсор «рука» для кликабельных фото */
.lot-detail-photo.js-lightbox,
.lot-detail-img.js-lightbox,
.lot-card-img.js-lightbox {
  cursor: zoom-in;
}

/* --- Чаты --- */
.chats-page {
  height: calc(100vh - 56px - 4rem);
  min-height: 320px;
  margin: 0 -1rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
}
.chats-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.chats-sidebar {
  width: var(--chats-sidebar-width, 240px);
  min-width: 180px;
  max-width: min(400px, 50vw);
  flex-shrink: 0;
  background: linear-gradient(180deg, #fafafa 0%, var(--color-gray) 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--color-border);
}
.chats-resizer {
  width: 6px;
  flex-shrink: 0;
  background: var(--color-border);
  cursor: col-resize;
  transition: background 0.15s;
}
.chats-resizer:hover,
.chats-resizer:active {
  background: var(--color-red);
}
.chats-resizer::after {
  content: '';
  display: block;
  width: 2px;
  height: 24px;
  margin: 50% auto 0;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 1px;
}
.chats-sidebar-title {
  margin: 0;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-black);
  background: var(--color-white);
  flex-shrink: 0;
}
.chats-empty {
  padding: 1.25rem;
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
}
.chats-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.chats-list-item {
  margin: 0 0.5rem 0;
  border-radius: 8px;
  overflow: hidden;
}
.chats-list-item:last-child {
  margin-bottom: 0;
}
.chats-list-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem;
  text-decoration: none;
  color: var(--color-black);
  border-radius: 8px;
  transition: background 0.15s ease;
}
.chats-list-link:hover {
  background: rgba(0, 0, 0, 0.06);
}
.chats-list-item-active .chats-list-link {
  background: var(--color-white);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.chats-list-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-border);
  position: relative;
}
.chats-list-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chats-list-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #666;
}
.chats-list-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1;
}
.chats-list-badge-lot {
  background: var(--color-red);
}
.chats-list-badge-lot svg {
  display: block;
}
.chats-list-badge-question {
  background: #666;
}
.chats-list-badge-question span {
  line-height: 1;
}
.chats-list-topic {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chats-list-unread {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-white);
  background: var(--color-red);
  border-radius: 10px;
}
.chats-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  overflow: hidden;
}
.chats-main-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: linear-gradient(180deg, #fafafa 0%, var(--color-white) 100%);
}
.chats-main-header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.chats-main-header-thumb-wrap {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
}
.chats-main-lot-thumb-wrap {
  flex-shrink: 0;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.chats-main-lot-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  display: block;
}
.chats-main-lot-thumb-placeholder {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #666;
}
.chats-main-header-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-white);
  background: #666;
  border: 2px solid var(--color-white);
  line-height: 1;
}
.chats-main-header-badge-lot {
  background: var(--color-red);
}
.chats-main-header-badge-lot svg {
  display: block;
}
.chats-main-header-badge-question {
  background: #666;
}
.chats-main-header-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.chats-main-header-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.chats-main-lot-archive-badge {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  background: #e8e8e8;
  color: #555;
  border-radius: 6px;
  font-weight: 600;
}
.chats-main-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #555;
}
.chats-main-header-meta-row {
  display: inline-block;
}
.chats-main-header-meta-row strong {
  margin-right: 0.35rem;
}
.chats-main-header-meta-extra {
  margin-top: 0.25rem;
}
.chats-main-header-product {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chats-main-header-price {
  font-weight: 600;
  color: var(--color-black);
}
.chats-main-header-date {
  color: #666;
}
.chats-main-topic {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-black);
}
.chats-main-lot-link {
  font-size: 0.9rem;
  color: var(--color-red);
  text-decoration: none;
}
.chats-main-lot-link:hover {
  text-decoration: underline;
}
.chats-main-header-links .btn-create-lot-from-chat {
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
}
.chats-main-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  padding: 2rem;
  font-size: 1rem;
}
.chats-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fafafa;
}
.chat-msg {
  max-width: 85%;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.chat-msg-own {
  align-self: flex-end;
  background: #e8f4fc;
  border-color: rgba(196, 30, 58, 0.15);
}
.chat-msg-other {
  align-self: flex-start;
  background: var(--color-white);
}
.chat-msg-meta {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.3rem;
}
.chat-msg-author {
  font-weight: 600;
  margin-right: 0.5rem;
  color: var(--color-black);
}
.chat-msg-body {
  margin: 0 0 0.25rem 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}
.chat-msg-attachment {
  margin-top: 0.35rem;
}
.chat-msg-attachment-img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  display: block;
  border: 1px solid var(--color-border);
}
.chat-msg-attachment-link {
  font-size: 0.9rem;
  color: var(--color-red);
  text-decoration: none;
}
.chat-msg-attachment-link:hover {
  text-decoration: underline;
}
.chats-form {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-white);
}
.chats-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}
.chats-form-body {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chats-form-body:focus {
  outline: none;
  border-color: var(--color-red);
  box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.15);
}
.chats-form-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.chats-form-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.chats-form-icon-btn .chats-form-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.chats-form-icon-btn .chats-form-icon svg {
  flex-shrink: 0;
}
.chats-form-file-label.chats-form-icon-btn {
  background: transparent;
  color: var(--color-red);
  border: 1px solid var(--color-red);
}
.chats-form-file-label.chats-form-icon-btn:hover {
  background: var(--color-red);
  color: var(--color-white);
}
.chats-form-icon-btn.btn-primary {
  border: none;
}
.chats-form-file {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
}
.chats-form-file-label {
  cursor: pointer;
}
.chats-form-hint {
  margin: 0.5rem 0 0 0;
  font-size: 0.85rem;
  color: #666;
}

.modal-ask-manager-row {
  margin: 0 0 1rem 0;
}
.modal-ask-manager-row .btn {
  margin: 0;
}

/* --- Адаптив: шапка для мобильных --- */
@media (max-width: 768px) {
  .header-top {
    padding: 0.25rem 0;
  }
  .header-contact {
    font-size: 0.6rem;
  }
  .header-inner {
    padding: 0.5rem 0;
    gap: 0.5rem;
  }
  .brand-img {
    height: 28px;
  }
  .site-header .nav {
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
    justify-content: flex-end;
  }
  .nav-icon-link {
    padding: 0.4rem;
    min-width: 44px;
    min-height: 44px;
  }
  .nav-user-trigger {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }
  .nav-user-label {
    max-width: 100px;
  }
  .nav-user-menu {
    min-width: 160px;
    right: 0;
  }
}

@media (max-width: 480px) {
  .nav-user-label {
    max-width: 72px;
  }
}

/* --- Адаптив: общий и чаты --- */
@media (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }
  .main-content {
    padding: 1.5rem 0;
  }
  .site-header .header-inner {
    flex-wrap: wrap;
  }
  .site-header .nav {
    width: 100%;
    order: 3;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
  }
  .site-header .nav a {
    padding: 0.25rem 0;
  }
  .chats-page {
    height: calc(100vh - 56px - 2rem);
    min-height: 280px;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
  }
  .chats-layout {
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  .chats-sidebar {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex: 1;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .chats-layout.chats-mobile-show-list .chats-sidebar {
    flex: 1;
    min-height: 0;
  }
  .chats-layout.chats-mobile-show-chat .chats-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .chats-resizer {
    display: none;
  }
  .chats-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .chats-back-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--color-red);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
  }
  .chats-back-link:hover {
    text-decoration: underline;
  }
  .chats-form-body {
    min-width: 0;
  }
  .chats-form-actions {
    flex-wrap: wrap;
  }
  .chats-form-actions .btn,
  .chats-form-file-label .btn,
  .chats-form-icon-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0;
  }
}

@media (min-width: 769px) {
  .chats-back-link {
    display: none;
  }
}

/* На мобильных: показывать только список ИЛИ только чат в зависимости от выбора */
@media (max-width: 768px) {
  .chats-layout.chats-mobile-show-list .chats-main {
    display: none;
  }
  .chats-layout.chats-mobile-show-chat .chats-sidebar {
    display: none;
  }
}
