/* ============================================================
   INERTIA — logged-in web app (LifePlans sync)
   ============================================================ */

/* The `hidden` attribute must always win over display rules
   (`.modal-overlay`, `.guest-actions`, `.btn` etc. set display). */
[hidden] { display: none !important; }

/* ---------- header auth controls ---------- */
.user-actions { display: flex; align-items: center; gap: 12px; }
.guest-actions { display: flex; align-items: center; gap: 12px; }
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line-dark);
  font-size: 0.85rem;
  text-decoration: none;
  flex: 0 0 auto;
}
.notif-bell:hover { background: rgba(255, 255, 255, 0.16); }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--violet-900);
  font-size: 0.6rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.82rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line-dark);
  padding: 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.user-chip:hover { background: rgba(255, 255, 255, 0.16); }
.user-chip .chip-avatar {
  position: relative;
  overflow: hidden;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--violet-900);
  display: inline-grid;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 700;
}
.chip-avatar img,
.pd-avatar img,
.acct-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ---------- header profile button dropdown ---------- */
.profile-wrap { position: relative; }
.profile-drop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 260;
  width: 268px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-light);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(18, 8, 46, 0.22);
  overflow: hidden;
}
.profile-drop-head {
  display: flex;
  gap: 10px;
  padding: 13px;
  background: linear-gradient(135deg, rgba(199, 255, 77, 0.14), rgba(199, 255, 77, 0.04));
  border-bottom: 1px solid var(--line-light);
  align-items: center;
}
.pd-avatar {
  position: relative;
  overflow: hidden;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--violet-900);
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
}
.pd-meta { min-width: 0; }
.pd-meta strong { display: block; font-size: 0.9rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-email { display: block; font-size: 0.74rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.pd-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pd-chips .chip-static { font-size: 0.66rem; padding: 5px 10px; }
.profile-drop-links { display: flex; flex-direction: column; padding: 6px; max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; }
.profile-drop-links a,
.profile-drop-links button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: none;
  border-radius: 9px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.profile-drop-links a:hover,
.profile-drop-links button:hover { background: rgba(36, 26, 82, 0.06); }
.profile-drop-links button { color: #c0392b; }

/* ---------- modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(18, 8, 46, 0.66);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  width: min(440px, 100%);
  background: var(--paper);
  color: var(--ink);
  border-radius: 16px;
  padding: 22px;
  position: relative;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 40px 90px rgba(18, 8, 46, 0.45);
  animation: modal-in 0.22s ease;
}
.modal-wide { width: min(640px, 100%); }
.modal.modal-auth { width: min(440px, 100%); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(36, 26, 82, 0.08);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: rgba(36, 26, 82, 0.16); }
.auth-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--paper-2);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 16px;
}
.auth-tabs button {
  flex: 1;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.auth-tabs button.is-active {
  background: var(--violet-800);
  color: #fff;
}
.auth-hint { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 14px; }

.auth-panel form { display: flex; flex-direction: column; gap: 5px; }
.auth-panel label { font-size: 0.78rem; font-weight: 600; margin-top: 7px; }
.auth-panel input {
  border: 1px solid var(--line-light);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.84rem;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.2s ease;
}
.auth-panel input:focus { outline: 3px solid rgba(108, 76, 240, 0.25); border-color: var(--violet-600); }
.btn-block { width: 100%; margin-top: 14px; justify-content: center; }
.auth-error {
  color: #c0392b;
  font-size: 0.78rem;
  min-height: 1.2em;
  margin-top: 5px;
}
.auth-success { color: #1a7a3d; font-size: 0.82rem; margin-top: 7px; }
.auth-link {
  background: none;
  border: 0;
  color: var(--violet-800);
  font-weight: 600;
  cursor: pointer;
  margin-top: 9px;
  text-align: center;
  font-size: 0.82rem;
}
.auth-link:hover { text-decoration: underline; }

.auth-success-panel { text-align: center; padding: 5px 4px; }
.auth-success-emoji { font-size: 2.2rem; margin-bottom: 8px; }
.auth-success-panel h3 { margin: 0 0 7px; font-size: 1.15rem; }
.auth-success-panel p { color: var(--ink-soft); margin: 0 0 15px; }

/* ---------- webapp shell ---------- */
.webapp { padding-top: clamp(34px, 5vw, 54px); }
.webapp-head h2 { margin-top: 10px; }
.webapp-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.webapp-tabs button {
  border: 1px solid var(--line-light);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.76rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.webapp-tabs button:hover { border-color: var(--violet-500); color: var(--violet-800); }
.webapp-tabs button.is-active {
  background: var(--violet-800);
  border-color: var(--violet-800);
  color: #fff;
}
.webapp-view { margin-top: 16px; }

.wa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.wa-card {
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 8px 26px rgba(36, 26, 82, 0.05);
}
.wa-card h3 { font-size: 0.88rem; margin-bottom: 9px; }

.wa-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.wa-stat {
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 11px;
  padding: 11px 10px;
}
.wa-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--violet-800);
}
.wa-stat span { font-size: 0.66rem; color: var(--ink-soft); }

.wa-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 22px 16px;
  border: 1px dashed var(--line-light);
  border-radius: 12px;
}
.wa-empty button { margin-top: 12px; }

/* ---------- request cards ---------- */
.req-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.req-card {
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 10px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.req-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(36, 26, 82, 0.08); border-color: var(--violet-500); }
.req-card-img {
  width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--paper-2);
}
.req-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.req-title { font-family: var(--font-display); font-size: 0.82rem; line-height: 1.3; letter-spacing: -0.01em; }
.req-title-extra { font-family: var(--font-body); font-weight: 600; font-size: 0.66rem; color: var(--ink-soft); }
.req-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.66rem;
  color: var(--ink-soft);
  margin-top: 4px;
}
.req-meta-dot { opacity: 0.45; }
.req-specs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.spec-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 0.64rem;
  font-weight: 600;
  white-space: nowrap;
}
.spec-chip.spec-deadline { background: #fff4e0; color: #b06a00; }
.spec-chip.spec-offers { background: var(--violet-100); color: var(--violet-800); }
.req-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-light);
  flex-wrap: wrap;
}
.req-card-foot .btn { padding: 5px 10px; font-size: 0.66rem; }

