/* Buttons */
.btn { font-family: inherit; font-size: 15px; font-weight: 700; border: none; border-radius: 16px; padding: 14px; cursor: pointer; flex: 1; transition: transform 0.15s var(--ease), opacity 0.2s var(--ease); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--pink), var(--pink-strong)); color: #1a0e16; }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text-soft); border: 1px solid var(--glass-border-soft); }

.icon-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--glass-border-soft); background: rgba(255,255,255,0.03);
  color: var(--text-soft); font-family: inherit; font-size: 11.5px; font-weight: 600;
  border-radius: 12px; padding: 8px 6px; cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.icon-btn svg { width: 14px; height: 14px; flex: none; }
.icon-btn:active { transform: scale(0.95); }
.icon-btn.mark-bought { color: var(--pink); }

.icon-btn-sm {
  flex: none; width: 30px; height: 30px; padding: 0; gap: 5px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--glass-border-soft); background: transparent;
  color: var(--text-faint); border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 700; white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease), width 0.2s var(--ease), padding 0.2s var(--ease);
}
.icon-btn-sm svg { width: 13px; height: 13px; flex: none; }
.icon-btn-sm:active { transform: scale(0.9); }
.icon-btn-sm.danger:active { color: #ff6b6b; border-color: rgba(255,107,107,0.4); }
.icon-btn-sm .confirm-label { display: none; }
.icon-btn-sm.confirm {
  width: auto; padding: 0 12px;
  background: #ff6b6b; border-color: #ff6b6b; color: #1a0e16;
}
.icon-btn-sm.confirm .confirm-label { display: inline; }

/* Chips */
.chip {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,143,180,0.16); color: var(--pink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px;
}

/* Form fields */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.field-hint { font-size: 11.5px; color: var(--pink); font-weight: 600; }

.link-preview {
  display: flex; align-items: center; gap: 10px; margin: -6px 0 12px; padding: 8px 10px 8px 8px;
  border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border-soft);
}
.link-preview img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; }
.link-preview span { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.field input, .field textarea {
  font-family: inherit; font-size: 16px; color: var(--text);
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border-soft);
  border-radius: 14px; padding: 12px 13px;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--pink); background: rgba(255,143,180,0.08); }
.field textarea { resize: vertical; min-height: 56px; font-family: inherit; }
.price-row { display: flex; align-items: stretch; gap: 8px; }
.price-input-wrap { position: relative; flex: 1; min-width: 0; }
.price-input-wrap input { width: 100%; }

.sale-combo { display: flex; align-items: stretch; flex: none; margin: 0; }
.sale-price-input {
  width: 72px; flex: none; margin: 0;
  color: #ff3b3b; background: rgba(255,59,59,0.1) !important; border-color: rgba(255,59,59,0.4) !important;
  border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; border-right: none !important;
}
.sale-price-input:focus { border-color: #ff3b3b !important; background: rgba(255,59,59,0.14) !important; }
.sale-tag {
  font-family: inherit; font-size: 11px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  color: #ff3b3b; background: rgba(255,59,59,0.12); border: 1px solid rgba(255,59,59,0.4);
  border-radius: 14px; padding: 0 14px; cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.sale-tag.active {
  background: rgba(120,20,20,0.45); color: #ff3b3b; border-color: rgba(255,59,59,0.4);
  padding: 0; width: 40px; margin: 0;
  border-left: 1px solid rgba(255,59,59,0.35) !important;
  border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important;
}
.sale-tag svg { width: 16px; height: 16px; }
.sale-tag:active { transform: scale(0.92); }

.price-ghost-dash {
  position: absolute; top: 50%; left: 13px; transform: translateY(-50%);
  font-family: inherit; font-size: 16px; color: var(--text-faint);
  pointer-events: none;
}
.price-measure { position: absolute; left: -9999px; top: -9999px; visibility: hidden; white-space: pre; font-family: inherit; font-size: 16px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 6px; }

.more-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-soft);
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border-soft);
  border-radius: 14px; padding: 12px 14px; cursor: pointer; margin-bottom: 12px;
}
.more-toggle:active { transform: scale(0.98); }
.more-toggle-icon { width: 16px; height: 16px; flex: none; transition: transform 0.2s var(--ease); }
.more-toggle.open .more-toggle-icon { transform: rotate(180deg); }
.more-fields { display: flex; flex-direction: column; }

