.cabinet-body {
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(196, 92, 106, 0.08), transparent),
    radial-gradient(ellipse 50% 30% at 0% 100%, rgba(147, 112, 219, 0.06), transparent),
    linear-gradient(165deg, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-bottom) 100%);
}

.app-header {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.app-header-actions { display: flex; align-items: center; gap: 12px; }
.user-name {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 12px;
  background: var(--accent-soft);
  border-radius: 999px;
}

.app-main { padding: 28px 0 calc(96px + env(safe-area-inset-bottom)); }

.cabinet-nav {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
}
.cabinet-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-height: 58px;
  justify-content: center;
  transition: all 0.2s var(--ease);
}
.cabinet-nav-item:hover {
  background: rgba(252, 232, 236, 0.6);
  color: var(--text);
}
.cabinet-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.cabinet-nav-icon { font-size: 22px; line-height: 1; }

.dashboard-welcome { margin-bottom: 28px; }
.dashboard-welcome h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.dashboard-sub { margin: 0; color: var(--muted); font-size: 16px; }

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (min-width: 640px) {
  .dashboard-stats { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card.accent {
  background: linear-gradient(145deg, #fff 0%, var(--accent-soft) 100%);
  border-color: var(--border-strong);
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.dashboard-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.profile-panel { max-width: 640px; }
.profile-form .section-label {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.profile-actions { margin-top: 8px; }
.profile-form input:disabled {
  background: var(--accent-soft);
  color: var(--muted);
  opacity: 1;
}

@media (min-width: 768px) {
  .cabinet-nav {
    position: static;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px 20px;
    border-bottom: none;
    background: transparent;
    backdrop-filter: none;
  }
  .cabinet-nav-item {
    flex: 0 1 auto;
    flex-direction: row;
    font-size: 14px;
    min-height: 44px;
    padding: 10px 22px;
    gap: 8px;
  }
  .app-main { padding-bottom: 64px; }
}

@media (max-width: 640px) {
  .cabinet-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: none;
    border-top: 1px solid var(--border);
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 32px rgba(45, 34, 38, 0.08);
  }
  .dashboard-actions .btn { flex: 1 1 100%; }
}

.page-head, .edit-head, .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h1, .edit-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wishlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.wishlist-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.wishlist-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #d4a0a8);
  opacity: 0;
  transition: opacity 0.25s;
}
.wishlist-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.wishlist-card:hover::before { opacity: 1; }
.wishlist-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}
.wishlist-card p { margin: 0; color: var(--muted); font-size: 14px; }

.panel {
  background: var(--card);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}
.panel h2 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--card-solid);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.presents-list { display: flex; flex-direction: column; gap: 14px; }
.present-row {
  display: grid;
  grid-template-columns: auto 80px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-solid);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease);
}
.present-row:hover { box-shadow: var(--shadow); }

.panel-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.field-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.5; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 10px; }
.checkbox-label input { width: auto; min-height: 20px; accent-color: var(--accent); }
.public-url { word-break: break-all; color: var(--accent); font-size: 14px; font-weight: 500; display: block; margin: 4px 0; }
.fund-text { font-size: 13px; color: var(--accent-dark); font-weight: 700; margin: 0; }
.owner-chip-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}
.owner-chip-list li { margin-bottom: 4px; }
.chip-del {
  margin-left: 6px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: #c0392b;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}
.present-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.present-search, .present-filter {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
}
.present-search { min-width: 140px; flex: 1; max-width: 220px; }
.present-row.dragging { opacity: 0.5; }
.activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.activity-feed li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.45;
}
.activity-feed li:hover { color: var(--accent); }
.desc-short { font-size: 13px; color: var(--muted); }

.present-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}
.present-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.present-info h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.present-info p { margin: 0; color: var(--muted); font-size: 13px; }
.present-info a { color: var(--accent); font-weight: 600; }
.present-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  background: #ecfdf3;
  color: #166534;
}
.badge.reserved { background: var(--accent-soft); color: var(--accent-dark); }
.badge.done { background: #f4f4f5; color: #71717a; }

.share-line { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.back-btn { margin-bottom: 16px; }
.empty { color: var(--muted); margin-top: 32px; text-align: center; font-size: 15px; }

dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow-lg);
  max-width: 540px;
  width: calc(100% - 32px);
}
dialog::backdrop {
  background: rgba(45, 34, 38, 0.45);
  backdrop-filter: blur(4px);
}
.dialog-form { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.dialog-form h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}
.dialog-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.dialog-form input, .dialog-form textarea, .dialog-form select {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--card-solid);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dialog-form input:focus, .dialog-form textarea:focus, .dialog-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.autofill-banner {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  color: #166534;
}
.autofill-banner strong { display: block; margin-bottom: 4px; font-size: 14px; }
.autofill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.autofill-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #86efac;
  color: #15803d;
}

.url-field input {
  font-size: 15px;
}

.preview-status {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.preview-status.loading { color: var(--accent); }
.preview-status.error { color: #b91c1c; }
.preview-status.ok { color: #15803d; }

.preview-box {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}
.preview-img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.preview-price {
  margin: 4px 0 0;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 15px;
}

.ozon-import-panel {
  margin-top: 12px;
  padding: 14px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  color: #92400e;
}
.ozon-import-panel p { margin: 0 0 8px; }
.ozon-import-steps { margin: 0 0 12px; padding-left: 20px; }
.ozon-import-steps li { margin-bottom: 4px; }
.ozon-bm-link {
  font-weight: 700;
  color: var(--accent-dark);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .page-head h1, .edit-head h1 { font-size: 1.5rem; }
  .page-head, .edit-head, .panel-head { flex-direction: column; align-items: stretch; }
  .page-head .btn, .panel-head .btn, .panel-head-actions .btn, .edit-head .btn-danger { width: 100%; }
  .panel-head-actions { flex-direction: column; width: 100%; }
  .app-header-inner { gap: 8px; }
  .user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wishlists-grid { grid-template-columns: 1fr; }
  .panel { padding: 20px 16px; }
  .share-actions .btn { flex: 1 1 100%; }
  .present-row { grid-template-columns: auto 64px 1fr; padding: 14px; }
  .present-thumb { width: 64px; height: 64px; }
  .present-actions { grid-column: 1 / -1; justify-content: stretch; }
  .present-actions .btn { flex: 1 1 calc(50% - 4px); min-width: 0; }
  dialog { width: calc(100% - 16px); max-width: none; max-height: calc(100dvh - 24px); }
  .dialog-form { padding: 22px 18px; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .btn { width: 100%; }
  .preview-box { flex-direction: row; }
}