/* ---------- sell page: compact listing grid ---------- */
.sell-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sell-grid .p-thumb { aspect-ratio: 16 / 10; }
.sell-grid .p-thumb-ph { font-size: 1.3rem; }
.sell-grid .p-body { padding: 7px 8px 6px; }
.sell-grid .p-cat { font-size: 0.56rem; }
.sell-grid .p-body h4 { font-size: 0.7rem; margin-bottom: 2px; }
.sell-grid .p-price { font-size: 0.74rem; }
.sell-grid .p-stock { font-size: 0.6rem; }
.sell-offer-stats { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 0 8px 6px; }
.sell-offer-max {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(100deg, var(--accent), #a8e639);
  color: var(--violet-900);
  border-radius: 7px;
  padding: 3px 7px;
  font-size: 0.6rem;
  font-weight: 800;
}
.sell-offer-count { font-size: 0.6rem; color: var(--ink-soft); font-weight: 600; }
.sell-grid .btn-accent.btn-sm { padding: 5px 8px; font-size: 0.62rem; margin: 0 8px 8px !important; }

/* ---------- listing cards ---------- */
.listing-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.listing-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(36, 26, 82, 0.08); border-color: var(--violet-500); }
.listing-thumb {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--paper-2);
}
.listing-thumb-empty { display: grid; place-items: center; font-size: 1.7rem; }
.listing-main { flex: 1; min-width: 0; }
.listing-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.listing-title { font-family: var(--font-display); font-size: 0.96rem; letter-spacing: -0.01em; }
.listing-price { font-family: var(--font-display); font-size: 1.05rem; color: var(--violet-800); margin-top: 5px; }
.listing-sub { font-size: 0.76rem; color: var(--ink-soft); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.listing-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.listing-status-dot.is-live { background: #1a7a3d; }
.listing-status-dot.is-hidden { background: #9a9aa6; }
.listing-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  flex-wrap: wrap;
}
.listing-actions .btn-sm { padding: 6px 10px; }

/* ---------- edit profile ---------- */
.ep-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 680px) { .ep-layout { grid-template-columns: 1fr; } }
.ep-card { background: var(--surface); border: 1px solid var(--line-light); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.ep-card-head { display: flex; align-items: center; gap: 8px; }
.ep-card-head .ep-icon { font-size: 1.1rem; }
.ep-card-head h3 { font-size: 0.98rem; margin: 0; }
.ep-card-sub { font-size: 0.78rem; color: var(--ink-soft); margin: 4px 0 14px; }
.ep-avatar-wrap { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ep-avatar-btn { position: relative; width: 72px; height: 72px; border-radius: 50%; cursor: pointer; flex: 0 0 auto; }
.ep-avatar-btn .acct-avatar { width: 72px; height: 72px; font-size: 1.5rem; }
.ep-avatar-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--violet-800);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  border: 2px solid var(--surface);
}
.ep-avatar-hint { font-size: 0.76rem; color: var(--ink-soft); }
.ep-progress { margin-bottom: 16px; }
.ep-progress-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ep-progress-label { font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }
.ep-progress-pct { font-family: var(--font-display); font-weight: 700; color: var(--violet-800); font-size: 0.86rem; }
.ep-progress-track { height: 7px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.ep-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet-600), var(--accent)); transition: width 0.3s ease; }
.ep-progress-tips { margin: 8px 0 0 18px; padding: 0; font-size: 0.76rem; color: var(--ink-soft); }
.ep-progress-done { font-size: 0.78rem; color: #1a7a3d; margin-top: 6px; font-weight: 600; }

/* ---------- offer modal ---------- */
.offer-max-box {
  background: var(--violet-100);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.offer-max-label { font-size: 0.76rem; color: var(--violet-800); font-weight: 700; }
.offer-max-value { font-family: var(--font-display); font-size: 1.15rem; color: var(--violet-800); }

/* ---------- request/listing detail: two-column hero (photos left, info right) ---------- */
.req-detail-hero { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
@media (max-width: 720px) { .req-detail-hero { grid-template-columns: 1fr; } }
.req-detail-hero-info { min-width: 0; }

/* ---------- request/listing detail: highlighted, blinking price ---------- */
.price-highlight-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 10px;
  animation: priceBlink 1.6s ease-in-out infinite;
}
.price-highlight-label { font-size: 0.72rem; font-weight: 700; color: var(--violet-900); text-transform: uppercase; letter-spacing: 0.03em; }
.price-highlight-value { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--violet-900); }
@keyframes priceBlink {
  0%, 100% { background: var(--accent); box-shadow: 0 0 0 0 rgba(199, 255, 77, 0.5); }
  50% { background: #eaffb0; box-shadow: 0 0 0 6px rgba(199, 255, 77, 0); }
}
@media (prefers-reduced-motion: reduce) { .price-highlight-band { animation: none; } }

/* ---------- request detail: separated fact rows ---------- */
.req-detail-meta { border: 1px solid var(--line-light); border-radius: 10px; overflow: hidden; margin-top: 10px; }
.req-meta-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; font-size: 0.8rem; }
.req-meta-row:nth-child(odd) { background: var(--paper-2); }
.req-meta-row span { color: var(--ink-soft); }
.req-meta-row strong { color: var(--ink); text-align: right; }

/* ---------- request detail: clock + offer count callouts ---------- */
.req-detail-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.req-detail-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 7px 12px;
  flex: 0 0 auto;
}
.req-detail-stat-icon { font-size: 1.05rem; }
.req-detail-stat-label { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.req-detail-stat-value { font-family: var(--font-display); font-size: 0.82rem; font-weight: 800; }
.req-detail-stat.is-status { background: var(--paper-2); }
.req-detail-stat.is-status .req-detail-stat-label,
.req-detail-stat.is-status .req-detail-stat-value { color: var(--ink); }
.req-detail-stat.is-clock { background: #fff4e0; }
.req-detail-stat.is-clock .req-detail-stat-label,
.req-detail-stat.is-clock .req-detail-stat-value { color: #b06a00; }
.req-detail-stat.is-offers { background: var(--violet-100); }
.req-detail-stat.is-offers .req-detail-stat-label,
.req-detail-stat.is-offers .req-detail-stat-value { color: var(--violet-800); }
.offer-status-chip {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--ink-soft);
  background: var(--paper-2);
  border-radius: 999px;
  padding: 2px 7px;
  margin-top: 3px;
}
.offer-existing-list { margin-bottom: 14px; max-height: 160px; overflow-y: auto; }
.offer-existing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-light);
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.offer-existing-row:last-child { border-bottom: 0; }
.offer-existing-row strong { color: var(--ink); font-family: var(--font-display); }

/* ---------- prominent "View & Send Your Offer" link (detail pages) ----------
   Visually distinct from the other secondary (btn-ghost-dark) actions on
   the page — its own gradient + a subtle, professional blink so it draws
   the eye without being distracting. Text stays fully opaque throughout
   the animation (only the glow pulses) so it's always readable. */
.btn-view-offers {
  background: linear-gradient(135deg, var(--accent), #d4ff7a);
  color: var(--violet-900);
  font-weight: 800;
  animation: viewOffersBlink 1.8s ease-in-out infinite;
}
.btn-view-offers:hover { color: var(--violet-900); }
@keyframes viewOffersBlink {
  0%, 100% { box-shadow: 0 4px 14px rgba(199, 255, 77, 0.35); }
  50% { box-shadow: 0 6px 22px rgba(199, 255, 77, 0.75); }
}
@media (prefers-reduced-motion: reduce) { .btn-view-offers { animation: none; } }

/* ---------- dedicated offers page: the "Send Offer" CTA at the bottom ----------
   Same prominent-and-blinking treatment as .btn-view-offers, sized up a
   touch since it's the sole, centered call to action on the page. */
.btn-send-offer {
  font-size: 1rem;
  padding: 13px 28px;
  animation: sendOfferPulse 2.2s ease-in-out infinite;
}
@keyframes sendOfferPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(199, 255, 77, 0.3); transform: scale(1); }
  50% { box-shadow: 0 8px 26px rgba(199, 255, 77, 0.6); transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) { .btn-send-offer { animation: none; } }

/* ---------- dedicated offers page: ranked offers table ----------
   Serial#, user name, offer price, offer date, action — ranked by
   closeness to the owner's target price/budget (rankOffersByTarget()),
   closest match first, highlighted with a "Best Offer" badge. */
.offers-rank-table {
  margin-top: 4px;
  border: 1px solid var(--line-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(36, 26, 82, 0.06);
}
.offers-rank-head, .offers-rank-row {
  display: grid;
  grid-template-columns: 40px minmax(110px,1fr) 120px 120px auto;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
}
.offers-rank-head { background: var(--paper-2); font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); border-bottom: 2px solid var(--violet-100); }
.offers-rank-row { border-top: 1px solid var(--line-light); font-size: 0.84rem; transition: background 0.15s ease; }
.offers-rank-row:nth-child(even) { background: var(--paper-2); }
.offers-rank-row:hover { background: var(--violet-100); }
.offers-rank-row.is-best { background: var(--accent-soft); animation: offerRowPulse 2.4s ease-in-out infinite; }
.offers-rank-row.is-best:hover { background: var(--accent-soft); }
@keyframes offerRowPulse {
  0%, 100% { box-shadow: inset 0 0 0 1px transparent; }
  50% { box-shadow: inset 0 0 0 1px rgba(199, 255, 77, 0.9); }
}
@media (prefers-reduced-motion: reduce) { .offers-rank-row.is-best { animation: none; } }
.offers-rank-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--violet-100);
  color: var(--violet-800);
  font-weight: 800;
  font-size: 0.72rem;
}
.offers-rank-row.is-best .offers-rank-num { background: var(--violet-800); color: #fff; }
.offers-rank-name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; max-width: 100%; }
.offers-rank-name-line { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offers-rank-name strong { color: var(--ink); }
.offers-rank-price { font-family: var(--font-display); font-size: 0.95rem; font-weight: 800; color: var(--ink); }
.offers-rank-date { color: var(--ink-soft); font-size: 0.78rem; }
.best-offer-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--violet-800);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(46, 30, 168, 0.35);
}
@media (max-width: 640px) {
  .offers-rank-head { display: none; }
  .offers-rank-row { grid-template-columns: 24px 1fr auto; grid-template-areas: "num name price" ". date action"; row-gap: 6px; }
  .offers-rank-row .offers-rank-num { grid-area: num; }
  .offers-rank-row .offers-rank-name { grid-area: name; }
  .offers-rank-row .offers-rank-price { grid-area: price; }
  .offers-rank-row .offers-rank-date { grid-area: date; }
}