.logout-link {
  display: block; width: 100%; margin-top: 14px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-faint); padding: 9px; border-radius: 12px; text-align: center;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.logout-link.confirm { color: #ff6b6b; font-weight: 700; background: rgba(255,107,107,0.12); }
.logout-link:active { transform: scale(0.97); }

/* Profile (avatar + name) */
.profile-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 18px; flex: none; overflow: hidden;
  background: linear-gradient(155deg, var(--pink), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #1a0e16;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-change-btn {
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--pink);
  background: rgba(255,143,180,0.12); border: 1px solid var(--glass-border-soft);
  border-radius: 12px; padding: 9px 14px; cursor: pointer;
}
.avatar-change-btn:active { transform: scale(0.96); }
.avatar-change-btn:disabled { opacity: 0.5; cursor: default; }

/* Item cards */
.card {
  background: var(--glass); border: 1px solid var(--glass-border-soft);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-radius: 24px; padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
}
.card.bought { border-color: rgba(183,167,255,0.28); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-top-text { min-width: 0; flex: 1; }
.card-thumb {
  width: 52px; height: 52px; flex: none; display: block;
  object-fit: cover; border-radius: 14px;
  background: rgba(255,255,255,0.04);
}
.row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card.bought .chip.status { background: rgba(183,167,255,0.18); color: var(--violet); }
.card h3 { font-size: 17px; font-weight: 700; margin: 0; text-wrap: balance; }
.notes { font-size: 13px; color: var(--text-soft); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta-row { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.meta-right { display: flex; align-items: center; gap: 8px; }
.price { font-variant-numeric: tabular-nums; font-weight: 700; }
.price.sale { color: #ff3b3b; }
.price-was { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 0.82em; color: var(--text-faint); margin-right: 5px; }
.link-out { font-size: 12.5px; color: var(--pink); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.link-out svg { width: 13px; height: 13px; }
.date-note { font-size: 11px; color: var(--text-faint); }
.actions { display: flex; gap: 6px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--glass-border-soft); }

.empty { text-align: center; padding: 46px 20px; color: var(--text-faint); background: var(--glass); border: 1px dashed var(--glass-border); border-radius: 24px; }
.empty .big { font-size: 19px; font-weight: 700; color: var(--text); margin-bottom: 6px; }

/* Bottom sheets */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 50; background: rgba(5,4,7,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease);
}
.sheet-scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: -120px; z-index: 51; max-width: 560px; margin: 0 auto;
  background: rgba(22,18,24,0.82); border: 1px solid var(--glass-border); border-bottom: none;
  backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 28px 28px 0 0; padding: 10px 20px calc(120px + env(safe-area-inset-bottom, 0px) + 14px);
  box-shadow: var(--shadow); transform: translateY(100%); transition: transform 0.38s var(--ease);
  max-height: calc(86vh + 120px); overflow-y: auto;
}
.sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 100%; height: 30px; margin: -4px 0 6px;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; cursor: grab;
}
.sheet-handle::before {
  content: ""; width: 36px; height: 4px; border-radius: 999px; background: var(--glass-border);
}
.sheet.dragging { transition: none !important; }
.sheet h2 { font-size: 19px; margin: 0 0 16px; font-weight: 800; }

/* Filter pills */
.subfilter { display: inline-flex; background: var(--glass); border: 1px solid var(--glass-border-soft); border-radius: 999px; padding: 3px; gap: 2px; }
.subfilter button { border: none; background: transparent; color: var(--text-soft); font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.subfilter button.active { background: var(--pink); color: #1a0e16; }