/* ---------- goals ---------- */
.goal-list { display: grid; gap: 12px; }
.goal-row {
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.goal-row:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(36, 26, 82, 0.09); border-color: var(--violet-500); }
.goal-progress { flex: 0 0 auto; }
.goal-main { flex: 1; min-width: 0; }
.goal-main h4 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.goal-meta { display: flex; gap: 10px; align-items: center; margin-top: 5px; font-size: 0.78rem; color: var(--ink-soft); }
.goal-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--paper-2);
  margin-top: 10px;
  overflow: hidden;
}
.goal-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet-600), var(--accent));
  transition: width 0.4s ease;
}
.goal-fav {
  border: 0;
  background: none;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 5px;
  color: #c9c3e4;
}
.goal-fav.is-fav { color: #f5b301; }
.goal-actions { display: flex; gap: 7px; }

.chip {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.chip-cat { background: var(--violet-100); color: var(--violet-800); }
.chip-low { background: #e7f9ee; color: #1a7a3d; }
.chip-med { background: #fff4e0; color: #b06a00; }
.chip-high { background: #ffe9ec; color: #c0392b; }
.chip-done { background: var(--accent); color: var(--violet-900); }
.chip-premium { background: linear-gradient(100deg, var(--violet-800), var(--violet-600)); color: #fff; }

.priority-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }

/* goal detail */
.goal-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.goal-detail-head h3 { font-size: 1.3rem; }
.wa-field-label { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 8px; }
.checkpoint { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-light); }
.checkpoint input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--violet-800);
  cursor: pointer;
}
.checkpoint .cp-num {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.checkpoint .cp-num input {
  width: 62px;
  border: 1px solid var(--line-light);
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 0.82rem;
  color: var(--ink);
}
.checkpoint .cp-num button {
  border: 1px solid var(--line-light);
  background: var(--surface);
  border-radius: 7px;
  padding: 5px 10px;
  font-weight: 600;
  font-size: 0.76rem;
  cursor: pointer;
  color: var(--violet-800);
}
.checkpoint.is-done .cp-title { color: var(--ink-soft); text-decoration: line-through; }

.note { padding: 10px 0; border-bottom: 1px solid var(--line-light); font-size: 0.86rem; }
.note time { display: block; font-size: 0.7rem; color: var(--ink-soft); margin-top: 3px; }
textarea.wa-input {
  width: 100%;
  border: 1px solid var(--line-light);
  border-radius: 9px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  resize: vertical;
  min-height: 76px;
  background: var(--surface);
  color: var(--ink);
}
.wa-input {
  width: 100%;
  border: 1px solid var(--line-light);
  border-radius: 9px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--ink);
}
.wa-row { display: flex; gap: 12px; }
.wa-row > div { flex: 1; }
.wa-form label { display: block; font-size: 0.78rem; font-weight: 600; margin: 12px 0 5px; }
.wa-form .btn { margin-top: 16px; }
.wa-actions { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.btn-danger {
  background: var(--surface);
  color: #c0392b;
  border-color: #f1c4c4;
}
.btn-danger:hover { background: #ffe9ec; }
.btn-ghost-dark {
  background: transparent;
  color: var(--violet-800);
  border-color: var(--line-light);
}
.btn-ghost-dark:hover { background: var(--violet-100); }
.btn-ghost-dark.is-fav { background: #ffe9ec; border-color: #ffc7ce; color: #c0392b; }
.btn-ghost-dark.is-fav:hover { background: #ffdde1; }

/* check-in */
.ci-card { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line-light); }
.ci-card:last-child { border-bottom: 0; }
.ci-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--violet-100);
  flex: 0 0 auto;
}
.ci-main { flex: 1; }
.ci-main strong { font-family: var(--font-display); font-size: 0.92rem; }
.ci-main p { font-size: 0.8rem; color: var(--ink-soft); }
.ci-toggle {
  border: 0;
  border-radius: 999px;
  padding: 8px 15px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  background: var(--paper-2);
  color: var(--ink-soft);
  transition: background 0.2s ease, color 0.2s ease;
}
.ci-toggle.is-on { background: var(--accent); color: var(--violet-900); }
.ci-notes { margin-top: 10px; }

/* plan / planner */
.plan-week { margin-bottom: 26px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-light); }
.task-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--violet-800); cursor: pointer; }
.task-row .task-title { flex: 1; }
.task-row.is-done .task-title { color: var(--ink-soft); text-decoration: line-through; }
.prio-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.prio-list span { background: var(--violet-100); color: var(--violet-800); font-size: 0.84rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.affirm {
  background: var(--accent-soft);
  border: 1px solid rgba(199, 255, 77, 0.55);
  color: var(--violet-900);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.sched-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-light); font-size: 0.92rem; }
.sched-row time { color: var(--violet-800); font-weight: 600; flex: 0 0 auto; width: 46px; }

/* profile */
.profile-card { max-width: 420px; }
.profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--violet-800), var(--violet-600));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 13px;
}

.wa-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  padding: 24px 0;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--violet-100);
  border-top-color: var(--violet-800);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.wa-note { font-size: 0.78rem; color: var(--ink-soft); margin-top: 8px; }

/* responsive */
@media (max-width: 720px) {
  .wa-grid { grid-template-columns: 1fr; }
  .wa-stats { grid-template-columns: repeat(2, 1fr); }
  .wa-row { flex-direction: column; gap: 0; }
  .header-actions .guest-actions .btn-sm,
  .header-actions .user-actions .btn-sm { display: none; }
}

/* ---------- marketplace views ---------- */
.link { color: var(--violet-800); font-weight: 600; text-decoration: none; font-size: 0.82rem; }
.link:hover { text-decoration: underline; }
.link-danger { color: #c0392b; }

.wa-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wa-section-head h3 { margin: 0; font-size: 1rem; }

.wa-desc { color: var(--ink); font-size: 0.86rem; line-height: 1.55; }

/* category chips */
.cat-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cat-chip {
  border: 1px solid var(--line-light);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cat-chip:hover { border-color: var(--violet-500); color: var(--violet-800); }
.cat-chip.is-active { background: var(--violet-800); border-color: var(--violet-800); color: #fff; }

/* quick offer-price suggestion chips (Make an Offer popups) */
.offer-suggestions { margin-bottom: 14px; }
.offer-suggestions-label { font-size: 0.72rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 8px; }
.offer-suggestions-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.offer-suggest-chip {
  border: 1px solid var(--line-light);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.offer-suggest-chip:hover { border-color: var(--violet-500); color: var(--violet-800); }
.offer-suggest-chip.is-selected { background: var(--accent); border-color: var(--accent); color: var(--violet-900); }

/* product grid + cards */
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.p-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.p-card:hover { transform: translateY(-2px); border-color: var(--violet-500); box-shadow: 0 14px 34px rgba(36, 26, 82, 0.1); }
.p-thumb { aspect-ratio: 4 / 3; background: var(--paper-2); display: grid; place-items: center; overflow: hidden; }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-thumb-ph { font-size: 1.7rem; }

.p-badge {
  display: inline-block;
  background: linear-gradient(100deg, var(--violet-800), var(--violet-600));
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
}
.p-card .p-badge { position: absolute; top: 8px; left: 8px; z-index: 2; }

.p-body { padding: 9px 10px 10px; }
.p-cat { font-size: 0.6rem; font-weight: 600; color: var(--violet-800); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.p-body h4 { font-family: var(--font-display); font-size: 0.76rem; color: var(--ink); margin-bottom: 3px; line-height: 1.3; }
.p-price { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.p-stock { font-size: 0.7rem; color: #1a7a3d; margin-top: 2px; }
.p-stock.out { color: #c0392b; }

.p-card .goal-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  color: #b9b2d9;
}
.p-card .goal-fav.is-fav { color: #f5b301; }

/* browse controls */
.browse-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.browse-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.browse-controls .wa-input { width: 220px; }

/* browse sidebar layout */
.browse-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.browse-sidebar {
  position: sticky;
  top: 14px;
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 13px;
  box-shadow: 0 8px 26px rgba(36, 26, 82, 0.05);
}
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 0; }
.side-tabs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.side-tabs-3 button {
  min-width: 0;
  padding: 7px 4px;
  font-size: 0.68rem;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}
.side-cats { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.side-cats::-webkit-scrollbar { width: 7px; }
.side-cats::-webkit-scrollbar-thumb { background: var(--violet-200); border-radius: 7px; }
.side-cats::-webkit-scrollbar-thumb:hover { background: var(--violet-300); }
.side-cats::-webkit-scrollbar-track { background: transparent; }
.side-cat {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: left;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.side-cat:hover { background: var(--violet-100); color: var(--violet-800); transform: translateX(2px); }
.side-cat.is-active { background: var(--violet-800); color: #fff; box-shadow: 0 8px 20px rgba(46, 30, 168, 0.25); }
.side-cat-ico {
  font-size: 0.76rem;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--violet-100);
  transition: background 0.2s ease;
}
.side-cat.is-active .side-cat-ico { background: rgba(255, 255, 255, 0.16); }
.browse-main { min-width: 0; }

/* add listing nav button */
.nav-add {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 15px !important;
  margin-top: -1px;
  border: 1px solid rgba(199, 255, 77, 0.35);
  border-radius: 999px;
  background: rgba(199, 255, 77, 0.08);
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
}
.nav-add strong { font-size: 0.74rem; font-weight: 700; color: var(--accent); line-height: 1; white-space: nowrap; }
.nav-add:hover { background: rgba(199, 255, 77, 0.16); }
.nav-add::after { display: none; }
.nav-add.is-active { background: var(--accent); border-color: var(--accent); }
.nav-add.is-active strong, .nav-add.is-active span { color: var(--violet-900); }

/* product detail */
.pd-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; margin-top: 13px; align-items: start; }
.pd-media { display: flex; flex-direction: column; gap: 8px; }
.pd-media-main { border-radius: 12px; overflow: hidden; background: var(--paper-2); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.pd-media-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-gallery-thumbs { display: flex; gap: 7px; flex-wrap: wrap; }
.pd-thumb { width: 46px; height: 46px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--paper-2); flex: 0 0 auto; }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-thumb.is-active { border-color: var(--violet-600); }
.pd-ph { font-size: 2.7rem; }
.pd-cat { font-size: 0.66rem; font-weight: 700; color: var(--violet-800); text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pd-price { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--ink); margin-top: 8px; }
.pd-loc { color: var(--ink-soft); font-size: 0.82rem; margin-top: 8px; }

.spec-table { border: 1px solid var(--line-light); border-radius: 10px; overflow: hidden; }
.spec-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: 0.82rem; }
.spec-row:nth-child(odd) { background: var(--paper-2); }
.spec-row span { color: var(--ink-soft); }
.spec-row strong { color: var(--ink); text-align: right; }

/* product detail — mirrors the generated share-card design with one single background across the whole page */
.product-page {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #241a52 0%, #3b2a8f 55%, #201250 100%);
  color: #fff;
}
.product-page::before,
.product-page::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.product-page::before {
  width: 520px;
  height: 520px;
  right: -160px;
  top: 60px;
  background: radial-gradient(circle, rgba(199, 255, 77, 0.10), transparent 65%);
}
.product-page::after {
  width: 460px;
  height: 460px;
  left: -170px;
  bottom: 30px;
  background: radial-gradient(circle, rgba(199, 255, 77, 0.14), transparent 65%);
}
.product-page > .wrap { position: relative; z-index: 1; }
.product-page .webapp-view { margin-top: 22px; }

.pd-page { color: #fff; }
.pd-page .link { color: rgba(255, 255, 255, 0.75); }
.pd-page .link:hover { color: #fff; }
.pd-page .pd-cat { color: var(--accent); }
.pd-page .pd-title { color: #fff; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.15; margin: 5px 0 0; }
.pd-page .pd-price { color: #fff; }
.pd-page .pd-loc { color: rgba(255, 255, 255, 0.75); }
.pd-page .wa-note { color: rgba(255, 255, 255, 0.62); }
.pd-page .wa-field-label { color: rgba(255, 255, 255, 0.55); }
.pd-page .p-stock { color: var(--accent); }
.pd-page .p-badge { background: rgba(255, 255, 255, 0.12); color: #fff; }
.pd-page .pd-media-main { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(199, 255, 77, 0.28); max-height: 320px; }
.pd-page .pd-thumb { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.18); }
.pd-page .pd-thumb.is-active { border-color: var(--accent); }
.pd-page .pd-ph { color: rgba(255, 255, 255, 0.45); }
.pd-page .cat-chip { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.pd-page .cat-chip:hover { border-color: var(--accent); color: #fff; }
.pd-page .cat-chip.is-active { background: var(--accent); color: var(--violet-900); border-color: var(--accent); }
.pd-page .cat-chip input { accent-color: var(--accent); }

/* Products | Services — the compact two-column structure from the share card */
.pd-sections { margin-top: 26px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.14); display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.pd-sections.single-col { grid-template-columns: 1fr; }
.pd-group h4 { color: var(--accent); font-family: var(--font-display); font-size: 1.12rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.pd-item { display: flex; gap: 11px; margin-bottom: 15px; }
.pd-item:last-child { margin-bottom: 0; }
.pd-item-thumb { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.08); flex-shrink: 0; border: 2px solid rgba(199, 255, 77, 0.5); }
.pd-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-item-body { min-width: 0; }
.pd-item-body strong { display: block; color: var(--accent); font-size: 0.88rem; margin-bottom: 5px; }
.pd-item-body ul { list-style: none; margin: 0; padding: 0; }
.pd-item-body li { font-size: 0.84rem; color: rgba(255, 255, 255, 0.9); padding-left: 12px; position: relative; margin-top: 3px; }
.pd-item-body li::before { content: "•"; position: absolute; left: 0; color: var(--accent); }
.pd-item-body li b { color: #fff; font-weight: 700; }

/* actions — below the complete Products/Services content */
.pd-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.pd-actions .p-badge { margin: 0; }
.pd-report { margin-left: auto; }

/* supporting cards on the same single background */
.pd-page .wa-card { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.13); color: #fff; box-shadow: none; }
.pd-page .wa-card h3 { color: #fff; }
.pd-page .wa-desc { color: rgba(255, 255, 255, 0.85); }
.pd-page .spec-table { border-color: rgba(255, 255, 255, 0.14); }
.pd-page .spec-table h4 { color: var(--accent); }
.pd-page .spec-row:nth-child(odd) { background: rgba(255, 255, 255, 0.05); }
.pd-page .spec-row span { color: rgba(255, 255, 255, 0.6); }
.pd-page .spec-row strong { color: #fff; }
.pd-page .review-item { border-bottom-color: rgba(255, 255, 255, 0.12); }
.pd-page .review-head strong { color: #fff; }
.pd-page .review-head time { color: rgba(255, 255, 255, 0.55); }
.pd-page .btn-ghost-dark { color: #fff; border-color: var(--line-dark); }
.pd-page .btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.pd-page .wa-empty { border-color: rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.75); }
.pd-page .wa-loading { color: rgba(255, 255, 255, 0.75); }
.pd-page .wa-loading .spinner { border-color: rgba(255, 255, 255, 0.25); border-top-color: var(--accent); }

@media (max-width: 720px) {
  .pd-sections { grid-template-columns: 1fr; gap: 26px; }
}

/* account */
.acct-head { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.cred-stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-light);
}
.cred-stat { display: flex; flex-direction: column; gap: 2px; }
.cred-stat strong { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.cred-stat span { font-size: 0.72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; }
.acct-avatar {
  position: relative;
  overflow: hidden;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--violet-800), var(--violet-600));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.chip-static { background: var(--violet-100); color: var(--violet-800); font-size: 0.74rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* toast + form errors */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--violet-900);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 18px 44px rgba(18, 8, 46, 0.35);
  z-index: 400;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.form-error { color: #c0392b; font-size: 0.78rem; }
.link-btn { background: none; border: none; padding: 0; color: var(--violet-600); font-size: 0.78rem; cursor: pointer; text-decoration: underline; }

@media (max-width: 820px) {
  .pd-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .browse-layout { grid-template-columns: 1fr; gap: 18px; }
  .browse-sidebar { position: static; }
  .side-cats { flex-direction: row; flex-wrap: wrap; max-height: none; overflow: visible; }
  .side-cat { width: auto; }
}
@media (max-width: 720px) {
  .browse-head { flex-direction: column; }
  .browse-controls .wa-input { width: 100%; }
  .side-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
  .side-cat { white-space: nowrap; flex: 0 0 auto; }
}

/* ---------- marketplace: cart, checkout, orders ---------- */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line-light);
  border-radius: 10px;
  background: var(--surface);
  flex: 0 0 auto;
}
.qty-btn {
  border: 0;
  background: none;
  width: 26px;
  height: 26px;
  font-size: 1.02rem;
  line-height: 1;
  color: var(--violet-800);
  cursor: pointer;
  border-radius: 7px;
}
.qty-btn:hover { background: var(--violet-100); }
.qty-num {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--ink);
}

.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  padding: 9px 0 2px;
  border-top: 1px dashed var(--line-light);
  margin-top: 8px;
}
.cart-total strong {
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: var(--ink);
}

.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.status-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.status-awaiting_payment { background: #fff4e0; color: #b06a00; }
.status-paid { background: #e7f9ee; color: #1a7a3d; }
.status-confirmed { background: #e3f1ff; color: #1a6cb0; }
.status-in_delivery { background: #eef0ff; color: #4b3fd4; }
.status-delivered { background: var(--violet-100); color: var(--violet-800); }
.status-completed { background: var(--accent); color: var(--violet-900); }
.status-cancelled { background: #ffe9ec; color: #c0392b; }
.status-refunded { background: #f0e6ff; color: #7b3fd4; }
.status-open { background: #fff4e0; color: #b06a00; }
.status-reviewed { background: #e7f9ee; color: #1a7a3d; }
.status-dismissed { background: #f1f1f4; color: #6b6b76; }
.status-new { background: #fff4e0; color: #b06a00; }
.status-reviewing { background: #e3f1ff; color: #1a6cb0; }
.status-approved { background: #e7f9ee; color: #1a7a3d; }
.status-declined { background: #ffe9ec; color: #c0392b; }
.status-onboarded { background: var(--accent); color: var(--violet-900); }

.order-steps { display: flex; gap: 7px; flex-wrap: wrap; }
.os-step {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.os-step.is-done { background: var(--violet-100); color: var(--violet-800); }
.os-dot {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line-light);
  font-size: 0.6rem;
  font-weight: 700;
}
.os-step.is-done .os-dot { background: var(--violet-600); border-color: var(--violet-600); color: #fff; }
.os-label { white-space: nowrap; }

/* ---------- marketplace: product form ---------- */
.img-tile {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-2);
}
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-tile button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 8, 46, 0.72);
  color: #fff;
  font-size: 0.62rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.pf-photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.pf-photo-tile {
  position: relative;
  width: 84px;
  height: 84px;
  border: 1px solid var(--line-light);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-2);
  flex-shrink: 0;
}
.pf-photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-photo-tile.is-first { border: 2px solid var(--accent); }
.pf-photo-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  background: var(--accent);
  color: var(--violet-900);
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 999px;
}
.pf-photo-first {
  position: absolute;
  left: 4px;
  bottom: 4px;
  right: 4px;
  border: 0;
  border-radius: 6px;
  background: rgba(18, 8, 46, 0.72);
  color: #fff;
  font-size: 0.56rem;
  font-weight: 700;
  padding: 3px 0;
  cursor: pointer;
}
.pf-photo-rm {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 8, 46, 0.72);
  color: #fff;
  font-size: 0.62rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.pf-photo-add {
  width: 84px;
  height: 84px;
  border: 1px dashed var(--line-light);
  border-radius: 10px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
}
.pf-photo-add:hover { border-color: var(--accent); color: var(--ink); }

.crop-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
  border-radius: 10px;
}
.crop-stage img {
  display: block;
  max-width: 480px;
  max-height: 55vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  user-select: none;
  -webkit-user-drag: none;
}
.crop-box {
  position: absolute;
  border: 2px solid #C7FF4D;
  box-shadow: 0 0 0 9999px rgba(18, 8, 46, 0.6);
  cursor: move;
  touch-action: none;
}
.crop-handle {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #C7FF4D;
  border: 2px solid #12082e;
  cursor: nwse-resize;
  touch-action: none;
}

/* ---------- marketplace: chat ---------- */
.chat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease;
}
.chat-row:hover { background: var(--paper-2); }
.chat-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--violet-800), var(--violet-600));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  overflow: hidden;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-row-main { flex: 1; min-width: 0; }
.chat-row-main strong { display: block; color: var(--ink); font-size: 0.86rem; }
.chat-row-main p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-row-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.chat-row-meta .wa-note { margin: 0; }

.unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--violet-800);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.chat-view {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-light);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  height: min(60vh, 540px);
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-light);
}
.chat-head-id {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}
.chat-head-id strong { font-family: var(--font-display); font-size: 0.9rem; }
.msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--paper-2);
}
.msg {
  max-width: 76%;
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
  box-shadow: 0 4px 14px rgba(36, 26, 82, 0.05);
}
.msg p { margin: 0; font-size: 0.84rem; line-height: 1.5; word-break: break-word; }
.msg time { display: block; font-size: 0.64rem; color: var(--ink-soft); margin-top: 3px; }
.msg.me {
  align-self: flex-end;
  background: var(--violet-800);
  border-color: var(--violet-800);
  color: #fff;
  border-radius: 12px 12px 4px 12px;
}
.msg.me time { color: rgba(255, 255, 255, 0.7); }
.msg-composer {
  display: flex;
  gap: 9px;
  padding: 10px 14px;
  border-top: 1px solid var(--line-light);
  background: var(--surface);
}
.msg-composer .wa-input { width: auto; flex: 1; }

/* WhatsApp-style messaging layout */
.wa-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) 1fr;
  height: min(66vh, 600px);
  border: 1px solid var(--line-light);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.wa-sbar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line-light); background: var(--paper-2); }
.wa-sbar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-light);
  background: var(--surface);
}
.wa-sbar-head .pd-avatar { width: 36px; height: 36px; font-size: 0.9rem; }
.wa-sbar-me { min-width: 0; }
.wa-sbar-me strong { display: block; font-family: var(--font-display); font-size: 0.9rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-sbar-sub { display: block; font-size: 0.72rem; color: var(--ink-soft); }
.wa-convs { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.wa-convs::-webkit-scrollbar { width: 6px; }
.wa-convs::-webkit-scrollbar-thumb { background: var(--violet-200); border-radius: 6px; }
.wa-conv {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.wa-conv:hover { background: var(--violet-100); }
.wa-conv.is-active { background: var(--violet-100); }
.wa-conv .chat-avatar { width: 38px; height: 38px; }
.wa-conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-conv-name { font-weight: 600; font-size: 0.84rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-conv-preview { font-size: 0.75rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-conv-meta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.wa-conv-time { font-size: 0.66rem; color: var(--ink-soft); }
.wa-conv-empty { padding: 26px 18px; text-align: center; }
.wa-conv-empty p { margin: 0 0 12px; color: var(--ink-soft); font-size: 0.84rem; }
.wa-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper-2); }
.wa-chat-empty { flex: 1; display: grid; place-items: center; align-content: center; gap: 8px; padding: 20px; color: var(--ink-soft); text-align: center; }
.wa-chat-empty-ico { font-size: 1.9rem; }
.wa-chat-empty p { margin: 0; }
.wa-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-light);
  background: var(--surface);
}
.wa-chat-head .chat-avatar { width: 36px; height: 36px; font-size: 0.86rem; }
.wa-chat-id { flex: 1; min-width: 0; }
.wa-chat-id strong { display: block; font-family: var(--font-display); font-size: 0.9rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat-status { display: block; font-size: 0.7rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-back {
  display: none;
  border: 0;
  background: none;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--violet-800);
  cursor: pointer;
  padding: 4px 7px;
  margin-left: -7px;
}
.wa-chat .msg-list { flex: 1; min-height: 0; }
.wa-chat .msg-composer { background: var(--surface); }

@media (max-width: 820px) {
  .wa-layout { grid-template-columns: 1fr; height: calc(100vh - var(--header-h) - 40px); }
  .wa-sbar { border-right: 0; }
  .wa-chat { display: none; }
  .wa-m-open .wa-sbar { display: none; }
  .wa-m-open .wa-chat { display: flex; }
  .wa-back { display: inline-flex; align-items: center; }
}

/* ---------- marketplace: reviews ---------- */
.review-list { margin-top: 6px; }
.review-item { padding: 10px 0; border-bottom: 1px solid var(--line-light); }
.review-item:last-child { border-bottom: 0; }
.review-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}
.review-head strong { color: var(--ink); }
.review-head time { color: var(--ink-soft); font-size: 0.72rem; }
.review-stars { color: #f5b301; letter-spacing: 0.04em; }

/* star picker */
.star-picker { display: inline-flex; gap: 3px; }
.star-picker .star {
  background: none;
  border: 0;
  padding: 2px;
  font-size: 1.4rem;
  line-height: 1;
  color: #d5cfe8;
  cursor: pointer;
  transition: color 0.15s ease;
}
.star-picker .star:hover,
.star-picker .star.on { color: #f5b301; }

/* ---------- marketplace: admin ---------- */
.admin-table { display: grid; gap: 9px; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line-light);
  border-radius: 11px;
  background: var(--paper-2);
}
.admin-row .ci-main { flex: 1; min-width: 200px; }
.admin-row .status-chip { background: var(--surface); }
.admin-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.admin-chart-box {
  background: var(--paper-2);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 12px;
  height: 260px;
  display: flex;
  flex-direction: column;
}
.admin-chart-box canvas { flex: 1; min-height: 0; }

/* ---------- marketplace: seller grid ----------
   Grid sizing intentionally mirrors .sell-grid (compact auto-fill tiles)
   rather than a fixed column count, per explicit request to match /sell's
   density on /shop. */
.seller-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.seller-card {
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.seller-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(36, 26, 82, 0.09);
  border-color: var(--violet-400);
}
.seller-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--violet-100);
  color: var(--violet-800);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  overflow: hidden;
}
.seller-avatar img { width: 100%; height: 100%; object-fit: cover; }
.seller-body { flex: 1; min-width: 0; }
.seller-top { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.seller-top h4 { font-size: 0.74rem; margin: 0; color: var(--ink); }
.seller-headline { margin: 2px 0 0; font-size: 0.62rem; color: var(--ink-soft); }
.seller-loc { margin: 2px 0 0; font-size: 0.6rem; color: var(--ink-soft); }
.seller-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.seller-meta .review-stars b { color: var(--ink); font-size: 0.6rem; }
.seller-counts { font-size: 0.56rem; color: var(--ink-soft); }

/* ---------- marketplace: seller catalog ---------- */
.sl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.seller-listing {
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.seller-listing:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(36, 26, 82, 0.09);
  border-color: var(--violet-400);
}
.sl-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--paper-2);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.sl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sl-ph { font-size: 0.64rem; color: var(--ink-soft); text-align: center; padding: 4px; }
.sl-main { flex: 1; min-width: 0; padding: 8px 10px 10px; }
.sl-title {
  font-size: 0.76rem;
  margin: 0 0 3px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sl-cities { margin: 0 0 5px; font-size: 0.68rem; color: var(--ink-soft); }
.sl-updated { margin: 5px 0 0; font-size: 0.66rem; }
.sl-variants { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.sl-variant {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--paper-2);
  border: 1px solid var(--line-light);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.64rem;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
}
.sl-variant span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-variant b { color: var(--violet-800); flex: 0 0 auto; }

.offered-by-heading {
  font-size: 1rem;
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 10px;
}
.seller-listing.is-search-hit {
  border-color: var(--violet-500);
  box-shadow: 0 0 0 2px rgba(46, 30, 168, 0.14);
  background: linear-gradient(180deg, #ffffff 0%, #f6f4ff 100%);
}
.sl-hit-badge {
  margin-left: 6px;
  vertical-align: middle;
  font-size: 0.62rem;
  padding: 2px 7px;
}
.sl-variant.is-search-hit-variant {
  background: #e6e0ff;
  border-color: var(--violet-400);
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(46, 30, 168, 0.1);
}
.sl-variant.is-search-hit-variant b { color: var(--violet-800); }

@media (max-width: 900px) {
  .sl-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- marketplace: variant editor ---------- */
.variant-editor { display: grid; gap: 8px; }
.variant-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.variant-row .vr-name { flex: 1.4; }
.variant-row .vr-price { flex: 1; }
.variant-row .vr-currency { flex: 0 0 104px; width: auto; font-size: 0.82rem; padding: 0 6px; }
.variant-row.is-dragging { opacity: 0.4; }
.vr-drag {
  flex: 0 0 auto;
  cursor: grab;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1;
  padding: 3px 2px;
  user-select: none;
  touch-action: none;
}
.vr-drag:active { cursor: grabbing; }
.vr-del {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-light);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.78rem;
}
.vr-del:hover { color: #d6455d; border-color: #d6455d; }

/* ---------- marketplace: city chips ---------- */
.city-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.city-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--violet-100);
  color: var(--violet-800);
  border-radius: 999px;
  padding: 5px 5px 5px 11px;
  font-size: 0.76rem;
  font-weight: 600;
}
.city-chip button {
  background: none;
  border: 0;
  color: var(--violet-800);
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.64rem;
  line-height: 1;
}
.city-chip button:hover { background: rgba(36, 26, 82, 0.12); }

/* ---------- marketplace: listing form sections ---------- */
#productForm { display: grid; gap: 20px; }
#pfProdSections, #pfSvcSections { display: grid; gap: 16px; }
.pf-sec-head {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
  margin: -4px 0 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-light);
  display: flex;
  align-items: center;
  gap: 7px;
}
.pf-subhead {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin: 15px 0 7px;
}
.pf-add-center { display: grid; place-items: center; margin-top: 12px; }
.pf-add-more { margin-top: 15px; padding-top: 13px; border-top: 1px dashed var(--line-light); }
.pf-sec-del {
  margin-left: auto;
  border: none;
  background: var(--danger-100, #fee2e2);
  color: var(--danger-600, #b91c1c);
  width: 24px;
  height: 24px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1;
}
.pf-sec-del:hover { background: var(--danger-200, #fecaca); }
.btn-lg { padding: 9px 17px; font-size: 0.84rem; }
.seller-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.seller-cats .side-cat { width: auto; }
.pf-city-row { display: flex; gap: 7px; }
.pf-city-row .wa-input { flex: 1; min-width: 0; }
.pf-city-hint {
  margin: 5px 0 0;
  font-size: 0.74rem;
  color: var(--violet-700);
  background: var(--violet-100);
  border-radius: 7px;
  padding: 5px 9px;
}
.avail-cities { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.avail-city {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  background: var(--paper-2);
  border: 1px solid var(--line-light);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 0.82rem;
  color: var(--ink);
}
.avail-city em { font-style: normal; font-size: 0.68rem; color: var(--ink-soft); font-weight: 600; }
.avail-city button {
  background: none;
  border: 0;
  color: var(--ink-soft);
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  line-height: 1;
}
.avail-city button:hover { color: #d6455d; background: rgba(214, 69, 93, 0.1); }

@media (max-width: 720px) {
  .msg { max-width: 88%; }
  .chat-view { height: 70vh; }
  .sl-grid { grid-template-columns: 1fr; }
  .variant-row { flex-wrap: wrap; }
  .variant-row .vr-name { flex: 1 1 100%; }
  .pf-city-row { flex-wrap: wrap; }
}

/* ============================================================
   MPA — multi-page marketplace (own routes per page)
   ============================================================ */

/* active nav link (desktop + mobile menu) */
.site-nav a.is-active { color: #fff; }
.nav-menu a.is-active { color: var(--accent); }

/* seller dashboard stats */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 11px; margin-bottom: 16px; }
.dash-stat {
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  display: block;
}
a.dash-stat { transition: border-color 0.15s ease, transform 0.15s ease; }
a.dash-stat:hover { border-color: var(--violet-600); transform: translateY(-2px); }
.dash-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--violet-800);
}
.dash-stat span { font-size: 0.72rem; color: var(--ink-soft); }

/* standalone auth pages (/login, /signup) */
.auth-page {
  padding-top: clamp(40px, 6vw, 64px);
  padding-bottom: 48px;
  background:
    radial-gradient(900px 500px at 88% 0%, rgba(199, 255, 77, 0.16), transparent 55%),
    radial-gradient(700px 500px at 8% 100%, rgba(108, 76, 240, 0.35), transparent 55%),
    linear-gradient(170deg, var(--violet-900) 0%, var(--violet-800) 100%);
}
.auth-wrap { max-width: 420px; margin: 0 auto; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line-light);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(36, 26, 82, 0.08);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 15px;
}
.auth-switch {
  display: flex;
  gap: 4px;
  background: var(--paper-2);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 16px;
}
.auth-switch a {
  flex: 1;
  padding: 9px;
  text-align: center;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.auth-switch a:hover { color: var(--violet-800); }
.auth-switch a.is-active { background: var(--violet-800); color: #fff; }

.pw-field { position: relative; }
.pw-field input { padding-right: 38px; width: 100%; }
.pw-toggle {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 7px;
  color: var(--ink-soft);
}
.pw-toggle:hover { color: var(--ink); }

/* ---------- reverse marketplace: offer comparison ---------- */
.offer-list { display: grid; gap: 8px; }
.offer-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line-light);
  border-radius: 11px;
  background: var(--surface);
}
.offer-row.is-best { border-color: var(--accent); background: var(--accent-soft); }
.offer-main { flex: 1; min-width: 0; }
.offer-main strong { display: flex; align-items: center; gap: 7px; font-size: 0.86rem; color: var(--ink); flex-wrap: wrap; }
.offer-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.offer-price { font-family: var(--font-display); font-size: 0.98rem; color: var(--ink); }

/* ---------- demand gap ---------- */
.demand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.demand-card { background: var(--surface); border: 1px solid var(--line-light); border-radius: 12px; padding: 13px 14px; }
.demand-card strong { display: block; font-family: var(--font-display); font-size: 0.92rem; color: var(--ink); }
.demand-card p { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.demand-tag { display: inline-block; margin-top: 6px; font-size: 0.66rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.demand-tag.is-high { background: #ffe9ec; color: #c0392b; }
.demand-tag.is-balanced { background: var(--violet-100); color: var(--violet-800); }

/* SEO landing pages */
.product-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px; }
.seo-cat-links { display:flex; flex-wrap:wrap; gap:0.5rem; }
.seo-cat-links a { border:1px solid rgba(0,0,0,0.12); border-radius:999px; padding:0.4rem 0.9rem; font-size:0.9rem; color:inherit; text-decoration:none; }
.seo-cat-links a:hover { border-color:var(--violet-500, #6C4CF0); color:var(--violet-500, #6C4CF0); }

/* ---------------- bulk listing toggle + cards ----------------
   A completely separate, additive layer on top of the single-item listing
   system — see add-listing.html and openPostRequest() for the toggle that
   switches into this mode. Never applied to single listings. */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; background: var(--line-light); border-radius: 999px; transition: background 0.2s ease; pointer-events: none; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform 0.2s ease; }
.switch input:checked ~ .switch-track { background: var(--accent, #C7FF4D); }
.switch input:checked ~ .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible ~ .switch-track { outline: 2px solid var(--violet-600); outline-offset: 2px; }

.bulk-toggle-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.bulk-toggle-bar strong { font-size: 0.95rem; }

.bulk-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; background: var(--violet-800, #2E1EA8); color: #fff; border-radius: 999px; padding: 3px 10px; }

.bulk-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--violet-200, #d9d3fb); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease; }
.bulk-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(46, 30, 168, 0.14); }
/* Collage layout adapts to how many item photos there actually are, instead
   of always reserving a fixed 2x2 grid (which left blank quadrants for a
   1- or 2-item bulk listing). */
.bulk-card-collage { display: grid; gap: 2px; height: 160px; overflow: hidden; background: var(--violet-100); }
.bulk-card-collage.bcc-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.bulk-card-collage.bcc-2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.bulk-card-collage.bcc-3 { grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; }
.bulk-card-collage.bcc-3 > *:first-child { grid-row: 1 / 3; }
.bulk-card-collage.bcc-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
/* Grid items default to min-height/min-width:auto, which lets a tall or
   wide source photo's intrinsic size stretch its track past the collage's
   own 160px height — pinning both to 0 forces object-fit:cover to actually
   constrain it instead. */
.bulk-card-collage > * { min-height: 0; min-width: 0; overflow: hidden; }
.bulk-card-collage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bulk-card-collage .bulk-collage-ph { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--violet-100); }
.bulk-card-body { padding: 12px 14px; }
.bulk-card-body h4 { font-family: var(--font-display); font-size: 0.95rem; margin: 6px 0 4px; }
.bulk-card-count { font-size: 0.78rem; color: var(--ink-soft); }

.bulk-item-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.bulk-item-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line-light); border-radius: 12px; padding: 10px; }
.bulk-item-media { position: relative; flex: none; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--violet-100); }
.bulk-item-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bulk-item-media .bulk-item-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.bulk-item-media .bulk-item-type-badge { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 0; font-size: 0.6rem; text-align: center; color: #fff; background: rgba(0, 0, 0, 0.55); }
.bulk-item-body { flex: 1; min-width: 0; padding: 0; }
.bulk-item-body h5 { font-size: 0.92rem; margin: 0 0 3px; line-height: 1.3; }
.bulk-item-body span { font-size: 0.8rem; color: var(--ink-soft); }

.bulk-form-item { border: 1px solid var(--line-light); border-radius: 10px; padding: 14px; margin-top: 14px; position: relative; }
.bulk-form-item-remove { position: absolute; top: 10px; right: 10px; background: #e53e3e; color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 12px; line-height: 20px; text-align: center; }
.bulk-form-item-preview img { max-width: 100px; max-height: 100px; border-radius: 8px; object-fit: cover; }
