:root {
  --mk-border: #e2e8f0;
  --mk-surface-light: #f1f5f9;
  --mk-text-muted: #94a3b8;
  --mk-surface: #f8fafc;
  --mk-text-secondary: #64748b;

  /* Single source of truth for the site content column. The header
     (.site-header__inner), footer (.site-footer__cols) and every page's
     content container (.market-shell) all use this so their left/right edges
     align perfectly — content lines up with the header logo and profile menu. */
  --shell-width: min(1240px, calc(100% - 32px));

  /* Shared height for the three Messages hub tabs (Gigs/Chat/Community). The
     Gigs tab is the reference — all tabs use this so switching never jumps. */
  --msg-hub-height: 600px;
  /* Shared inner gutter for the three Messages hub tabs. Applied identically to
     every tab's top-level surface so the left panel's left edge and the right
     panel's right edge are pixel-identical across Chat / Gigs / Community. */
  --msg-hub-pad: 16px;

  /* Shared shell dimensions + palette for the three Messages tabs so the sidebar,
     conversation header and composer are pixel-identical across Chat/Gigs/Community.
     Only inner content differs per tab — the shell can never drift apart again. */
  --msg-sidebar-width: 340px;      /* identical sidebar width for all three tabs */
  --msg-header-min-h: 64px;        /* conversation-panel header shell height */
  --msg-header-pad: 12px 16px;     /* conversation-panel header padding */
  --msg-input-height: 42px;        /* message-input field + send button height */
  --msg-radius: 12px;              /* shared control radius */
  --msg-sidebar-bg: #fafbfc;       /* light sidebar surface (Gigs/Community treatment) */
  --msg-panel-bg: #ffffff;         /* conversation panel + header + composer surface */
  --msg-border: #eef2f7;           /* shared hairline border */
  --msg-ink: #0f172a;              /* primary text */
  --msg-muted: #64748b;            /* subtitle / meta text */
  --msg-accent: var(--indigo);           /* shared active/selected accent (site indigo) */
  --msg-item-hover: rgba(79, 70, 229, 0.06);
  --msg-item-active: rgba(79, 70, 229, 0.12);
  --msg-icon-bg: #f1f5f9;          /* header icon-button surface */
  --msg-icon-ink: #475569;
}


.market-shell {
  /* Match the header/footer content column exactly (see --shell-width) so
     content edges align with the header on every page. */
  width: var(--shell-width);
  margin: 0 auto;
  padding: 34px 0 52px;
  display: grid;
  gap: 24px;
  min-height: calc(100vh - 84px - 52px); /* fill viewport below header */
  align-content: start;                  /* push content to top, not stretch */
}

.market-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.market-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent 72%);
  pointer-events: none;
}

.market-card--nested {
  padding: 24px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
}

.market-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.market-card__header,
.market-card__header,
.market-list__item,
.market-tile {
  margin: 0;
}

/* ── Review actions (Helpful / Not helpful / Flag) ── */
.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.review-actions__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--mk-border);
  border-radius: 8px;
  background: var(--mk-surface);
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
}
.review-actions__btn:hover:not(:disabled) {
  background: var(--mk-border);
  border-color: #cbd5e1;
}
.review-actions__btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.review-actions__btn--active {
  background: #1e40af;
  color: #fff;
  border-color: #1e40af;
  opacity: 1;
}
.review-actions__btn--active:hover:not(:disabled) {
  background: #1e3a8a;
  border-color: #1e3a8a;
}
.review-actions__btn--flag {
  margin-left: auto;
  color: var(--mk-text-muted);
  border-color: transparent;
  background: transparent;
}
.review-actions__btn--flag:hover:not(:disabled) {
  color: var(--mk-text-secondary);
  background: var(--mk-surface-light);
}
.review-actions__flagged {
  margin-left: auto;
  font-size: 0.8125rem;
  color: #ef4444;
}
.review-actions__btn svg {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .review-actions {
    gap: 6px;
    margin-top: 8px;
  }
  .review-actions__btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
  }
  .review-actions__btn--flag {
    margin-left: 0;
  }
}

.market-eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--primary);
}

.market-section-title {
  margin: 0 0 14px;
  font-size: 1.08rem;
  font-weight: 800;
}

.market-form {
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.market-grid {
  display: grid;
  gap: 16px;
}

.market-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.market-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.market-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.market-grid--cards {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.market-label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.market-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.market-input {
  width: 100%;
  padding: 14px 15px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.market-input:hover {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #ffffff;
}

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

.market-help {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.5;
}

.market-hours-section {
  margin: 0;
  padding: 0;
}

/* ─── Base styles (all screens) ─── */
.market-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.market-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: var(--primary);
  font: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
}
.market-button:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}
.market-button--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.market-button--outline {
  background: transparent;
  border-color: #0d9488;
  color: #0d9488;
}
.market-button--outline:hover {
  background: #0d9488;
  color: #fff;
}
.market-hours {
  display: grid;
  gap: 10px;
}
.market-hours__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
  justify-items: stretch;
  padding: 10px 12px;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(191, 219, 254, 0.5);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}
.market-hours__row strong {
  grid-column: 1 / -1;
  font-size: 0.88rem;
  text-align: left;
}
.market-hours__row .market-checkbox {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  text-align: left;
}
.market-hours__row .market-input[type="time"] {
  width: 100%;
  min-height: 40px;
  font-size: 0.85rem;
  border-radius: 6px;
  padding: 6px 8px;
  box-sizing: border-box;
  text-align: left;
}
.market-hours__row .market-input {
  width: 100%;
  box-sizing: border-box;
}

/* ── Combobox base (all screens) ── */
.market-combobox {
  position: relative;
}
.market-combobox__input {
  width: 100%;
  box-sizing: border-box;
}
.market-combobox__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 15;
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.market-combobox__option {
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text, #1e293b);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.market-combobox__option:active {
  background: rgba(37, 99, 235, 0.08);
}
.market-combobox__option.is-selected {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, var(--primary));
  font-weight: 600;
}
.market-combobox__empty {
  margin: 0;
  padding: 12px;
  color: var(--muted, #64748b);
  font-size: 0.85rem;
}

/* ── Combobox mobile bottom-sheet ── */
@media (max-width: 768px) {
  .market-combobox__menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10002;
    max-height: 70vh;
    max-height: 70dvh;
    border-radius: 16px 16px 0 0;
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
    animation: comboSlideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .market-combobox__option {
    padding: 14px 12px;
    font-size: 0.9375rem;
    min-height: 44px;
    border-radius: 10px;
  }
  .market-combobox__option:first-child {
    color: var(--muted, #64748b);
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--mk-surface-light);
    border-radius: 0;
    padding-bottom: 12px;
    margin-bottom: 4px;
  }
}
/* Combobox backdrop */
.market-combobox__backdrop {
  display: none;
}
/* Combobox sheet header (mobile only) */
.market-combobox__sheet-header {
  display: none;
}
@media (max-width: 768px) {
  .market-combobox__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.4);
    animation: comboFadeIn 0.2s ease;
  }
  .market-combobox__sheet-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px 0 6px;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2;
    border-bottom: 1px solid var(--mk-surface-light);
    margin-bottom: 4px;
  }
  .market-combobox__grab {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #cbd5e1;
  }
  .market-combobox__sheet-search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid var(--mk-border);
    border-radius: 10px;
    background: var(--mk-surface);
    font: inherit;
    font-size: 16px;
    color: #1e293b;
    outline: none;
  }
  .market-combobox__sheet-search:focus {
    border-color: #93c5fd;
    background: #fff;
  }
  .market-combobox__option--clear {
    color: var(--mk-text-secondary);
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--mk-surface-light);
    border-radius: 0 !important;
    padding-bottom: 12px !important;
    margin-bottom: 4px;
  }
}
@keyframes comboFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes comboSlideUp {
  from { transform: translateY(100%); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 768px) {
  .market-hours-section {
    padding: 0;
  }
  .market-hours-section .market-section-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 600;
  }
}

@media (min-width: 769px) {
  .market-hours-section .market-section-title {
    margin: 0 0 12px;
  }
  .market-hours-section,
  .market-hours {
    display: grid;
  }
  .market-file-pick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    min-height: 44px;
    padding: 10px 20px;
  }
  .market-button--disabled {
    opacity: 0.5;
    pointer-events: none;
  }
  .market-combobox {
    position: relative;
  }
  .market-combobox__menu {
    position: absolute;
    top: calc(100%, 8px);
    left: 0;
    right: 0;
    z-index: 15;
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-soft);
    max-height: 260px;
    overflow-y: auto;
  }
  .market-combobox__option {
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .market-combobox__option,
  .market-combobox__option,
  .is-selected {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
  }
  .market-combobox__empty {
    margin: 0;
    padding: 12px;
    color: var(--muted);
  }
  .market-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
  }
  .market-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(255, 255, 255, 0.86);
    color: var(--primary);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
  }
  .market-button--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
  }
  .market-button--outline {
    background: transparent;
    border: 1.5px solid #0f766e;
    color: #0f766e;
    box-shadow: none;
  }
  .market-button--outline:hover {
    background: rgba(15, 118, 110, 0.06);
    border-color: #0d9488;
    color: #0d9488;
  }
  .market-button--with-badge,
  .market-chat-fab--with-badge {
    position: relative;
  }
  .market-unread-badge {
    position: absolute;
    top: -7px;
    right: -4px;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.35rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.45);
    pointer-events: none;
    z-index: 2;
  }
  .market-chat-fab,
  .market-chat-fab--with-badge,
  .market-unread-badge:hover {
    top: -2px;
    right: -2px;
  }
  .market-list {
    display: grid;
    gap: 20px;
  }
  .market-list__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    border-radius: var(--radius-lg, 12px);
    border: 1.5px solid var(--mk-text-secondary);
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }
  .market-list__content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
  }
  .market-list__item,
  .market-meta,
  .market-muted,
  .market-tile {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
  }
  .market-hours {
    display: grid;
    gap: 12px;
  }
  .market-hours__row {
    display: grid;
    grid-template-columns: 140px auto 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(191, 219, 254, 0.62);
    background: rgba(255, 255, 255, 0.72);
  }
  .market-hours {
    gap: 8px;
  }
  .market-tile {
    display: grid;
    gap: 6px;
    padding: 22px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    border: 1px solid rgba(191, 219, 254, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(239, 246, 255, 0.82));
    box-shadow: var(--shadow-soft);
  }
  .market-tile,
  .market-list__item {
    border-color: rgba(59, 130, 246, 0.28);
  }
  .market-muted {
    font-weight: 500;
  }
  .market-meta {
    font-size: 0.93rem;
  }
  .market-price {
    margin: 12px 0 0;
    color: var(--text);
    font-weight: 800;
  }
  .market-list__content,
  .market-list__thumb {
    width: 120px;
    height: 120px;
    min-width: 120px;
    max-width: 120px;
    max-height: 120px;
    flex-shrink: 0;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius-md);
    border: 1px solid rgba(191, 219, 254, 0.72);
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: opacity 0.15s;
  }
  .market-list__content,
  .market-list__thumb {
    opacity: 0.88;
  }
  .market-media-grid__image,
  .market-media-manage__image {
    max-width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid rgba(191, 219, 254, 0.72);
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: opacity 0.15s;
  }
  .market-media-grid__image,
  .market-media-manage__image:hover {
    opacity: 0.85;
  }
  .market-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 0 0 18px;
  }
  .market-media-grid__item {
    display: grid;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(248, 250, 252, 0.6);
    border-radius: var(--radius-md);
  }
  .market-hours-list {
    display: grid;
    gap: 10px;
  }
  .market-hours-list__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(191, 219, 254, 0.62);
  }
  .market-media-manage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
  }
  .market-media-manage__item {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(191, 219, 254, 0.62);
    background: rgba(255, 255, 255, 0.76);
    position: relative;
  }
  .market-media-manage__item--featured {
    border-color: var(--primary, var(--primary-bright));
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
    background: rgba(239, 246, 255, 0.8);
  }
  .market-featured-check {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary, #64748b);
    user-select: none;
    -webkit-user-select: none;
  }
  .market-featured-check:hover {
    width: 16px;
    height: 16px;
    accent-color: var(--primary, var(--primary-bright));
    cursor: pointer;
    margin: 0;
  }
  .market-featured-check:hover {
    white-space: nowrap;
  }
  .market-media-manage__item--featured,
  .market-featured-check:hover {
    color: var(--primary, var(--primary-bright));
    font-weight: 600;
  }
  .market-list__item,
  .loading-panel {
    width: 100%;
    margin-top: 14px;
  }
}

@media (max-width: 900px) {
  .market-shell {
    /* Tablet: stay aligned with the header content column. */
    width: var(--shell-width);
    padding: 26px 0 40px;
  }
  .market-card {
    padding: 22px;
  }
  .market-list__item {
    border: 1.5px solid #475569;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10);
    background: #fff;
  }
  .market-list {
    gap: 22px;
  }
  .market-grid--4,
  .market-grid--3,
  .market-grid--2 {
    grid-template-columns: 1fr;
  }
  .market-hours {
    display: grid;
    gap: 8px;
  }
  .market-hours__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
    justify-items: stretch;
    padding: 10px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
    border: 1px solid rgba(191, 219, 254, 0.62);
    background: rgba(255, 255, 255, 0.72);
    text-align: left;
  }
  .market-hours__row strong {
    grid-column: 1 / -1;
    font-size: 0.84rem;
    text-align: left;
  }
  .market-hours__row .market-checkbox {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    text-align: left;
  }
  .market-hours__row .market-input[type="time"] {
    width: 100%;
    min-height: 40px;
    font-size: 0.82rem;
    border-radius: 6px;
    padding: 6px 8px;
    box-sizing: border-box;
  }
  .market-card__header,
  .market-list__item,
  .market-list__content {
    flex-direction: column;
  }
  .market-hours-list__row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding: 8px 10px;
    gap: 16px;
    font-size: 0.8125rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(191, 219, 254, 0.62);
  }
  .market-hours-list__row strong {
    min-width: 80px;
    flex-shrink: 0;
    font-size: 0.8125rem;
  }
  .market-hours-list__row span {
    font-size: 0.75rem;
    text-align: right;
    flex: 1;
  }
  .market-hours-list {
    gap: 4px;
  }
  .market-list__content,
  .market-list__thumb {
    width: 100%;
    height: 200px;
    min-width: 0;
    max-width: none;
    max-height: 200px;
  }
  .market-actions {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }
  .market-button {
    width: 100%;
    text-align: center;
    justify-content: center;
    min-height: 44px;
    font-size: 0.9rem;
    padding: 12px 16px;
    border-radius: 12px;
  }
  .market-label {
    font-size: 0.84rem;
  }
  .market-input {
    font-size: 0.88rem;
    min-height: 42px;
    padding: 10px 12px;
  }
  .market-input--textarea {
    min-height: 80px;
  }
  .market-help {
    font-size: 0.72rem;
  }
  .market-avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    margin-bottom: 8px;
  }
  .market-avatar-upload__preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-strong, rgba(59, 130, 246, 0.18));
    cursor: pointer;
    transition: opacity 0.15s;
  }
  .market-avatar-upload__preview:hover {
    opacity: 0.85;
  }
  .market-avatar-upload__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, var(--primary)) 0%, var(--accent, var(--accent)) 100%);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 800;
  }
  .market-avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    vertical-align: middle;
  }
  .market-avatar--sm {
    width: 22px;
    height: 22px;
    margin-right: 4px;
  }
  .market-avatar--lg {
    width: 64px;
    height: 64px;
    border: 2px solid var(--border-strong, rgba(59, 130, 246, 0.18));
    margin-right: 8px;
  }
  .market-button--small {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 999px;
    cursor: pointer;
  }
  .market-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .market-input-group,
  .market-input:hover {
    flex: 1;
    min-width: 0;
  }
  .market-input-group__btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-strong, rgba(59, 130, 246, 0.18));
    background: var(--primary-soft, rgba(37, 99, 235, 0.12));
    color: var(--primary, var(--primary));
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
  }
  .market-input-group__btn:hover {
    background: var(--primary, var(--primary));
    color: #fff;
    transform: scale(1.05);
  }
  .market-input-group__spinner {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--primary, var(--primary));
  }
  .market-help--detected {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success-text, #166534);
    font-weight: 600;
  }
  .market-help__clear {
    background: none;
    border: none;
    color: var(--error-text, #be123c);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
  }
}

/* === Image Lightbox Overlay (all screens) === */
.market-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  animation: market-lightbox-in 0.22s ease-out;
  cursor: zoom-out;
}

@keyframes market-lightbox-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.market-lightbox__stage {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  max-width: min(96vw, 960px);
  max-height: 96vh;
  z-index: 1;
  cursor: default;
}

.market-lightbox__viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(92vw, 880px);
  height: min(80vh, 700px);
  min-height: 240px;
  max-width: 100%;
  box-sizing: border-box;
  background: transparent;
  border-radius: 10px;
  overflow: visible;
}

.market-lightbox__img {
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  cursor: default;
  display: block;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

.market-lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.market-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.market-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.market-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.market-lightbox__nav--prev {
  left: 16px;
}

.market-lightbox__nav--next {
  right: 16px;
}

.market-lightbox__counter {
  flex-shrink: 0;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.85rem;
  font-weight: 600;
}

.market-lightbox__thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 6px 4px;
  width: min(92vw, 880px);
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.market-lightbox__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  padding: 0;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.72;
  transition: opacity 0.15s, border-color 0.15s;
}

.market-lightbox__thumb:hover {
  opacity: 1;
}

.market-lightbox__thumb.is-active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.market-lightbox__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (max-width: 600px) {
  .market-lightbox__viewport {
    width: 92vw;
    height: min(52vh, 420px);
    min-height: 200px;
  }
  .market-lightbox__thumb {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
  }
  .market-lightbox__close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    top: -48px;
    right: 0;
    background: rgba(0,0,0,0.5);
  }
  .market-lightbox__nav {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
    background: rgba(0,0,0,0.45);
  }
  .market-lightbox__nav--prev { left: 8px; }
  .market-lightbox__nav--next { right: 8px; }
  .market-lightbox__counter {
    font-size: 0.8125rem;
    padding: 3px 10px;
  }
  .market-chat-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .market-chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.55);
  }
  .market-chat-fab--guest {
    text-decoration: none;
    background: linear-gradient(135deg, #0f172a, #334155);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35);
  }
  .market-chat-window-root {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
  }
  .market-chat-window {
    pointer-events: auto;
    position: absolute;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    width: min(420px, calc(100vw - 2rem));
    height: min(560px, calc(100vh - 5.5rem));
    max-height: calc(100vh - 5.5rem);
    display: flex;
    flex-direction: column;
    background: var(--surface, #fff);
    border-radius: 16px;
    border: 1px solid var(--border, #e2e8f0);
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.04), 0 24px 48px rgba(15, 23, 42, 0.16);
    overflow: hidden;
  }
  .market-chat-window__titlebar {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 12px;
    background: linear-gradient(135deg, #1e3a8a 0%, var(--primary) 55%, var(--primary-dark) 100%);
    color: var(--mk-surface);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .market-chat-window__titleblock {
    min-width: 0;
  }
  .market-chat-window__meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
  }
  .market-chat-window__eyebrow {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
  }
  .market-chat-window__transport {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.35);
    color: var(--mk-border);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: default;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .market-chat-window__transport--live {
    background: rgba(16, 185, 129, 0.35);
    border-color: rgba(52, 211, 153, 0.55);
    color: #ecfdf5;
  }
  .market-chat-window__title {
    margin: 0 0 6px;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
  }
  .market-chat-window__subtitle {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: rgba(248, 250, 252, 0.88);
    max-width: 28rem;
  }
  .market-chat-window__socket-issue {
    margin: 8px 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #fef08a;
    max-width: 28rem;
  }
  .market-chat-window__close {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    transition: background 0.15s ease;
  }
  .market-chat-window__close:hover {
    background: rgba(255, 255, 255, 0.24);
  }
  .market-chat-window__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface, #f8fafc);
  }
  .market-chat-window__banner {
    flex-shrink: 0;
    padding: 10px 12px 0;
  }
  .market-chat-window__loading {
    margin: 0;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    color: var(--muted-text, #64748b);
  }
  .market-chat-window__empty {
    margin: 0;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--muted-text, #64748b);
  }
  .market-chat-window__messages {
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .market-chat-bubble {
    align-self: flex-start;
    max-width: 92%;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--muted-bg, #f1f5f9);
    color: var(--text, #0f172a);
  }
  .market-chat-bubble--mine {
    align-self: flex-end;
    background: var(--primary-soft, #dbeafe);
  }
  .market-chat-bubble__text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
  }
  .market-chat-bubble__sender {
    display: block;
    margin-bottom: 2px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent, var(--indigo-light));
  }
  .market-chat-bubble--mine,
  .market-chat-bubble__sender:hover {
    color: rgba(255, 255, 255, 0.85);
  }
  .market-chat-bubble__meta {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--muted-text, #64748b);
  }
  .market-chat-window__composer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border, #e2e8f0);
    background: var(--surface, #fff);
  }
  .market-chat-window__input {
    resize: none;
    min-height: 52px;
    font-size: 0.95rem;
  }
  .market-chat-window__send {
    align-self: flex-end;
    min-width: 6.5rem;
  }
}

@media (max-width: 520px) {
  .market-chat-window:hover {
    left: max(0.5rem, env(safe-area-inset-left, 0px));
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    width: auto;
    bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    height: min(78vh, 620px);
    border-radius: 14px 14px 10px 10px;
  }
  .market-muted--no-mt {
    margin-top: 0;
  }
  .market-muted--mt-sm {
    margin-top: 1rem;
  }
  .market-muted--mb-xs {
    margin-bottom: 0.35rem;
  }
  .market-muted--warn {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    line-height: 1.55;
  }
  .card-carousel {
    position: relative;
    width: 160px;
    height: 120px;
    min-width: 160px;
    max-width: 160px;
    border-radius: var(--radius-md, 10px);
    overflow: hidden;
    border: 1px solid rgba(191, 219, 254, 0.72);
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    flex-shrink: 0;
  }
  .card-carousel__track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
    will-change: transform;
  }
  .card-carousel__slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
  }
  .card-carousel__dots {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
  }
  .card-carousel__dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
    min-height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    border: none;
    padding: 0;
  }
  .card-carousel__dot--active {
    background: #fff;
    transform: scale(1.3);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  }
  .card-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transition: opacity 0.2s;
    padding: 0;
    color: #1e293b;
    line-height: 0;
  }
  .card-carousel__arrow:hover {
    flex-shrink: 0;
    display: block;
  }
  .card-carousel,
  .card-carousel__arrow:hover {
    opacity: 1;
  }
  .card-carousel__arrow--prev {
    left: 4px;
  }
  .card-carousel__arrow--next {
    right: 4px;
  }
  .card-carousel__arrow:hover {
    background: #fff;
  }
}

@media (max-width: 768px) {
  .card-carousel:hover {
    width: 100%;
    height: 220px;
    min-width: 0;
    max-width: none;
    max-height: 220px;
  }
  .card-carousel__arrow:hover {
    display: none;
  }
}

@media (max-width: 480px) {
  .card-carousel:hover {
    height: 180px;
    max-height: 180px;
  }
  .market-media-grid__image--clickable,
  .market-list__thumb--clickable {
    cursor: pointer;
  }
  .market-list__title--link {
    cursor: pointer;
    color: var(--text-primary, #1e293b);
  }
  .market-list__title--link:hover {
    color: var(--primary, var(--primary-bright));
    text-decoration: underline;
  }
  .market-list__desc--link {
    cursor: pointer;
  }
  .market-list__desc--link:hover {
    color: var(--primary, var(--primary-bright));
  }
  .market-meta__seller-link {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
  }
  .market-meta__seller-link:hover {
    color: var(--primary, var(--primary-bright));
    text-decoration: underline;
  }
  .market-media-manage--mt {
    margin-top: 0.75rem;
  }
  .market-actions--mt {
    margin-top: 1rem;
  }
  .market-file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
  .market-file-list__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-sm, 6px);
    background: var(--surface-alt, #f8fafc);
  }
  .market-file-list__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
  }
  .market-file-list__link {
    flex: 1;
    color: var(--primary, var(--primary));
    text-decoration: none;
    word-break: break-all;
  }
  .market-file-list__link:hover {
    text-decoration: underline;
  }
  .market-seller-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex: 1;
    min-width: 0;
  }
  .market-error-details {
    margin-top: 1rem;
    font-size: 0.85rem;
    white-space: pre-wrap;
  }
  .market-error-pre {
    overflow: auto;
    max-height: 300px;
    background: #f9f9f9;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
  }
  .market-error-pre--short {
    max-height: 200px;
  }
  .market-settings-cats {
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
  }
  .market-settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .market-settings-label {
    position: relative;
  }
  .market-settings-label__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .market-settings-label__key {
    font-weight: 400;
    font-size: 0.75rem;
  }
  .market-settings-label__modified {
    color: #ef4444;
    font-size: 0.7rem;
    font-weight: 600;
  }
  .market-settings-label__desc {
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
  }
  .market-settings-input-row {
    display: flex;
    gap: 0.35rem;
  }
  .market-settings-save-bar {
    margin-top: 1rem;
    position: sticky;
    bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-surface, #fff);
    border-radius: 0.5rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  }
  .market-list__item:hover {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
  }
  .market-list__item:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
  }
  .market-list__item--highlight {
    border-color: var(--primary-bright);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25), 0 8px 24px rgba(59, 130, 246, 0.10);
    animation: highlight-fade 3s ease-out forwards;
  }
}

@keyframes highlight-fade {
  0% {
    background-color: rgba(59, 130, 246, 0.08), 100%;
    background-color: transparent;
  }
}

.market-card__header h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.market-card__header h2 {
  font-size: 1.25rem;
  line-height: 1.3;
}

.market-list__item .market-list__desc {
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.market-price {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.market-price-gst {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

.market-avatar--lg {
  width: 64px;
  height: 64px;
  border: 2px solid rgba(191, 219, 254, 0.8);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.market-section-title {
  position: relative;
  padding-bottom: 10px;
}

.market-section-title::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
}

.market-button--small {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: 12px;
}

.market-avatar-upload {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.6);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.market-avatar-upload:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(239, 246, 255, 0.6);
}

.market-avatar-upload__preview:hover {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(191, 219, 254, 0.8);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}


.market-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 0;
}

.market-pagination__info {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}


.market-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

.market-status-badge--pending {
  background: #fef3c7;
  color: #92400e;
}

.market-status-badge--active {
  background: #dcfce7;
  color: #166534;
}

.market-status-badge--completed {
  background: #dbeafe;
  color: #1e40af;
}

.market-status-badge--cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.market-form-section {
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  padding-top: 20px;
  margin-top: 4px;
}

.market-form-section:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.market-input-group__btn {
  min-width: 44px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .market-shell {
    padding: 20px 0 36px;
  }
  .market-card {
    padding: 20px 18px;
    border-radius: var(--radius-lg);
  }
  .market-card--nested {
    padding: 16px;
  }
  .market-list__item {
    flex-direction: column;
    padding: 14px;
    border: 2px solid #475569;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10);
  }
  .market-list {
    gap: 24px;
  }
  .market-list__content {
    flex-direction: column;
  }
  .market-list__content,
  .market-list__thumb {
    width: 100%;
    height: 160px;
    max-width: 100%;
    max-height: 160px;
    border-radius: var(--radius-md);
  }
  .market-grid--2,
  .market-grid--3,
  .market-grid--4 {
    grid-template-columns: 1fr;
  }
  .market-actions {
    flex-direction: column;
  }
  .market-actions--desktop-only {
    display: none;
  }
  .market-actions,
  .market-button {
    width: 100%;
    text-align: center;
  }
  .market-seller-header {
    flex-direction: column;
    text-align: center;
  }
  .social-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .social-like-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
  }
  .social-like-btn--active {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
  }
  .social-like-btn:hover {
    opacity: 0.5;
    cursor: default;
  }
  .social-like-btn:hover {
    flex-shrink: 0;
  }
  .social-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .social-share-btn:hover {
    border-color: var(--primary, var(--primary-bright));
    color: var(--primary, var(--primary-bright));
    background: rgba(59, 130, 246, 0.06);
  }
  .social-share-sheet {
    max-width: 400px;
  }
  .social-share-sheet__options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 20px;
  }
  .social-share-sheet__option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: none;
    border-radius: 12px;
    background: var(--mk-surface);
    color: #334155;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
  }
  .social-share-sheet__option:hover {
    background: var(--mk-border);
  }
  .social-share-sheet__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
  }
  .social-share-sheet__icon--wa {
    background: #25D366;
  }
  .social-share-sheet__icon--tg {
    background: #0088cc;
  }
  .social-share-sheet__icon--fb {
    background: #1877F2;
  }
  .social-share-sheet__icon--tw {
    background: #000;
  }
  .social-share-sheet__icon--email {
    background: var(--mk-text-secondary);
  }
  .social-share-sheet__icon--copy {
    background: var(--indigo-light);
    font-size: 1.2rem;
  }
  .social-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border, #e2e8f0);
    margin-top: 8px;
  }
  .social-bar__stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary, #64748b);
    font-size: 0.875rem;
  }
  .social-comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm, 8px);
    color: var(--text-secondary, #64748b);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
  .social-comment-btn:hover {
    background: var(--hover-bg, #f1f5f9);
    color: var(--primary, var(--indigo-light));
  }
  .social-comments {
    background: var(--surface, #fff);
    border-radius: var(--radius-md, 16px);
    border: 1px solid var(--border, #e2e8f0);
    overflow: hidden;
  }
  .social-comments__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--text, #1e293b);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
  }
  .social-comments__toggle:hover {
    background: rgba(0, 0, 0, 0.03);
  }
  .social-comments__chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
  }
  .social-comments__chevron--open {
    transform: rotate(180deg);
  }
  .social-comments__body {
    padding: 0 20px 20px;
  }
  .social-comments__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }
  .social-comments__input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    background: var(--bg-alt, #f8fafc);
    color: var(--text, #1e293b);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s;
  }
  .social-comments__input:hover {
    outline: none;
    border-color: var(--primary, var(--primary-bright));
  }
  .social-comments__submit {
    align-self: flex-end;
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: var(--primary, var(--primary-bright));
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
  }
  .social-comments__submit:hover {
    background: var(--primary-dark, var(--primary));
  }
  .social-comments__submit:hover {
    opacity: 0.5;
    cursor: default;
  }
  .social-comments__error {
    color: #ef4444;
    font-size: 0.82rem;
    margin: 0;
  }
  .social-comments__login-hint {
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
    padding: 8px 0 16px;
    margin: 0;
  }
  .social-comments__loading {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px 0;
    margin: 0;
  }
  .social-comments__empty {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px 0;
    margin: 0;
  }
  .social-comments__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .social-comments__more {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    background: transparent;
    color: var(--primary, var(--primary-bright));
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
  }
  .social-comments__more:hover {
    background: rgba(59, 130, 246, 0.06);
  }
  .social-comment {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
  }
  .social-comment:hover {
    border-bottom: none;
  }
  .social-comment__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
  }
  .social-comment__body {
    flex: 1;
    min-width: 0;
  }
  .social-comment__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
  }
  .social-comment__header:hover {
    font-size: 0.875rem;
    color: var(--text, #1e293b);
  }
  .social-comment__header:hover {
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
  }
  .social-comment__delete {
    margin-left: auto;
    border: none;
    background: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
  }
  .social-comment__delete:hover {
    color: #ef4444;
  }
  .social-comment__body:hover {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text, #334155);
    line-height: 1.5;
    word-break: break-word;
  }
  .social-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: social-sheet-fade-in 0.2s ease;
  }
}

@keyframes social-sheet-fade-in {
  from {
    opacity: 0, to;
    opacity: 1;
  }
}

.social-sheet {
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  animation: social-sheet-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

@keyframes social-sheet-slide-up {
  from {
    transform: translateY(100%), to;
    transform: translateY(0);
  }
}

.social-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--mk-border);
  flex-shrink: 0;
}

.social-sheet__header::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #cbd5e1;
}

.social-sheet__title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.social-sheet__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--mk-surface-light);
  color: var(--mk-text-secondary);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.social-sheet__close:hover {
  background: var(--mk-border);
  color: #1e293b;
}

.social-sheet__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

.social-sheet__body,
.social-comments:hover {
  border: none;
  border-radius: 0;
  margin: 0;
}

.social-sheet__body,
.social-comments__toggle:hover {
  display: none;
}

.social-sheet__body,
.social-comments__body:hover {
  padding: 16px 20px 20px;
}

@media (min-width: 769px) {
  .social-sheet-overlay:hover {
    align-items: center;
  }
  .social-sheet:hover {
    border-radius: 16px;
    max-height: 70vh;
  }
  .social-follow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
  }
  .social-follow__btn {
    padding: 6px 18px;
    border: 1px solid var(--primary, var(--primary-bright));
    border-radius: 20px;
    background: var(--primary, var(--primary-bright));
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .social-follow__btn:hover {
    background: var(--primary-dark, var(--primary));
  }
  .social-follow__btn--following {
    background: transparent;
    color: var(--primary, var(--primary-bright));
  }
  .social-follow__btn--following:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
    color: #ef4444;
  }
  .social-follow__btn:hover {
    opacity: 0.5;
    cursor: default;
  }
  .social-follow__count {
    font-size: 0.82rem;
    color: var(--text-secondary, #64748b);
  }
  .gig-activity-card {
    margin-top: 16px;
  }
  .gig-activity-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary, var(--indigo-light));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    margin-left: 8px;
    vertical-align: middle;
  }
  .gig-activity-scroll {
    max-height: 600px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .gig-activity-list {
    display: flex;
    flex-direction: column;
  }
  .gig-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    transition: background 0.15s;
  }
  .gig-activity-item:hover {
    border-bottom: none;
  }
  .gig-activity-item--unread {
    background: var(--primary-bg, #eef2ff);
  }
  .gig-activity-item__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-alt, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #64748b);
  }
  .gig-activity-item--unread,
  .gig-activity-item__icon:hover {
    background: var(--primary, var(--indigo-light));
    color: #fff;
  }
  .gig-activity-item__content {
    flex: 1;
    min-width: 0;
  }
  .gig-activity-item__title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text, #1e293b);
    margin: 0;
  }
  .gig-activity-item__body {
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
    margin: 2px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gig-activity-item__time {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 4px;
    display: block;
  }
  .gig-activity-more {
    margin: 12px 20px 16px;
  }
}

@media (max-width: 640px) {
  .social-bar:hover {
    flex-wrap: wrap;
    gap: 8px;
  }
  .social-follow:hover {
    flex-wrap: wrap;
  }
  .gig-activity-item:hover {
    padding: 12px 14px;
    gap: 10px;
  }
  .market-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0d9488;
    background: #ccfbf1;
    border-radius: 9999px;
    padding: 1px 8px 1px 5px;
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.5;
  }
  .market-verified-badge:hover {
    flex-shrink: 0;
    color: #0d9488;
  }
  .market-profile-progress {
    margin: 0.75rem 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: var(--surface-secondary, #f8fafc);
    border: 1px solid var(--border-light, #e2e8f0);
  }
  .market-profile-progress__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }
  .market-profile-progress__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
  }
  .market-profile-progress__bar {
    height: 8px;
    border-radius: 4px;
    background: var(--border-light, #e2e8f0);
    overflow: hidden;
  }
  .market-profile-progress__fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #f59e0b, #f97316);
    transition: width 0.4s ease;
  }
  .market-profile-progress__fill--done {
    background: linear-gradient(90deg, #10b981, #0d9488);
  }
  .market-profile-progress__remaining {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
  }
  .market-profile-progress__missing {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .market-profile-progress__missing:hover {
    font-size: 0.78rem;
    color: var(--text-secondary, #64748b);
    background: #fff;
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 6px;
    padding: 2px 10px;
  }
  .market-profile-progress__missing::before {
    content: '\25CB ';
    color: #f59e0b;
  }
  .market-suggest-category {
    margin: 0.75rem 0 0.5rem;
  }
  .market-suggest-category__form {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--market-border, #cbd5e1);
    border-radius: 8px;
    background: var(--market-surface-muted, #f8fafc);
  }
  .market-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--market-primary, var(--indigo));
    cursor: pointer;
    font: inherit;
    text-decoration: none;
  }
  .market-link:hover {
    text-decoration: underline;
  }
  .market-link--sm {
    font-size: 0.875rem;
  }
  .market-profile-progress--dropdown {
    margin: 0 0 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
  }
  .market-profile-progress--dropdown .market-profile-progress__header {
    margin-bottom: 4px;
  }
  .market-profile-progress--dropdown .market-profile-progress__title {
    font-size: 0.75rem;
  }
  .market-profile-progress--dropdown .market-profile-progress__bar {
    height: 5px;
    border-radius: 3px;
  }
  .market-profile-progress--dropdown .market-profile-progress__remaining {
    margin: 6px 0 0;
    font-size: 0.72rem;
  }
  .market-profile-progress--dropdown .market-profile-progress__missing {
    gap: 4px;
    margin: 6px 0 0;
  }
  .market-profile-progress--dropdown .market-profile-progress__missing li {
    font-size: 0.68rem;
    padding: 1px 6px;
  }
  .lang-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: social-sheet-fade-in 0.2s ease;
  }
  .lang-picker-sheet {
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: social-sheet-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  }
  .lang-picker-sheet__header {
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--mk-surface-light);
    text-align: center;
  }
  .lang-picker-sheet__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
  }
  .lang-picker-sheet__body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .lang-picker-sheet__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #334155;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
  }
  .lang-picker-sheet__option:hover {
    background: var(--mk-surface);
  }
  .lang-picker-sheet__option,
  .is-selected:hover {
    background: #eff6ff;
    color: var(--primary-dark);
    font-weight: 600;
  }
  .lang-picker-sheet__check {
    color: var(--primary-bright);
    flex-shrink: 0;
  }
  .lang-picker-sheet__footer {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--mk-surface-light);
  }
  .lang-picker-sheet__btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
  }
  .lang-picker-sheet__btn:hover {
    opacity: 0.6;
    cursor: not-allowed;
  }
  .lang-picker-sheet__btn--skip {
    background: var(--mk-surface-light);
    color: var(--mk-text-secondary);
  }
  .lang-picker-sheet__btn--confirm {
    background: var(--primary-bright);
    color: #fff;
  }
  .fy-stories {
    margin: 0 !important;
    border-bottom: none !important;
    padding: 2px 12px 0 !important;
    min-height: auto !important;
  }
  .fy-stories__scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .fy-stories__scroll::-webkit-scrollbar {
    display: none;
  }
  .fy-stories__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 72px;
    -webkit-tap-highlight-color: transparent;
  }
  .fy-stories__ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    padding: 3px;
    background: var(--mk-border);
    transition: background 0.2s;
  }
  .fy-stories__ring--active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
  }
  .fy-stories__ring--seen {
    background: var(--mk-border, #d1d5db);
  }
  .fy-stories__img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    background: var(--mk-surface);
  }
  .fy-stories__name {
    font-size: 0.7rem;
    color: var(--text-primary, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
    text-align: center;
    line-height: 1.2;
  }
  .buyer-account-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
    min-height: calc(100dvh - 120px);
    padding: 0;
    gap: 0;
  }
}

@media (max-width: 768px) {
  .buyer-account-page:hover {
    min-height: calc(100vh - 130px);
    min-height: calc(100dvh - 130px);
  }
  .buyer-account {
    background: #fff;
    border-radius: var(--radius-lg, 12px);
    padding: 0;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .buyer-account__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem 1rem;
  }
  .buyer-account__avatar-wrap {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .buyer-account__avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color, #e2e8f0);
    display: block;
  }
  .buyer-account__avatar-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary, var(--primary-bright));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  }
  .buyer-account__uploading {
    font-size: 0.75rem;
    color: var(--primary, var(--primary-bright));
  }
  .buyer-account__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0;
    word-break: break-word;
    text-align: center;
  }
  .buyer-account__stats {
    display: flex;
    border-top: 1px solid var(--border-color, #e2e8f0);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    margin: 0;
  }
  .buyer-account__stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 4px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .buyer-account__stat--active {
    border-bottom-color: var(--primary, var(--primary-bright));
    background: rgba(59, 130, 246, 0.04);
  }
  .buyer-account__stat-count {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    line-height: 1;
  }
  .buyer-account__stat--active,
  .buyer-account__stat-count:hover {
    color: var(--primary, var(--primary-bright));
  }
  .buyer-account__stat-label {
    font-size: 0.7rem;
    color: var(--muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
  }
  .buyer-account__tab-content {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .buyer-account__loading {
    text-align: center;
    color: var(--muted, #64748b);
    padding: 2.5rem 1rem;
    font-size: 0.9rem;
  }
  .buyer-account__empty {
    text-align: center;
    color: var(--muted, #64748b);
    padding: 2.5rem 1rem;
    font-size: 0.88rem;
  }
  .buyer-account__list {
    display: flex;
    flex-direction: column;
  }
  .buyer-account__list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mk-surface-light);
  }
  .buyer-account__list-item:hover {
    border-bottom: none;
  }
  .buyer-account__list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--mk-surface);
  }
  .buyer-account__list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .buyer-account__list-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #1e293b);
    line-height: 1.3;
  }
  .buyer-account__list-meta {
    font-size: 0.78rem;
    color: var(--muted, #64748b);
    line-height: 1.3;
  }
  .buyer-account__list-date {
    font-size: 0.7rem;
    color: var(--muted-light, #94a3b8);
    line-height: 1.3;
  }
  .buyer-account__comment-body {
    font-size: 0.82rem;
    color: var(--text-secondary, #475569);
    margin: 2px 0 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }
  .buyer-account__actions {
    display: flex;
    gap: 0.75rem;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    flex-shrink: 0;
    background: #fff;
    margin-top: auto;
  }
  .buyer-account__actions,
  .market-button:hover {
    flex: 1;
    text-align: center;
  }
  .market-button--sm {
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 8px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .market-button--danger {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fff5f5;
  }
  .market-button--danger,
  .market-button--danger:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #b91c1c;
  }
  .pj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
  }
  .pj-card {
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border: 1.5px solid var(--mk-border);
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .pj-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.10);
  }
  .pj-card__body {
    padding: 18px 20px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .pj-card__header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }
  .pj-card__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
  }
  .pj-card__badge {
    flex-shrink: 0;
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 999px;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    white-space: nowrap;
    line-height: 1.4;
  }
  .pj-card__badge--closed,
  .pj-card__badge--cancelled,
  .pj-card__badge--expired {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
  }
  .pj-card__badge--assigned,
  .pj-card__badge--accepted {
    background: #eff6ff;
    color: var(--primary);
    border-color: #bfdbfe;
  }
  .pj-card__desc {
    margin: 0;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .pj-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 4px;
  }
  .pj-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--mk-text-secondary);
    font-weight: 500;
  }
  .pj-card__meta-item:hover {
    flex-shrink: 0;
    color: var(--mk-text-muted);
  }
  .pj-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--mk-surface);
    border-top: 1px solid var(--mk-border);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
  }
  .pj-card__btn:hover {
    background: #eff6ff;
    color: var(--primary-dark);
  }
  .pj-card__btn:hover {
    flex-shrink: 0;
    transition: transform 0.15s;
  }
  .pj-card__btn:hover {
    transform: translateX(2px);
  }
}

@media (max-width: 768px) {
  .buyer-account__header:hover {
    padding: 1.25rem 0.75rem 0.75rem;
  }
  .buyer-account__avatar:hover {
    width: 76px;
    height: 76px;
  }
  .buyer-account__name:hover {
    font-size: 1rem;
  }
  .buyer-account__stat:hover {
    padding: 10px 4px;
  }
  .buyer-account__stat-count:hover {
    font-size: 1.05rem;
  }
  .buyer-account__list-item:hover {
    padding: 12px;
    gap: 10px;
  }
  .buyer-account__list-avatar:hover {
    width: 40px;
    height: 40px;
  }
  .buyer-account__list-name:hover {
    font-size: 0.88rem;
  }
  .buyer-account__list-meta:hover {
    font-size: 0.78rem;
  }
  .buyer-account__list-item,
  .market-button--sm:hover {
    padding: 8px 18px;
    font-size: 0.8rem;
    min-height: 38px;
    border-radius: 8px;
  }
  .buyer-account__actions:hover {
    padding: 10px 12px;
  }
  .market-avatar-upload:hover {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 14px;
  }
  .market-avatar-upload__preview:hover {
    width: 72px;
    height: 72px;
  }
}

/* ══════════════════════════════════════════════════════════════
   Notifications page (redesign) — scoped under .notif-page
   Category accent tokens drive the icon tints / active states.
   ══════════════════════════════════════════════════════════════ */
.notif-page {
  --nt-total: var(--accent);
  --nt-messages: var(--indigo-light);
  --nt-orders: #f97316;
  --nt-reviews: #10b981;
  --nt-community: #ec4899;
  --nt-system: #64748b;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Header */
.notif-page__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.notif-page__title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.02em;
}

.notif-page__subtitle {
  margin: 4px 0 0;
  font-size: .875rem;
  color: var(--text-secondary, #64748b);
}

.notif-page__head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.notif-page__action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  color: var(--text-primary, #334155);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}

.notif-page__action-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}

.notif-page__action-btn--primary {
  border-color: transparent;
  background: var(--nt-total, var(--accent));
  color: #fff;
}

.notif-page__action-btn--primary:hover {
  background: #6d28d9;
  box-shadow: 0 8px 20px rgba(124, 58, 237, .3);
}

.notif-page__action-btn--primary .notif-page__settings-ico {
  transition: transform .35s ease;
}

.notif-page__action-btn--primary:hover .notif-page__settings-ico {
  transform: rotate(90deg);
}

/* Stat cards */
.notif-page__stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.notif-stat {
  --nt-accent: var(--nt-system);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border, #e9edf3);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.notif-stat--total { --nt-accent: var(--nt-total); }
.notif-stat--messages { --nt-accent: var(--nt-messages); }
.notif-stat--orders { --nt-accent: var(--nt-orders); }
.notif-stat--reviews { --nt-accent: var(--nt-reviews); }
.notif-stat--community { --nt-accent: var(--nt-community); }
.notif-stat--system { --nt-accent: var(--nt-system); }

.notif-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  border-color: color-mix(in srgb, var(--nt-accent) 40%, #e9edf3);
}

.notif-stat.is-active {
  border-color: var(--nt-accent);
  box-shadow: 0 0 0 1px var(--nt-accent), 0 8px 20px rgba(15, 23, 42, .08);
}

.notif-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--nt-accent);
  background: color-mix(in srgb, var(--nt-accent) 12%, #fff);
}

.notif-stat__count {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary, #0f172a);
}

.notif-stat__label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
}

/* Toolbar */
.notif-page__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border, #e9edf3);
  background: #fff;
}

.notif-page__search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  min-width: 180px;
}

.notif-page__search svg {
  position: absolute;
  left: 12px;
  color: var(--text-secondary, #94a3b8);
  pointer-events: none;
}

.notif-page__search-input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  font-size: .85rem;
  color: var(--text-primary, #0f172a);
  background: #f8fafc;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.notif-page__search-input:focus-visible {
  outline: none;
  border-color: var(--nt-total, var(--accent));
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

.notif-page__select {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-primary, #334155);
  cursor: pointer;
}

.notif-page__select:focus-visible {
  outline: none;
  border-color: var(--nt-total, var(--accent));
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

.notif-page__select--sort { margin-left: auto; }

.notif-page__tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #f1f5f9;
}

.notif-page__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.notif-page__tab:hover { color: var(--text-primary, #334155); }

.notif-page__tab.is-active {
  background: #fff;
  color: var(--nt-total, var(--accent));
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.notif-page__tab-badge {
  min-width: 18px;
  padding: 0 6px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  background: var(--nt-total, var(--accent));
}

.notif-page__tab-badge--muted { background: #94a3b8; }

/* Groups + rows */
.notif-page__groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.notif-group__label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 8px;
  padding-left: 2px;
}

.notif-group__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-row {
  --nt-accent: var(--nt-system);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border, #eef1f5);
  background: #fff;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}

.notif-row--messages { --nt-accent: var(--nt-messages); }
.notif-row--orders { --nt-accent: var(--nt-orders); }
.notif-row--reviews { --nt-accent: var(--nt-reviews); }
.notif-row--community { --nt-accent: var(--nt-community); }
.notif-row--system { --nt-accent: var(--nt-system); }

.notif-row:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--nt-accent) 35%, #eef1f5);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
}

.notif-row--unread {
  border-color: color-mix(in srgb, var(--nt-accent) 30%, #eef1f5);
  background: color-mix(in srgb, var(--nt-accent) 5%, #fff);
}

.notif-row__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: var(--nt-accent);
  background: color-mix(in srgb, var(--nt-accent) 12%, #fff);
}

.notif-row__body {
  flex: 1;
  min-width: 0;
}

.notif-row__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notif-row__title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.notif-row__badge {
  font-size: .66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--nt-accent);
  background: color-mix(in srgb, var(--nt-accent) 12%, #fff);
}

.notif-row__text {
  margin: 3px 0 0;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--text-secondary, #64748b);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notif-row__time {
  display: block;
  margin-top: 6px;
  font-size: .72rem;
  color: var(--text-secondary, #94a3b8);
}

.notif-row__aside {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.notif-row__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nt-accent);
}

.notif-row__act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s, border-color .15s;
}

.notif-row:hover .notif-row__act,
.notif-row:focus-within .notif-row__act {
  opacity: 1;
}

.notif-row__act:hover {
  background: #f1f5f9;
  border-color: var(--border, #e2e8f0);
  color: var(--nt-accent);
}

/* Empty */
.notif-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 56px 16px;
  color: var(--text-secondary, #94a3b8);
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: 16px;
  background: #fff;
}

.notif-page__empty p { margin: 0; font-size: .9rem; }

@media (max-width: 900px) {
  .notif-page__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .notif-page__select--sort { margin-left: 0; }
}

@media (max-width: 560px) {
  .notif-page__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notif-page__toolbar { padding: 10px; }
  .notif-page__tabs { width: 100%; justify-content: space-between; }
  .notif-page__tab { flex: 1; justify-content: center; }
  .notif-row__act { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .notif-page__action-btn,
  .notif-page__action-btn--primary .notif-page__settings-ico,
  .notif-stat,
  .notif-row { transition: none; }
  .notif-page__action-btn:hover,
  .notif-stat:hover,
  .notif-row:hover { transform: none; }
}

.reviews__summary {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-secondary, #f8fafc);
  border-radius: var(--radius, 12px);
}

.reviews__avg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 100px;
}

.reviews__avg-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
}

.reviews__avg-count {
  font-size: .75rem;
  color: var(--text-secondary, #64748b);
}

.reviews__stars {
  display: flex;
  gap: 2px;
  color: #f59e0b;
}

.reviews__distribution {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reviews__dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reviews__dist-star {
  font-size: .8rem;
  font-weight: 500;
  width: 12px;
  text-align: center;
}

.reviews__dist-bar {
  flex: 1;
  height: 8px;
  background: var(--border, #e2e8f0);
  border-radius: 4px;
  overflow: hidden;
}

.reviews__dist-fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 4px;
  transition: width .3s;
}

.reviews__dist-count {
  font-size: .75rem;
  color: var(--text-secondary, #94a3b8);
  width: 24px;
  text-align: right;
}

.reviews__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reviews__item {
  border-bottom: 1px solid var(--border, #f1f5f9);
  padding-bottom: 16px;
}

.reviews__item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.reviews__reviewer {
  font-weight: 500;
  font-size: .875rem;
}

.reviews__date {
  margin-left: auto;
  font-size: .75rem;
  color: var(--text-secondary, #94a3b8);
}

.reviews__comment {
  font-size: .875rem;
  line-height: 1.5;
  margin: 0 0 8px;
}

.reviews__response {
  background: var(--bg-secondary, #f1f5f9);
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 8px;
  font-size: .8rem;
}

.reviews__response:hover {
  display: block;
  margin-bottom: 4px;
}

.reviews__respond-form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reviews__respond-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.reviews__stats-row {
  display: flex;
  gap: 16px;
}

.reviews__stat-card {
  flex: 1;
  text-align: center;
  padding: 24px;
  background: var(--bg-secondary, #f8fafc);
  border-radius: var(--radius, 12px);
}

.reviews__stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
}

.reviews__stat-label {
  font-size: .8rem;
  color: var(--text-secondary, #64748b);
}

@media (max-width: 640px) {
  .reviews__summary:hover {
    flex-direction: column;
  }
  .reviews__stats-row:hover {
    flex-direction: column;
  }
  .seller-dash__order-status--in_progress {
    background: #dbeafe;
    color: #1e40af;
  }
  .seller-dash__order-amount {
    font-weight: 600;
    font-size: .875rem;
  }
  .follow__tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border, #e2e8f0);
  }
  .follow__tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
    color: var(--text-secondary, #64748b);
  }
  .follow__tab,
  .is-active:hover {
    color: var(--accent, var(--primary-bright));
    border-bottom-color: var(--accent, var(--primary-bright));
  }
  .follow__list {
    display: flex;
    flex-direction: column;
  }
  .follow__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border, #f1f5f9);
  }
  .follow__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
  }
  .follow__info {
    flex: 1;
  }
  .follow__name {
    display: block;
    font-weight: 500;
    font-size: .875rem;
  }
  .follow__type {
    font-size: .75rem;
    color: var(--text-secondary, #94a3b8);
    text-transform: capitalize;
  }
}

/* Old minified call/chat CSS removed — canonical styles are below in the chat-inbox section */

/* ═══════════════════════════════════════════════════════════════════
   UTILITY STYLES — Scrollbar, selection, focus-visible
   ═══════════════════════════════════════════════════════════════════ */

/* Keyframe kept for shimmer loading skeleton only */
@keyframes mkt-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
/* ── Input focus — no transform, keep border highlight ── */
.market-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
  background: #fff;
  outline: none;
}

/* ── Loading skeleton shimmer (kept) ── */
.market-skeleton,
.loading-panel {
  background: linear-gradient(90deg,
    rgba(248, 250, 252, 0.6) 25%,
    rgba(226, 232, 240, 0.4) 50%,
    rgba(248, 250, 252, 0.6) 75%
  );
  background-size: 200% 100%;
  animation: mkt-shimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-md);
  min-height: 180px;                /* stable skeleton height — prevents CLS */
}

/* ── CLS-safe page skeleton inside market-shell ── */
.market-page-skeleton {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

/* ── Tab active state ── */
.follow__tab.is-active,
.market-tab.is-active {
  color: var(--primary);
}

/* ── Scrollbar styling ── */
.market-shell ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.market-shell ::-webkit-scrollbar-track {
  background: transparent;
}
.market-shell ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 99px;
}
.market-shell ::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.48);
}

/* ── Selection highlight ── */
.market-shell ::selection {
  background: rgba(37, 99, 235, 0.18);
  color: var(--text);
}

/* ── Focus visible for accessibility ── */
.market-button:focus-visible,
.market-input:focus-visible,
.market-combobox__option:focus-visible,
.market-tab:focus-visible,
.follow__tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Empty state styling ── */
.market-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

/* ── Media grid item ── */
.market-media-grid__item {
  position: relative;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════
   SEARCH PAGE — Modern redesign
   ═══════════════════════════════════════════════════════════════════════ */

.search-page {
  width: 100%;
  min-height: 100vh;
  background: var(--mk-surface);
}

/* ── Hero section ── */
.search-hero {
  background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 35%, #312e81 60%, #1e40af 100%);
  padding: 52px 24px 56px;
  position: relative;
  overflow: visible;
  z-index: 11;
}

.search-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.search-hero__inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.search-hero__title {
  margin: 0 0 6px;
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.search-hero__subtitle {
  margin: 0 0 32px;
  font-size: 1.08rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
}

.search-hero__form {
  display: grid;
  gap: 0;
}

/* ── Search input bar ── */
.search-input-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 8px 8px 8px 22px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255,255,255,0.6);
  gap: 12px;
}

.search-input-wrapper__icon {
  flex-shrink: 0;
  color: var(--mk-text-secondary);
}

.search-input-wrapper__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 1.1rem;
  color: var(--text, #0f172a);
  padding: 14px 0;
  min-width: 0;
}

.search-input-wrapper__input::placeholder {
  color: var(--mk-text-muted);
}

.search-input-wrapper__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 32px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Advanced Search toggle ── */
.search-advanced-toggle {
  margin: 16px auto 0;
  display: flex;
  justify-content: center;
}

.search-advanced-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search-advanced-toggle__btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.search-advanced-toggle__btn--active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

.search-advanced-toggle__btn--active:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

.search-advanced-toggle__chevron {
  transition: transform 0.25s ease;
}

.search-advanced-toggle__chevron--open {
  transform: rotate(180deg);
}

/* ── Filter bar (floating card) ── */
.search-filter-bar {
  width: min(1100px, calc(100% - 40px));
  margin: 12px auto 0;
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  padding: 16px 20px;
  animation: filterSlideDown 0.25s ease-out;
}

@keyframes filterSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-filters {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-filters__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.search-filters__row--location {
  border-top: 1px solid var(--mk-surface-light);
  padding-top: 16px;
}

.search-filters__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.search-filters__item--disabled {
  opacity: 0.5;
  pointer-events: none;
}

.search-filters__item--disabled .search-filters__select {
  background: var(--mk-surface-light);
  color: var(--mk-text-muted);
  cursor: not-allowed;
}

.search-filters__item:first-child {
  padding-left: 0;
}

.search-filters__item:last-of-type {
  border-right: none;
}

.search-filters__item--pincode {
  min-width: 150px;
  flex: 0.9;
}

.search-filters__item--radius {
  min-width: 130px;
  flex: 0.8;
}

.search-filters__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mk-text-muted);
}

.search-filters__select {
  width: 100%;
  padding: 8px 28px 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--mk-border);
  background: var(--mk-surface);
  color: var(--text, #0f172a);
  font: inherit;
  font-size: 0.88rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.search-filters__select option {
  background: #fff;
  color: var(--text, #0f172a);
}

/* Pincode input uses same .search-filters__select class — override appearance for text input */
input.search-filters__select {
  background-image: none;
  padding-right: 10px;
}

.search-filters__pincode-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-filters__pincode-row .search-filters__select {
  flex: 1;
  min-width: 0;
}

.search-filters__geo-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--mk-border);
  background: var(--mk-surface-light);
  color: #475569;
  cursor: pointer;
}

.search-filters__geo-spinner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #475569;
}

.search-filters__detected {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #16a34a;
}

.search-filters__clear-pin {
  background: none;
  border: none;
  color: #dc2626;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.search-filters__range {
  width: 100%;
  accent-color: var(--primary);
  height: 6px;
  cursor: pointer;
}

.search-filters__browse-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  align-self: flex-end;
  margin-left: 12px;
}

/* ── Results section ── */
.search-results-section {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0;
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-results-header__count {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted, #64748b);
}

.search-results-header__query {
  color: var(--primary);
  font-weight: 700;
}

.search-results-header__title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text, #0f172a);
}

/* Sort dropdown (visual) */
.search-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-sort__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mk-text-secondary);
  white-space: nowrap;
}

.search-sort__select {
  padding: 7px 30px 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--mk-border);
  background: #fff;
  color: var(--text, #0f172a);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* Section divider */
.search-section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.search-section-divider__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  white-space: nowrap;
}

.search-section-divider__line {
  flex: 1;
  height: 1px;
  background: var(--mk-border);
}

/* ── Card grid ── */
.search-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Individual card ── */
.search-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.search-card--skeleton {
  cursor: default;
}

/* ── Card image ── */
.search-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--mk-surface-light);
}

.search-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-card__image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 100%);
  pointer-events: none;
}

.search-card__image--skeleton {
  background: linear-gradient(90deg, var(--mk-border) 25%, var(--mk-surface-light) 50%, var(--mk-border) 75%);
  background-size: 200% 100%;
  animation: search-shimmer 1.5s ease-in-out infinite;
}

.search-card__image--skeleton::after {
  display: none;
}

/* ── Overlay elements on image ── */
.search-card__pill {
  position: absolute;
  top: 10px;
  bottom: auto;
  left: 10px;
  right: auto;
  z-index: 2;
  width: auto;
  max-width: calc(100% - 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-card__price-badge {
  position: absolute;
  top: 10px;
  bottom: auto;
  right: 10px;
  left: auto;
  z-index: 2;
  width: auto;
  max-width: calc(100% - 20px);
  white-space: nowrap;
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

/* ── Card body ── */
.search-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
  flex: 1;
}

.search-card__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-card__desc {
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted, #64748b);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.search-card__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--mk-border);
}

.search-card__seller {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Rating stars ── */
.search-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.search-card__stars {
  display: flex;
  align-items: center;
  gap: 1px;
}

.search-card__star {
  color: var(--mk-border);
  flex-shrink: 0;
}

.search-card__star--filled {
  color: #f59e0b;
}

.search-card__rating-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mk-text-muted);
  margin-left: 4px;
}

.search-card__new-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: #ecfdf5;
  color: #059669;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Location row ── */
.search-card__location-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  margin: 4px -16px -16px;
  background: var(--mk-surface);
  border-top: 1px solid var(--mk-surface-light);
  border-radius: 0 0 14px 14px;
  font-size: 0.76rem;
  color: var(--mk-text-secondary);
}

.search-card__location-row svg {
  flex-shrink: 0;
  color: var(--mk-text-muted);
}

/* ── Out of stock ── */
.search-card__stock-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ── Product badge ── */
.search-card__product-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Skeleton lines ── */
.search-card__skeleton-line {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--mk-border) 25%, var(--mk-surface-light) 50%, var(--mk-border) 75%);
  background-size: 200% 100%;
  animation: search-shimmer 1.5s ease-in-out infinite;
}

.search-card__skeleton-line--title {
  height: 16px;
  width: 80%;
}

.search-card__skeleton-line--desc {
  height: 12px;
  width: 100%;
}

.search-card__skeleton-line--short {
  height: 12px;
  width: 50%;
}

@keyframes search-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty state ── */
.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 72px 24px;
}

.search-empty__icon-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--mk-surface-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.search-empty__icon-wrap svg {
  color: var(--mk-text-muted);
}

.search-empty__icon {
  color: var(--mk-text-muted);
  margin-bottom: 20px;
}

.search-empty__title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  letter-spacing: -0.01em;
}

.search-empty__text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted, #64748b);
  max-width: 420px;
  line-height: 1.6;
}

/* ── Pagination wrapper ── */
.search-pagination {
  display: flex;
  justify-content: center;
  padding: 36px 0 8px;
}

/* ── Responsive: Tablet ── */
@media (max-width: 900px) {
  .search-hero {
    padding: 40px 20px 56px;
  }
  .search-hero__title {
    font-size: 1.75rem;
  }
  .search-filter-bar {
    padding: 0 16px;
  }
  .search-filters {
    padding: 18px 20px;
    gap: 14px;
  }
  .search-filters__row {
    flex-wrap: wrap;
    gap: 12px;
  }
  .search-filters__item {
    min-width: 120px;
    flex: 1 1 140px;
  }
  .search-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  .search-results-section {
    padding: 28px 16px 40px;
    width: auto;
    margin: 0 auto;
  }
}

/* ── Responsive: Mobile ── */
@media (max-width: 600px) {
  .fy-hero {
    display: none !important;
  }
  .search-hero {
    padding: 28px 16px 24px;
  }
  .search-hero__title {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
  }
  .search-hero__subtitle {
    font-size: 0.8125rem;
    margin-bottom: 16px;
  }
  /* Search input — input + mic on same row */
  .search-input-wrapper {
    flex-wrap: nowrap;
    padding: 6px;
    gap: 6px;
    border-radius: 12px;
  }
  .search-input-wrapper__icon {
    display: none;
  }
  .search-input-wrapper__input {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 8px;
    font-size: 0.9375rem;
  }
  .search-input-wrapper__mic {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
  }
  .search-input-wrapper__btn {
    display: none;
  }
  /* Advanced toggle — mobile */
  .search-advanced-toggle {
    margin-top: 12px;
  }
  .search-advanced-toggle__btn {
    font-size: 0.8125rem;
    padding: 8px 18px;
    gap: 6px;
  }
  /* Filter bar — stack vertically, no overlap with hero */
  .search-filter-bar {
    margin-top: 8px;
    padding: 0 12px;
    width: calc(100% - 24px);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(15,23,42,0.06);
  }
  .search-filters {
    overflow-x: visible;
    flex-direction: column;
    padding: 14px;
    gap: 12px;
  }
  .search-filters__row {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .search-filters__row--categories {
    /* 3 equal category dropdowns in one row */
  }
  .search-filters__row--location {
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid var(--mk-surface-light);
    padding-top: 12px;
  }
  .search-filters__item {
    min-width: 0;
    flex: 1 1 0;
    padding: 0;
    border-right: none;
    border-bottom: none;
    padding-bottom: 0;
  }
  .search-filters__item--disabled {
    opacity: 0.45;
  }
  .search-filters__item:first-child {
    padding-left: 0;
  }
  .search-filters__item--pincode {
    flex: 1 1 100%;
  }
  .search-filters__item--radius {
    flex: 1 1 100%;
  }
  .search-filters__label {
    font-size: 0.6rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .search-filters__select {
    min-height: 40px;
    font-size: 0.8125rem;
    padding: 8px 6px;
    border-radius: 8px;
    background: var(--mk-surface);
  }
  .search-filters__browse-link {
    padding: 10px 0;
    margin-left: 0;
    justify-content: center;
    width: 100%;
  }
  /* Grid — single column */
  .search-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  /* Results section */
  .search-results-section {
    width: auto;
    padding: 20px 12px 32px;
    margin: 0;
  }
  .search-card__title {
    font-size: 0.9375rem;
  }
  .search-card__body {
    padding: 14px;
  }
  .search-empty {
    padding: 40px 16px;
  }
  .search-results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .search-sort {
    width: 100%;
  }
  .search-sort__select {
    flex: 1;
    min-height: 40px;
  }
  /* Section divider */
  .search-section-divider {
    gap: 10px;
    margin-bottom: 16px;
  }
  .search-section-divider__title {
    font-size: 1rem;
  }
  /* Pagination */
  .search-pagination {
    padding: 24px 0 8px;
  }
  /* Auto-suggest dropdown — full width on mobile */
  .search-suggest {
    border-radius: 12px;
    max-height: 60vh;
  }
  .search-suggest__item {
    padding: 10px 12px;
    gap: 10px;
  }
  .search-suggest__img-wrap {
    width: 48px;
    height: 48px;
  }
  .search-suggest__title {
    font-size: 0.85rem;
  }
  .search-suggest__viewall {
    padding: 14px 12px;
    font-size: 0.8125rem;
  }
}

/* ============================================================
   REDESIGNED: ChatInboxPage, CommunityPage, NotificationsPage
   Modern clean design — no animations, no transforms, no hover effects
   Background: #f8fafc | Cards: white, border-radius:14px
   ============================================================ */

/* ─── CHAT INBOX — Professional Messaging Design ────── */

/* ════ Messaging hub (Chat | Gigs | Community tabs) ════ */
.msg-hub {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.msg-hub__tabs {
  display: flex;
  gap: 4px;
  /* Align the tab bar's left/right edges to the header (see --shell-width). */
  max-width: var(--shell-width);
  width: 100%;
  margin: 0 auto;
  padding: 10px 0 0;
  box-sizing: border-box;
}
.msg-hub__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  border-radius: 12px 12px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}
.msg-hub__tab:hover { color: #334155; background: rgba(99,102,241,0.06); }
.msg-hub__tab.is-active { color: var(--indigo); background: rgba(99,102,241,0.10); }
.msg-hub__tab.is-active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--indigo), var(--accent));
}
.msg-hub__tab svg { flex: 0 0 auto; }
.msg-hub__tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}
.msg-hub__body {
  /* Shared tab-panel container: all three tabs (Gigs/Chat/Community) render
     inside this, so a single rule controls their width AND height. */
  flex: none;
  /* Width: align left/right edges to the header (see --shell-width). */
  width: 100%;
  max-width: var(--shell-width);
  margin: 0 auto;
  box-sizing: border-box;
  /* Height: the Gigs tab is the reference — every tab uses this explicit,
     definite height so inner panes can fill via height:100% and switching
     tabs never resizes/jumps the page. */
  height: var(--msg-hub-height);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  /* Clip embedded chat surfaces (gigs/community/chat) so a long message list
     scrolls inside its own pane instead of stretching the hub body. */
  overflow: hidden;
}
.msg-hub__body--community { overflow: hidden; }
/* Every tab's top-level surface fills the shared body AND gets an IDENTICAL
   inner inset (--msg-hub-pad). The body is the single source of width+height;
   this rule is the single source of the inner gutter — so the left panel's left
   edge and the right panel's right edge are pixel-identical across all three
   tabs and switching tabs causes zero horizontal shift. */
.msg-hub__body > .gwc,
.msg-hub__body > .commchat,
.msg-hub__body > .chat-inbox {
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: none;   /* body already caps width to --shell-width */
  margin: 0;
  padding: var(--msg-hub-pad);
  box-sizing: border-box;
}
/* Inner card layouts fill the padded surface so all three show the SAME rounded
   card fully (fixes the Chat "flush / no card" look and Community's clipped card). */
.msg-hub__body .chat-inbox__layout,
.msg-hub__body .commchat__layout {
  height: 100%;
  min-height: 0;
}
@media (max-width: 768px) {
  /* Bound the whole hub to the space below the header and above the bottom
     tab-bar (48px header + 56px bottom-tabs). The tab bar keeps its natural
     height and the body FLEXES to fill whatever is left — previously the body
     claimed the full area itself, ignoring the ~50px tab bar above it, so it
     overflowed and pushed the chat composer under the bottom navigation. */
  .msg-hub {
    height: calc(100dvh - 48px - 56px);
    min-height: 0;
  }
  .msg-hub__body {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-width: none;
  }
  /* Edge-to-edge on phones: drop the shared inner gutter so all three tabs stay
     consistent and full-bleed (matches the intentional mobile chat design). */
  .msg-hub__body > .gwc,
  .msg-hub__body > .commchat,
  .msg-hub__body > .chat-inbox {
    padding: 0;
  }
}
@media (max-width: 640px) {
  /* Keep the hub tabs full-bleed and evenly shared so the bar reads as a proper
     segmented control (icon + label) rather than three stranded icons. */
  .msg-hub__tabs { padding: 8px 8px 0; gap: 2px; }
  .msg-hub__tab {
    flex: 1 1 0;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    font-size: 0.82rem;
    min-width: 0;
  }
  .msg-hub__tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 360px) {
  /* Only drop labels when there is genuinely no room. */
  .msg-hub__tab span { display: none; }
}

/* ============================================================
   Community group chat (WhatsApp-style) — Messages → Community
   ============================================================ */
.commchat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 8px 16px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
}
.commchat__layout {
  display: flex;
  height: calc(100vh - 150px);
  min-height: 420px;
  border-radius: 20px;
  border: 1px solid rgba(226,232,240,0.7);
  box-shadow: 0 8px 40px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.03);
  overflow: hidden;
  background: #fff;
}

/* ---- Sidebar ---- */
.commchat__sidebar {
  width: var(--msg-sidebar-width);
  flex: 0 0 var(--msg-sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--msg-border);
  background: var(--msg-sidebar-bg);
}
.commchat__sidebar-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--msg-border); }
.commchat__sidebar-title { margin: 0 0 12px; font-size: 1.15rem; font-weight: 800; color: var(--msg-ink); }
.commchat__search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--msg-panel-bg);
  border: 1px solid var(--msg-border);
  border-radius: var(--msg-radius);
  padding: 8px 12px;
  color: var(--msg-muted);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.commchat__search:focus-within {
  border-color: var(--msg-accent);
  box-shadow: 0 0 0 3px var(--msg-item-hover);
}
.commchat__search input { flex: 1; border: none; outline: none; background: transparent; font-size: 0.9rem; color: var(--msg-ink); }
.commchat__list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }

/* Sidebar loading skeleton — keeps the shell mounted while communities load */
.commchat-skel { display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.commchat-skel__item { display: flex; align-items: center; gap: 12px; padding: 10px; }
.commchat-skel__avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.commchat-skel__lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.commchat-skel__line { height: 10px; border-radius: 6px; }
.commchat-skel__line--top { width: 62%; }
.commchat-skel__line--sub { width: 88%; height: 8px; }
.commchat-skel__pulse {
  background: linear-gradient(90deg, #eef1f6 25%, #e2e7ef 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: commchatSkel 1.4s ease infinite;
}
@keyframes commchatSkel {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .commchat-skel__pulse { animation: none; }
}
.commchat__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.commchat__item:hover { background: var(--msg-item-hover); }
.commchat__item.is-active { background: var(--msg-item-active); }
.commchat__avatar {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25);
}
.commchat__avatar--sm { width: 38px; height: 38px; font-size: 0.95rem; }
.commchat__item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.commchat__item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.commchat__item-name { font-weight: 700; color: #0f172a; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.commchat__item-time { flex: 0 0 auto; font-size: 0.72rem; color: #94a3b8; }
.commchat__item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.commchat__item-preview { font-size: 0.82rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.commchat__item-muted { color: #94a3b8; font-style: normal; }
.commchat__badge {
  flex: 0 0 auto;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #22c55e;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.commchat__no-results { padding: 20px; text-align: center; color: #94a3b8; font-size: 0.85rem; }

/* ---- Conversation panel ---- */
.commchat__panel { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; background: #f6f7fb; }
.commchat__placeholder {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #64748b; gap: 6px; padding: 24px;
}
.commchat__placeholder-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(99,102,241,0.1); color: var(--indigo-light); margin-bottom: 6px;
}
.commchat__placeholder h3 { margin: 0; color: #0f172a; }
.commchat__placeholder p { margin: 0; font-size: 0.9rem; max-width: 320px; }

.commchat__header {
  display: flex; align-items: center; gap: 12px;
  padding: var(--msg-header-pad);
  min-height: var(--msg-header-min-h);
  background: var(--msg-panel-bg);
  border-bottom: 1px solid var(--msg-border);
}
.commchat__back { display: none; border: none; background: transparent; color: var(--msg-icon-ink); cursor: pointer; padding: 6px; border-radius: 8px; }
.commchat__back:hover { background: var(--msg-icon-bg); }
.commchat__header-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.commchat__header-name { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--msg-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.commchat__header-sub { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--msg-muted); }

.commchat__banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 0.85rem;
}
.commchat__banner--warning { background: #fffbeb; color: #92400e; border-bottom: 1px solid #fde68a; }
.commchat__banner--success { background: #ecfdf5; color: #065f46; border-bottom: 1px solid #a7f3d0; }
.commchat__banner-text { flex: 1; }
.commchat__banner button { border: none; background: transparent; cursor: pointer; font-size: 1.1rem; line-height: 1; color: inherit; opacity: 0.7; }

.commchat__messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 2px;
  background:
    radial-gradient(circle at 20% 10%, rgba(99,102,241,0.04), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(124,58,237,0.04), transparent 40%),
    #f6f7fb;
}
.commchat__empty-msgs { margin: auto; text-align: center; color: #94a3b8; }
.commchat__empty-msgs p { margin: 0 0 4px; font-weight: 700; color: #64748b; }
.commchat__empty-msgs span { font-size: 0.85rem; }

.commchat__day { display: flex; justify-content: center; margin: 12px 0 8px; }
.commchat__day span {
  background: rgba(15,23,42,0.06); color: #475569;
  font-size: 0.72rem; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
}

.commchat__row { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; }
.commchat__row--mine { flex-direction: row-reverse; }
.commchat__msg-avatar { flex: 0 0 auto; width: 28px; height: 28px; }
.commchat__msg-avatar img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.commchat__bubble {
  position: relative;
  max-width: min(72%, 520px);
  padding: 7px 11px 5px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(15,23,42,0.06);
  border-top-left-radius: 4px;
}
.commchat__bubble--mine {
  background: #dcf8c6;
  border-top-left-radius: 14px;
  border-top-right-radius: 4px;
}
.commchat__bubble--pending { opacity: 0.75; outline: 1px dashed #fbbf24; }
.commchat__sender { display: block; font-size: 0.78rem; font-weight: 800; margin-bottom: 2px; }
.commchat__text { margin: 0; font-size: 0.9rem; line-height: 1.4; color: #0f172a; white-space: pre-wrap; word-break: break-word; }
.commchat__atts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.commchat__att-img {
  max-width: 220px; max-height: 240px;
  border-radius: 10px; cursor: pointer; object-fit: cover;
  display: block;
}
.commchat__meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 2px; }
.commchat__time { font-size: 0.68rem; color: #94a3b8; }
.commchat__pending-tag { font-size: 0.66rem; font-weight: 700; color: #b45309; }

/* Hover toolbar: react · reply · more (top-right of each bubble) */
.commchat__msg-tools {
  position: absolute; top: 2px; right: 4px; z-index: 2;
  display: flex; align-items: center; gap: 2px;
  opacity: 0; transition: opacity 0.12s ease;
  background: rgba(255,255,255,0.82); border-radius: 8px; padding: 1px;
  box-shadow: 0 1px 4px rgba(15,23,42,0.1);
}
.commchat__bubble--mine .commchat__msg-tools { right: auto; left: 4px; background: rgba(220,248,198,0.9); }
.commchat__bubble:hover .commchat__msg-tools,
.commchat__msg-tools:focus-within { opacity: 1; }
.commchat__tool-btn {
  border: none; background: transparent; border-radius: 6px; cursor: pointer;
  color: #475569; padding: 2px 3px; display: inline-flex; align-items: center;
}
.commchat__tool-btn:hover { background: rgba(15,23,42,0.06); color: #0f172a; }
.commchat__msg-menu-wrap { position: relative; display: inline-flex; }
.commchat__menu-backdrop { position: fixed; inset: 0; z-index: 40; }

/* Quoted reply preview inside a bubble */
.commchat__quote {
  display: flex; flex-direction: column; gap: 1px;
  border-left: 3px solid #25d366; background: rgba(37,211,102,0.08);
  border-radius: 6px; padding: 3px 8px; margin-bottom: 4px; max-width: 100%;
}
.commchat__bubble--mine .commchat__quote { background: rgba(15,23,42,0.05); border-left-color: #0ea5e9; }
.commchat__quote-author { font-size: 0.72rem; font-weight: 800; color: #0f766e; }
.commchat__bubble--mine .commchat__quote-author { color: #0369a1; }
.commchat__quote-body {
  font-size: 0.78rem; color: #475569;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}

/* Emoji reactions */
.commchat__reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.commchat__reaction {
  display: inline-flex; align-items: center; gap: 3px;
  border: 1px solid #e2e8f0; background: #fff; border-radius: 999px;
  padding: 1px 7px 1px 5px; cursor: pointer; font-size: 0.75rem; line-height: 1.4;
}
.commchat__reaction.is-mine { background: #e0f2fe; border-color: #7dd3fc; }
.commchat__reaction-emoji { font-size: 0.85rem; }
.commchat__reaction-count { font-weight: 700; color: #475569; }
.commchat__react-bar {
  position: absolute; bottom: 100%; right: 0; z-index: 41; margin-bottom: 4px;
  display: flex; gap: 2px; padding: 4px 6px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 999px;
  box-shadow: 0 8px 28px rgba(15,23,42,0.18);
}
.commchat__bubble--mine .commchat__react-bar { right: auto; left: 0; }
.commchat__react-pick {
  border: none; background: transparent; cursor: pointer;
  font-size: 1.15rem; line-height: 1; padding: 3px 4px; border-radius: 8px;
  transition: transform 0.1s ease, background 0.1s ease;
}
.commchat__react-pick:hover { transform: scale(1.25); background: #f1f5f9; }
.commchat__react-pick.is-mine { background: #e0f2fe; }

/* Reply context above composer */
.commchat__reply-ctx {
  display: flex; align-items: center; gap: 8px;
  background: #f1f5f9; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px;
}
.commchat__reply-ctx-bar { width: 3px; align-self: stretch; border-radius: 3px; background: #25d366; }
.commchat__reply-ctx-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.commchat__reply-ctx-author { font-size: 0.74rem; font-weight: 800; color: #0f766e; }
.commchat__reply-ctx-text {
  font-size: 0.8rem; color: #475569;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.commchat__reply-ctx-close {
  border: none; background: transparent; cursor: pointer;
  font-size: 1.25rem; line-height: 1; color: #64748b; padding: 0 4px;
}
.commchat__msg-menu {
  position: absolute; top: 22px; right: 0; z-index: 41;
  list-style: none; margin: 0; padding: 4px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15,23,42,0.16); min-width: 150px;
}
.commchat__bubble--mine .commchat__msg-menu { right: auto; left: 0; }
.commchat__msg-menu button {
  width: 100%; text-align: left; border: none; background: transparent;
  padding: 8px 10px; border-radius: 7px; cursor: pointer;
  font-size: 0.85rem; color: #334155; font-weight: 600; white-space: nowrap;
}
.commchat__msg-menu button:hover { background: #f1f5f9; }
.commchat__msg-menu .commchat__menu-danger { color: #b91c1c; }
.commchat__msg-menu .commchat__menu-danger:hover { background: #fef2f2; }

/* Clickable member identity → profile */
.commchat__sender--link {
  display: inline-block; border: none; background: none; padding: 0;
  cursor: pointer; font: inherit; font-size: 0.78rem; font-weight: 800;
  margin-bottom: 2px; text-align: left;
}
.commchat__sender--link:hover { text-decoration: underline; }
.commchat__msg-avatar-link { cursor: pointer; }
.commchat__msg-avatar-initial {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.78rem; line-height: 1;
  text-transform: uppercase; user-select: none;
}
.comm__mention--link {
  border: none; background: none; padding: 0; cursor: pointer; font: inherit;
}
.comm__mention--link:hover { text-decoration: underline; }

/* ---- Composer ---- */
.commchat__composer { padding: 10px 14px; background: var(--msg-panel-bg); border-top: 1px solid var(--msg-border); }
.commchat__staged {
  position: relative; display: inline-block; margin-bottom: 8px;
}
.commchat__staged img { max-height: 90px; border-radius: 10px; display: block; }
.commchat__staged button {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #ef4444; color: #fff; cursor: pointer;
  font-size: 1rem; line-height: 1;
}
.commchat__composer-row { display: flex; align-items: flex-end; gap: 8px; }
.commchat__attach-btn, .commchat__send {
  flex: 0 0 auto;
  width: var(--msg-input-height); height: var(--msg-input-height);
  border-radius: 50%;
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.commchat__attach-btn { background: var(--msg-icon-bg); color: var(--msg-icon-ink); }
.commchat__attach-btn:hover { background: var(--msg-border); color: var(--msg-ink); }
.commchat__attach-btn:focus-visible, .commchat__send:focus-visible {
  outline: 2px solid var(--msg-accent); outline-offset: 2px;
}
.commchat__send { background: linear-gradient(135deg, var(--indigo), var(--accent)); color: #fff; }
.commchat__send:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }
.commchat__send:disabled { opacity: 0.5; cursor: not-allowed; }
.commchat__input, .commchat .comm__mention-wrap { flex: 1; min-width: 0; }
.commchat__input {
  width: 100%; box-sizing: border-box;
  resize: none;
  border: 1px solid var(--msg-border); border-radius: 999px;
  padding: 11px 16px; font-size: 0.9rem; outline: none;
  background: var(--mk-surface); color: var(--msg-ink);
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.commchat__input:focus { border-color: var(--msg-accent); background: #fff; box-shadow: 0 0 0 3px var(--msg-item-hover); }
/* The composer sits at the bottom of the panel, so the @mention suggestion
   menu must open upward instead of downward (where it would be clipped). */
.commchat__composer .comm__mention-menu { top: auto; bottom: calc(100% + 6px); }

/* "Load earlier messages" affordance at the top of the message list. */
.commchat__older { display: flex; justify-content: center; padding: 6px 0 10px; }
.commchat__older-btn {
  border: 1px solid #e2e8f0; background: #fff; color: #4338ca;
  font-size: 0.8rem; font-weight: 600; padding: 6px 14px;
  border-radius: 999px; cursor: pointer;
}
.commchat__older-btn:hover { background: #eef2ff; }
.commchat__older-spin { font-size: 0.8rem; color: #94a3b8; }

/* ---- Report modal ---- */
.commchat__modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,0.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.commchat__modal {
  background: #fff; border-radius: 18px; padding: 22px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 60px rgba(15,23,42,0.3);
}
.commchat__modal h4 { margin: 0 0 4px; font-size: 1.1rem; color: #0f172a; }
.commchat__modal-sub { margin: 0 0 14px; font-size: 0.86rem; color: #64748b; }
.commchat__modal-done { margin: 8px 0; color: #065f46; font-weight: 600; }
.commchat__reasons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.commchat__reason {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 12px; cursor: pointer;
  font-size: 0.88rem; color: #334155;
}
.commchat__reason.is-active { border-color: var(--indigo-light); background: rgba(99,102,241,0.06); }
.commchat__modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.commchat__btn-ghost, .commchat__btn-danger {
  border-radius: 10px; padding: 9px 16px; font-weight: 700; cursor: pointer; font-size: 0.88rem; border: none;
}
.commchat__btn-ghost { background: #f1f5f9; color: #475569; }
.commchat__btn-danger { background: #ef4444; color: #fff; }
.commchat__btn-danger:disabled, .commchat__btn-ghost:disabled { opacity: 0.6; cursor: not-allowed; }

/* "Who reacted" details modal */
.commchat__reactors-modal { max-width: 380px; padding: 18px 18px 10px; }
.commchat__reactors-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.commchat__reactors-head h4 { margin: 0; }
.commchat__reactors-close {
  border: none; background: transparent; font-size: 1.5rem; line-height: 1;
  color: #94a3b8; cursor: pointer; padding: 0 4px;
}
.commchat__reactors-close:hover { color: #475569; }
.commchat__reactors-list {
  list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto;
}
.commchat__reactor {
  display: flex; align-items: center; gap: 12px; padding: 9px 4px;
  border-bottom: 1px solid #f1f5f9;
}
.commchat__reactor:last-child { border-bottom: none; }
.commchat__reactor-avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  background: #e2e8f0;
}
.commchat__reactor-avatar--initial {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.95rem; line-height: 1;
  text-transform: uppercase; user-select: none;
}
.commchat__reactor-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.commchat__reactor-name { font-weight: 600; font-size: 0.9rem; color: #0f172a; }
.commchat__reactor-time { font-size: 0.76rem; color: #94a3b8; }
.commchat__reactor-emoji { font-size: 1.25rem; flex: 0 0 auto; }

@media (max-width: 768px) {
  .commchat { padding: 0; }
  .commchat__layout {
    border-radius: 0;
    border: none;
    height: calc(100dvh - 48px - 56px);   /* 48px header + 56px bottom-tabs */
    min-height: 0;
  }
  .commchat__sidebar { width: 100%; flex-basis: 100%; }
  .commchat__sidebar--hidden-mobile { display: none; }
  .commchat__back { display: inline-flex; }
  .commchat__bubble { max-width: 82%; }
}

.chat-inbox {
  padding: 8px 16px;
  background: transparent;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.chat-inbox__layout {
  display: flex;
  height: calc(100vh - 150px);
  min-height: 420px;
  border-radius: 20px;
  border: 1px solid rgba(226,232,240,0.7);
  box-shadow: 0 8px 40px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.03);
  overflow: hidden;
  background: #fff;
}

/* ════ Sidebar ═══════════════════════════ */

.chat-inbox__sidebar {
  width: var(--msg-sidebar-width);
  flex: 0 0 var(--msg-sidebar-width);
  border-right: 1px solid var(--msg-border);
  display: flex;
  flex-direction: column;
  background: var(--msg-sidebar-bg);
  flex-shrink: 0;
}

.chat-inbox__sidebar-header {
  padding: 16px 16px 12px;
  background: var(--msg-sidebar-bg);
  border-bottom: 1px solid var(--msg-border);
  flex-shrink: 0;
}

.chat-inbox__sidebar-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.chat-inbox__title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--msg-ink);
  letter-spacing: -0.02em;
  flex: 1;
}

.chat-inbox__unread-pill {
  background: var(--msg-item-active);
  color: var(--msg-accent);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  line-height: 1.5;
}

.chat-inbox__new-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: var(--msg-icon-bg);
  color: var(--msg-icon-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.chat-inbox__new-btn:hover {
  background: var(--msg-accent);
  color: #fff;
}

/* Search */
.chat-inbox__search {
  position: relative;
  display: flex;
  align-items: center;
}

.chat-inbox__search-icon {
  position: absolute;
  left: 12px;
  color: var(--msg-muted);
  display: flex;
  pointer-events: none;
}

.chat-inbox__search-input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 38px;
  border: 1px solid var(--msg-border);
  border-radius: var(--msg-radius);
  background: var(--msg-panel-bg);
  color: var(--msg-ink);
  font: inherit;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-inbox__search-input::placeholder {
  color: var(--msg-muted);
}
.chat-inbox__search-input:focus {
  border-color: var(--msg-accent);
  box-shadow: 0 0 0 3px var(--msg-item-hover);
}

.chat-inbox__search-clear {
  position: absolute;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: var(--msg-icon-bg);
  color: var(--msg-muted);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.chat-inbox__search-clear:hover {
  background: var(--msg-border);
  color: var(--msg-ink);
}

/* Empty sidebar state */
.chat-inbox__empty-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  gap: 8px;
}
.chat-inbox__empty-sidebar-icon {
  margin-bottom: 8px;
  opacity: 0.5;
}
.chat-inbox__empty-sidebar h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
  margin: 0;
}
.chat-inbox__empty-sidebar p {
  font-size: 0.82rem;
  color: var(--mk-text-muted);
  margin: 0;
  max-width: 240px;
  line-height: 1.5;
}
.chat-inbox__empty-sidebar-btn {
  margin-top: 12px;
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-inbox__empty-sidebar-btn:hover {
  background: var(--primary-dark);
}
.chat-inbox__no-results {
  font-size: 0.82rem;
  color: var(--mk-text-muted);
  margin: 0;
}

/* Thread list */
.chat-inbox__thread-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--mk-border) transparent;
  -webkit-overflow-scrolling: touch;
}

/* Thread item */
.chat-inbox__thread {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s ease;
  position: relative;
}
.chat-inbox__thread::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 72px;
  right: 20px;
  height: 1px;
  background: var(--mk-surface-light);
}

.chat-inbox__thread:hover {
  background: var(--msg-item-hover);
}

.chat-inbox__thread.is-active {
  background: var(--msg-item-active);
}
.chat-inbox__thread.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--msg-accent);
}

.chat-inbox__thread.has-unread .chat-inbox__thread-name {
  font-weight: 700;
  color: #0f172a;
}
.chat-inbox__thread.has-unread .chat-inbox__thread-preview {
  color: #475569;
  font-weight: 500;
}

/* Thread avatar with online dot */
.chat-inbox__thread-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-inbox__thread-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--mk-surface-light);
}

.chat-inbox__online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

.chat-inbox__thread-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-inbox__thread-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-inbox__thread-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-inbox__thread-time {
  font-size: 0.7rem;
  color: var(--mk-text-muted);
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}
.chat-inbox__thread.has-unread .chat-inbox__thread-time {
  color: var(--primary);
  font-weight: 600;
}

.chat-inbox__thread-bottom-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-inbox__thread-preview {
  flex: 1;
  font-size: 0.8rem;
  color: var(--mk-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-inbox__thread-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
  line-height: 1.5;
  flex-shrink: 0;
}

/* ════ Main chat area ════════════════════ */

.chat-inbox__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--mk-surface);
}

.chat-inbox__main--empty {
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--mk-surface) 0%, var(--mk-surface-light) 100%);
}

.chat-inbox__main--dragover {
  outline: 2px dashed var(--primary);
  outline-offset: -4px;
}

/* Empty main state */
.chat-inbox__empty-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px;
  text-align: center;
}

.chat-inbox__empty-main-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--mk-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.chat-inbox__empty-main-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #334155;
  margin: 0;
}

.chat-inbox__empty-main-body {
  font-size: 0.875rem;
  color: var(--mk-text-muted);
  margin: 0;
  max-width: 300px;
  line-height: 1.6;
}

.chat-inbox__empty-main-btn {
  margin-top: 8px;
  padding: 12px 28px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.chat-inbox__empty-main-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ════ Chat Header ═══════════════════════ */

.chat-inbox__main-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--msg-header-pad);
  border-bottom: 1px solid var(--msg-border);
  background: var(--msg-panel-bg);
  flex-shrink: 0;
  min-height: var(--msg-header-min-h);
}

/* 8.7 Conversation-Driven Deal — stage pipeline bar + smart suggestions */
.chat-inbox__deal-bar {
  display: flex;
  align-items: center;
  padding: 8px 20px;
  background: #fafbff;
  border-bottom: 1px solid var(--mk-surface-light);
  flex-shrink: 0;
  overflow-x: auto;
}
.chat-inbox__deal-stages {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-inbox__deal-step {
  position: relative;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.1s;
}
.chat-inbox__deal-step:not(:first-child) { margin-left: 6px; }
.chat-inbox__deal-step:not(:first-child)::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 50%;
  width: 6px;
  height: 2px;
  background: #e2e8f0;
  transform: translateY(-50%);
}
.chat-inbox__deal-step.is-current { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12); transform: translateY(-1px); }
.chat-inbox__deal-step:disabled { cursor: default; opacity: 0.7; }
.chat-inbox__deal-step:focus-visible { outline: 2px solid var(--mk-accent, var(--primary)); outline-offset: 2px; }

.chat-inbox__deal-suggest {
  padding: 8px 16px;
  border-top: 1px solid var(--mk-surface-light);
  background: #fff;
  flex-shrink: 0;
}
.chat-inbox__deal-notice {
  font-size: 12.5px;
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
}
.chat-inbox__deal-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.chat-inbox__deal-chips-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.chat-inbox__deal-chip {
  border: 1px solid var(--mk-accent, var(--primary));
  background: var(--mk-accent, var(--primary));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.chat-inbox__deal-chip:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.chat-inbox__deal-chip:disabled { opacity: 0.6; cursor: default; }
.chat-inbox__deal-chip:focus-visible { outline: 2px solid var(--mk-accent, var(--primary)); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .chat-inbox__deal-step, .chat-inbox__deal-chip { transition: none; }
}

.chat-inbox__back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--mk-surface-light);
  color: #475569;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s;
}
.chat-inbox__back-btn:hover {
  background: var(--mk-border);
}

.chat-inbox__header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--msg-border);
  flex-shrink: 0;
}

.chat-inbox__header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-inbox__header-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--msg-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-inbox__header-status {
  font-size: 0.78rem;
  color: var(--msg-muted);
  font-weight: 500;
  text-transform: capitalize;
}
.chat-inbox__header-status.is-online {
  color: #22c55e;
}

.chat-inbox__call-buttons {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.chat-inbox__call-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: var(--msg-icon-bg);
  color: var(--msg-icon-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.chat-inbox__call-btn:hover {
  background: var(--msg-accent);
  color: #fff;
}
.chat-inbox__call-btn:focus-visible {
  outline: 2px solid var(--msg-accent);
  outline-offset: 2px;
}
.chat-inbox__call-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ════ Conversation header kebab menu ═════ */

.chat-inbox__conv-menu {
  position: relative;
  margin-left: 6px;
  flex-shrink: 0;
}
/* When no call buttons render, push the kebab to the far right. */
.chat-inbox__call-buttons + .chat-inbox__conv-menu { margin-left: 6px; }
.chat-inbox__main-header > .chat-inbox__conv-menu { margin-left: auto; }

.chat-inbox__conv-menu-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: var(--mk-surface-light);
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.chat-inbox__conv-menu-btn:hover { background: #e2e8f0; color: #1e293b; }

.chat-inbox__conv-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 184px;
  background: #fff;
  border: 1px solid var(--mk-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: chatConvMenuIn 0.12s ease-out;
}
@keyframes chatConvMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-inbox__conv-dropdown { animation: none; }
}

.chat-inbox__conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.chat-inbox__conv-item:hover:not(:disabled) { background: var(--mk-surface-light); }
.chat-inbox__conv-item:disabled { opacity: 0.5; cursor: default; }
.chat-inbox__conv-item svg { flex-shrink: 0; color: #64748b; }
.chat-inbox__conv-item--danger { color: #dc2626; }
.chat-inbox__conv-item--danger svg { color: #dc2626; }
.chat-inbox__conv-item--danger:hover:not(:disabled) { background: #fef2f2; }

.chat-inbox__conv-notice {
  padding: 8px 20px;
  background: #eff6ff;
  color: var(--primary-dark);
  font-size: 13px;
  border-bottom: 1px solid #dbeafe;
}

.chat-report-modal--confirm { max-width: 420px; }

/* ════ Messages area ═════════════════════ */

.chat-inbox__messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--mk-surface);
  scrollbar-width: thin;
  scrollbar-color: var(--mk-border) transparent;
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}

/* Virtualization: skip rendering of off-screen messages for 500+ message perf */
.chat-msg-virtual {
  content-visibility: auto;
  contain-intrinsic-size: auto 60px;
}
.chat-inbox__messages::before {
  content: '';
  margin-top: auto;
}

.chat-inbox__no-messages {
  text-align: center;
  color: var(--mk-text-muted);
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.chat-inbox__no-messages-icon { opacity: 0.6; }
.chat-inbox__no-messages h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #475569;
  margin: 0;
}
.chat-inbox__no-messages p {
  font-size: 0.82rem;
  margin: 0;
  color: var(--mk-text-muted);
}

/* Date separator */
.chat-inbox__date-sep {
  display: flex;
  justify-content: center;
  padding: 14px 0;
}
.chat-inbox__date-sep-text {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--mk-text-secondary);
  background: #fff;
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--mk-surface-light);
}

/* Message bubbles */
.chat-inbox__msg {
  display: flex;
  justify-content: flex-start;
  max-width: 100%;
  animation: chatMsgIn 0.25s ease-out;
}

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-inbox__msg--mine {
  justify-content: flex-end;
}

.chat-inbox__msg-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 18px 18px 18px 6px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  font-size: 0.875rem;
  color: #1e293b;
  line-height: 1.55;
  position: relative;
  border: 1px solid var(--mk-surface-light);
}

.chat-inbox__msg--mine .chat-inbox__msg-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 2px 10px rgba(37,99,235,0.2);
  border: none;
}

.chat-inbox__msg-bubble p {
  margin: 0 0 4px;
  word-break: break-word;
}
.chat-inbox__msg-bubble p:last-child { margin-bottom: 0; }

.chat-inbox__msg-time {
  display: block;
  font-size: 0.6rem;
  color: var(--mk-text-muted);
  margin-top: 4px;
  text-align: right;
}
.chat-inbox__msg--mine .chat-inbox__msg-time {
  color: rgba(255,255,255,0.55);
}

/* Read receipts: footer row holding the time + tick indicator */
.chat-inbox__msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
}
.chat-inbox__msg-meta .chat-inbox__msg-time {
  display: inline;
  margin-top: 0;
}
.chat-inbox__msg-receipt {
  display: inline-flex;
  align-items: center;
  color: rgba(255,255,255,0.55);
  line-height: 0;
}
.chat-inbox__msg-receipt--seen {
  color: #4fc3f7; /* WhatsApp-style blue "seen" tick */
}

/* Media in messages */
.chat-inbox__msg-image-wrap {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  margin: -10px -14px -4px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}
.chat-inbox__msg-image-wrap:only-child {
  margin-bottom: -10px;
  border-radius: 16px;
}
.chat-inbox__msg-bubble:has(.chat-inbox__msg-image-wrap) {
  padding-bottom: 4px;
}
.chat-inbox__msg-image {
  width: 100%;
  max-width: 180px;
  max-height: 140px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}
.chat-inbox__msg-caption {
  padding: 6px 14px 2px;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
}
.chat-inbox__msg-media {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-inbox__msg-media audio,
.chat-inbox__msg-media video {
  max-width: 240px;
  border-radius: 8px;
}
.chat-inbox__msg-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--mk-surface-light);
  text-decoration: none;
  color: inherit;
  font-size: 0.8rem;
  transition: background 0.15s;
}
.chat-inbox__msg-doc:hover { background: var(--mk-border); }
.chat-inbox__msg--mine .chat-inbox__msg-doc {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.chat-inbox__msg-doc-icon { font-size: 1.3rem; flex-shrink: 0; }
.chat-inbox__msg-doc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.chat-inbox__msg-doc-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  display: block;
}
.chat-inbox__msg-doc-type { font-size: 0.7rem; opacity: 0.7; }

/* Deleted message */
.chat-inbox__msg-bubble.chat-inbox__msg-bubble--deleted {
  background: var(--mk-surface-light);
  border: 1px dashed #cbd5e1;
  opacity: 0.85;
}
.chat-inbox__msg--mine .chat-inbox__msg-bubble.chat-inbox__msg-bubble--deleted {
  background: #e8edf3;
  border-color: #b0bec5;
}
.chat-inbox__msg-deleted-text {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--mk-text-secondary);
  margin: 0;
}
.chat-inbox__msg--mine .chat-inbox__msg-deleted-text {
  color: var(--mk-text-secondary);
}
.chat-inbox__msg-deleted-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-inbox__msg-dismiss-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  font-size: 0.7rem;
  color: var(--mk-text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.chat-inbox__msg-dismiss-btn:hover {
  background: rgba(0,0,0,0.06);
  color: #ef4444;
}

/* Message menu button (three dots) */
.chat-inbox__msg-bubble {
  position: relative;
}
.chat-inbox__msg-menu-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 10;
  background: rgba(255,255,255,0.85);
  border: none;
  padding: 3px 5px;
  cursor: pointer;
  color: var(--mk-text-secondary);
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  line-height: 1;
  backdrop-filter: blur(4px);
}
.chat-inbox__msg-bubble:hover .chat-inbox__msg-menu-btn,
.chat-inbox__msg-menu-btn:focus-visible {
  opacity: 1;
}
.chat-inbox__msg-menu-btn:hover {
  background: rgba(0,0,0,0.06);
  color: #475569;
}
.chat-inbox__msg--mine .chat-inbox__msg-menu-btn {
  color: #1e40af;
  background: rgba(255,255,255,0.85);
  right: 4px;
}
.chat-inbox__msg--mine .chat-inbox__msg-menu-btn:hover {
  background: rgba(255,255,255,0.95);
  color: #1e3a8a;
}

/* Message context menu */
.chat-inbox__msg-context-menu {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--mk-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.08);
  padding: 4px;
  min-width: 170px;
  animation: chatMenuFadeIn 0.12s ease-out;
}
@keyframes chatMenuFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-inbox__msg-context-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: #334155;
  border-radius: 6px;
  transition: background 0.12s;
  text-align: left;
  white-space: nowrap;
}
.chat-inbox__msg-context-menu button:hover {
  background: var(--mk-surface-light);
}
.chat-inbox__msg-context-menu button:last-child {
  color: #dc2626;
}
.chat-inbox__msg-context-menu button:last-child:hover {
  background: #fef2f2;
}

/* ── 8.9.3 Report message modal ── */
.chat-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  padding: 16px;
  animation: chatReportFade 0.15s ease-out;
}
@keyframes chatReportFade { from { opacity: 0; } to { opacity: 1; } }
.chat-report-modal {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  padding: 20px;
  animation: chatReportPop 0.18s cubic-bezier(0.16,1,0.3,1);
}
@keyframes chatReportPop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.chat-report-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.chat-report-modal__title { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin: 0; }
.chat-report-modal__close {
  background: none; border: none; cursor: pointer; color: #64748b;
  padding: 4px; border-radius: 8px; display: inline-flex;
}
.chat-report-modal__close:hover { background: var(--mk-surface-light); color: #0f172a; }
.chat-report-modal__hint { font-size: 0.85rem; color: #64748b; margin: 0 0 14px; }
.chat-report-modal__done { font-size: 0.9rem; color: #0f172a; padding: 18px 4px; text-align: center; }
.chat-report-modal__reasons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.chat-report-modal__reason {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--mk-border);
  border-radius: 10px; cursor: pointer; font-size: 0.88rem; color: #334155;
  transition: border-color 0.12s, background 0.12s;
}
.chat-report-modal__reason:hover { background: var(--mk-surface-light); }
.chat-report-modal__reason.is-selected { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }
.chat-report-modal__reason input { accent-color: #dc2626; }
.chat-report-modal__note {
  width: 100%; min-height: 64px; resize: vertical;
  border: 1px solid var(--mk-border); border-radius: 10px;
  padding: 10px 12px; font-size: 0.88rem; font-family: inherit;
  margin-bottom: 14px; box-sizing: border-box;
}
.chat-report-modal__note:focus-visible { outline: 2px solid #dc2626; outline-offset: 1px; }
.chat-report-modal__actions { display: flex; justify-content: flex-end; gap: 8px; }
.chat-report-modal__btn {
  padding: 9px 16px; border-radius: 10px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: opacity 0.12s, background 0.12s;
}
.chat-report-modal__btn:disabled { opacity: 0.6; cursor: default; }
.chat-report-modal__btn--ghost { background: #fff; border-color: var(--mk-border); color: #334155; }
.chat-report-modal__btn--ghost:hover:not(:disabled) { background: var(--mk-surface-light); }
.chat-report-modal__btn--danger { background: #dc2626; color: #fff; }
.chat-report-modal__btn--danger:hover:not(:disabled) { background: #b91c1c; }
@media (prefers-reduced-motion: reduce) {
  .chat-report-overlay, .chat-report-modal { animation: none; }
}

/* ── Reply quote (inside a bubble) ───────────────────────────── */
.chat-inbox__reply-quote {
  display: flex; flex-direction: column; gap: 1px;
  border-left: 3px solid var(--mk-primary, var(--primary));
  background: rgba(37, 99, 235, 0.08);
  border-radius: 6px; padding: 5px 9px; margin-bottom: 6px;
  max-width: 100%; overflow: hidden;
}
.chat-inbox__msg--mine .chat-inbox__reply-quote {
  border-left-color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.18);
}
.chat-inbox__reply-quote-name {
  font-size: 0.74rem; font-weight: 700; color: var(--mk-primary, var(--primary));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-inbox__msg--mine .chat-inbox__reply-quote-name { color: #fff; }
.chat-inbox__reply-quote-text {
  font-size: 0.78rem; color: #475569;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px;
}
.chat-inbox__msg--mine .chat-inbox__reply-quote-text { color: rgba(255,255,255,0.85); }

/* ── Reaction chips (below a bubble) ─────────────────────────── */
.chat-inbox__reactions {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; cursor: pointer;
}
.chat-inbox__msg--mine .chat-inbox__reactions { justify-content: flex-end; }
.chat-inbox__reaction-chip {
  display: inline-flex; align-items: center; gap: 2px;
  background: #fff; border: 1px solid var(--mk-border, #e2e8f0);
  border-radius: 12px; padding: 1px 7px; font-size: 0.8rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06); transition: transform 0.12s;
}
.chat-inbox__reaction-chip:hover { transform: translateY(-1px); }
.chat-inbox__reaction-chip.is-mine { background: #eff6ff; border-color: var(--mk-primary, var(--primary)); }
.chat-inbox__reaction-emoji { line-height: 1; }
.chat-inbox__reaction-count { font-size: 0.72rem; font-weight: 600; color: #475569; }

/* ── React-emoji row inside the context menu ─────────────────── */
.chat-inbox__react-row {
  display: flex; gap: 2px; padding: 4px 4px 6px; margin-bottom: 4px;
  border-bottom: 1px solid var(--mk-surface-light, #f1f5f9);
}
.chat-inbox__react-emoji {
  background: none; border: none; cursor: pointer; font-size: 1.15rem;
  padding: 3px 5px; border-radius: 8px; line-height: 1; transition: transform 0.12s, background 0.12s;
}
.chat-inbox__react-emoji:hover { background: var(--mk-surface-light, #f1f5f9); transform: scale(1.18); }
.chat-inbox__react-emoji.is-mine { background: #eff6ff; }

/* ── Reply preview bar (above composer) ──────────────────────── */
.chat-inbox__reply-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; background: var(--mk-surface, #fff);
  border-top: 1px solid var(--mk-surface-light, #f1f5f9); flex-shrink: 0;
}
.chat-inbox__reply-preview-body {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
  border-left: 3px solid var(--mk-primary, var(--primary)); padding-left: 9px;
}
.chat-inbox__reply-preview-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.75rem; font-weight: 700; color: var(--mk-primary, var(--primary));
}
.chat-inbox__reply-preview-text {
  font-size: 0.8rem; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-inbox__reply-preview-cancel {
  background: none; border: none; cursor: pointer; color: #94a3b8;
  padding: 5px; border-radius: 8px; display: inline-flex; flex-shrink: 0;
}
.chat-inbox__reply-preview-cancel:hover { background: var(--mk-surface-light, #f1f5f9); color: #0f172a; }

/* ── Who-reacted modal ───────────────────────────────────────── */
.chat-reactors-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.chat-reactors-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; }
.chat-reactors-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.chat-reactors-avatar--initial {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.9rem;
}
.chat-reactors-name { flex: 1; min-width: 0; font-size: 0.9rem; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-reactors-emoji { font-size: 1.2rem; }

/* Typing indicator — sits BETWEEN messages area and compose bar */
.chat-inbox__typing {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  background: var(--mk-surface);
  border-top: 1px solid var(--mk-surface-light);
  flex-shrink: 0;
}
/* ── Loading older messages spinner ── */
.chat-inbox__load-older-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--mk-border);
  border-top-color: var(--primary-bright);
  border-radius: 50%;
  animation: chatLoadSpin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes chatLoadSpin {
  to { transform: rotate(360deg); }
}

.chat-inbox__typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border-radius: 18px;
  padding: 10px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid var(--mk-surface-light);
}
.chat-inbox__typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mk-text-muted);
  animation: chatTyping 1.2s ease-in-out infinite;
}
.chat-inbox__typing-dot:nth-child(2) { animation-delay: 0.15s; }
.chat-inbox__typing-dot:nth-child(3) { animation-delay: 0.3s; }

.chat-inbox__typing-text {
  font-size: 0.75rem;
  color: var(--mk-text-muted);
  margin-left: 8px;
  font-style: italic;
}

@keyframes chatTyping {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1.1); }
}

/* Sidebar typing indicator */
.chat-inbox__sidebar-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--indigo-light);
  font-size: 0.78rem;
  font-style: italic;
  font-weight: 500;
}
.chat-inbox__sidebar-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.chat-inbox__sidebar-typing-dots .chat-inbox__typing-dot {
  width: 5px;
  height: 5px;
  background: var(--indigo-light);
}

/* Online dot on thread avatar */
.chat-inbox__thread-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.chat-inbox__thread-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 2px solid #fff;
  border-radius: 50%;
}

/* File preview bar */
.chat-inbox__file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid var(--mk-surface-light);
  flex-shrink: 0;
}
.chat-inbox__file-preview-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--mk-border);
}
.chat-inbox__file-preview-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mk-surface-light);
  border-radius: 10px;
  font-size: 1.4rem;
}
.chat-inbox__file-preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-inbox__file-preview-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-inbox__file-preview-size {
  font-size: 0.7rem;
  color: var(--mk-text-muted);
}
.chat-inbox__file-preview-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #fef2f2;
  color: #ef4444;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chat-inbox__file-preview-remove:hover { background: #fee2e2; }

.chat-inbox__file-error {
  padding: 10px 20px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.8rem;
  border-top: 1px solid #fecaca;
  flex-shrink: 0;
}

/* ════ Compose bar ═══════════════════════ */

.chat-inbox__compose {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--msg-panel-bg);
  border-top: 1px solid var(--msg-border);
  flex-shrink: 0;
}
.chat-inbox__compose-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
}
/* Inline file chip (WhatsApp-style) */
.chat-inbox__file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #f0f9ff;
  border-bottom: 1px solid #e0f2fe;
  position: relative;
}
.chat-inbox__file-chip:has(.chat-inbox__file-chip-img) {
  padding: 6px 12px;
  gap: 0;
}
.chat-inbox__file-chip-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #bae6fd;
}
.chat-inbox__file-chip-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0f2fe;
  border-radius: 8px;
  font-size: 1.1rem;
}
.chat-inbox__file-chip-name {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: #0369a1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-inbox__file-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  margin-left: 8px;
}
.chat-inbox__file-chip-remove:hover {
  background: #ef4444;
  color: #fff;
}

.chat-inbox__file-input { display: none; }

.chat-inbox__compose-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--msg-input-height);
  height: var(--msg-input-height);
  border-radius: 50%;
  border: none;
  background: var(--msg-icon-bg);
  color: var(--msg-icon-ink);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.chat-inbox__compose-action:hover {
  background: var(--msg-border);
  color: var(--msg-ink);
}
.chat-inbox__compose-action:focus-visible {
  outline: 2px solid var(--msg-accent);
  outline-offset: 2px;
}

.chat-inbox__input-wrap {
  flex: 1;
  min-width: 0;
}

.chat-inbox__input {
  width: 100%;
  height: var(--msg-input-height);
  padding: 0 16px;
  border: 1px solid var(--msg-border);
  border-radius: 999px;
  background: var(--mk-surface);
  font: inherit;
  font-size: 0.9rem;
  color: var(--msg-ink);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.chat-inbox__input:focus {
  border-color: var(--msg-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--msg-item-hover);
}

.chat-inbox__send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--msg-input-height);
  height: var(--msg-input-height);
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--indigo), var(--accent));
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.chat-inbox__send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.chat-inbox__send-btn:focus-visible {
  outline: 2px solid var(--msg-accent);
  outline-offset: 2px;
}
.chat-inbox__send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-inbox__spinner {
  animation: seekiyo-spin 0.8s linear infinite;
}

/* Drop overlay */
.chat-inbox__drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(37,99,235,0.08);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.chat-inbox__drop-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 2px dashed var(--primary);
  border-radius: 20px;
  padding: 48px 56px;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 12px 40px rgba(37,99,235,0.12);
}
.chat-inbox__drop-overlay-inner p { margin: 0; }

/* ════ VoIP Call UI ══════════════════════ */

.chat-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: chatMsgIn 0.2s ease;
}

.chat-call-modal {
  background: #1e293b;
  border-radius: 24px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 280px;
  position: relative;
  overflow: hidden;
}
.chat-call-modal__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(59,130,246,0.15);
  animation: call-pulse 2s ease-in-out infinite;
}
/* Second expanding ripple ring */
.chat-call-modal__pulse::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 2px solid rgba(59,130,246,0.25);
  animation: call-ripple 2s ease-out infinite;
}
.chat-call-modal__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(59,130,246,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: call-ring 1.5s ease-in-out infinite;
  position: relative;
  z-index: 1;
  color: #fff;
}
.chat-call-modal__title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  position: relative;
  z-index: 1;
}
.chat-call-modal__subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  margin: 0;
  position: relative;
  z-index: 1;
}
.chat-call-modal__actions {
  display: flex;
  gap: 24px;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}
.chat-call-modal__btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  color: #fff;
}
.chat-call-modal__btn:hover { transform: scale(1.08); }
.chat-call-modal__btn--reject {
  background: #ef4444;
  box-shadow: 0 4px 16px rgba(239,68,68,0.4);
}
.chat-call-modal__btn--accept {
  background: #22c55e;
  box-shadow: 0 4px 16px rgba(34,197,94,0.4);
  animation: call-accept-glow 1.5s ease-in-out infinite;
}
.chat-call-modal__btn--accept:disabled { opacity: 0.5; cursor: default; animation: none; }

.chat-call-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
  background: linear-gradient(135deg, #1e3a8a, var(--primary));
  color: #fff;
  border-radius: 0 0 16px 16px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(37,99,235,0.35);
  min-width: 260px;
  animation: call-bar-in 0.3s ease;
}
.chat-call-bar__info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.chat-call-bar__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  animation: call-dot-blink 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
.chat-call-bar__label { font-size: 0.875rem; font-weight: 600; }
.chat-call-bar__timer {
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
.chat-call-bar__end {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.chat-call-bar__end:hover { background: #dc2626; }

@keyframes call-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.1; }
}
@keyframes call-ring {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(15deg); }
  20% { transform: rotate(-15deg); }
  30% { transform: rotate(12deg); }
  40% { transform: rotate(-10deg); }
  50% { transform: rotate(5deg); }
  60% { transform: rotate(0); }
}
@keyframes call-ripple {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes call-accept-glow {
  0%, 100% { box-shadow: 0 4px 16px rgba(34,197,94,0.4); }
  50% { box-shadow: 0 4px 24px rgba(34,197,94,0.7), 0 0 40px rgba(34,197,94,0.3); }
}
@keyframes call-bar-in {
  from { transform: translateX(-50%) translateY(-100%); }
  to { transform: translateX(-50%) translateY(0); }
}
@keyframes call-dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Incoming call modal avatar ── */
.chat-call-modal__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.2);
  position: relative;
  z-index: 1;
}

/* ── Full-screen Call Screen ── */
.chat-call-screen {
  position: fixed;
  inset: 0;
  z-index: 10003;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  animation: chatMsgIn 0.25s ease;
  overflow: hidden;
}
.chat-call-screen__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  z-index: 0;
}
.chat-call-screen__remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  background: #000;
}
.chat-call-screen__top {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 24px 16px;
  width: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}
.chat-call-screen__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
}
.chat-call-screen__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-call-screen__name {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}
.chat-call-screen__status {
  color: rgba(255,255,255,0.65);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-call-screen__rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(220,38,38,0.85);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  animation: rec-pulse 1.2s ease-in-out infinite;
}
.chat-call-screen__rec-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Center content for audio calls or ringing */
.chat-call-screen__center {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}
.chat-call-screen__center-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.15);
  box-shadow: 0 0 40px rgba(59,130,246,0.3);
}
.chat-call-screen__center-name {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 8px 0 0;
}
.chat-call-screen__center-status {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
  margin: 0;
}
.chat-call-screen__pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  border-radius: 50%;
  border: 2px solid rgba(59,130,246,0.3);
  animation: call-screen-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes call-screen-pulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(0.8); opacity: 0; }
}

/* Local video PIP */
.chat-call-screen__local-video-wrap {
  position: absolute;
  bottom: 120px;
  right: 20px;
  width: 140px;
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 10;
  background: #1e293b;
}
.chat-call-screen__local-video-wrap.is-cam-off {
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-call-screen__local-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.chat-call-screen__cam-off-label {
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  position: absolute;
}

/* Error */
.chat-call-screen__error {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(239,68,68,0.9);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.85rem;
  max-width: 90%;
  text-align: center;
}

/* Bottom controls */
.chat-call-screen__controls {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px 40px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  width: 100%;
  justify-content: center;
}
.chat-call-screen__ctrl-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  color: #fff;
  transition: background 0.15s, transform 0.12s;
  backdrop-filter: blur(8px);
}
.chat-call-screen__ctrl-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.06);
}
.chat-call-screen__ctrl-btn.is-active {
  background: rgba(239,68,68,0.7);
}
.chat-call-screen__ctrl-btn--end {
  width: 64px;
  height: 64px;
  background: #ef4444;
  box-shadow: 0 4px 20px rgba(239,68,68,0.5);
}
.chat-call-screen__ctrl-btn--end:hover {
  background: #dc2626;
  transform: scale(1.08);
}

/* Remote video mirrored when swapped (showing local feed) */
.chat-call-screen__remote-video.is-mirrored {
  transform: scaleX(-1);
}

/* Local PIP swap hint icon */
.chat-call-screen__swap-hint {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.chat-call-screen__local-video-wrap:hover .chat-call-screen__swap-hint {
  opacity: 1;
}
/* Make PIP clickable for swap */
.chat-call-screen__local-video-wrap {
  cursor: pointer;
}
/* When swapped, PIP shows remote video — remove mirror */
.chat-call-screen__local-video-wrap.is-swapped .chat-call-screen__local-video {
  transform: none;
}

/* ════ Responsive — Mobile ═══════════════ */

@media (max-width: 768px) {
  .chat-inbox {
    padding: 0;
  }
  .chat-inbox__layout {
    flex-direction: column;
    height: calc(100dvh - 48px - 56px);   /* 48px header + 56px bottom-tabs */
    min-height: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .chat-inbox__sidebar {
    width: 100%;
    min-width: unset;
    border-right: none;
    max-height: 100%;
  }
  .chat-inbox__sidebar-header {
    border-radius: 0;
  }
  .chat-inbox__sidebar--hidden-mobile {
    display: none;
  }
  .chat-inbox__main {
    flex: 1;
    min-height: 0;
  }
  .chat-inbox__back-btn {
    display: flex;
  }
  .chat-inbox__msg-bubble {
    max-width: 85%;
  }
  .chat-inbox__msg-image {
    max-width: 150px;
    max-height: 120px;
  }
  .chat-inbox__msg-menu-btn {
    opacity: 0.5;
  }
  .chat-inbox__messages {
    padding: 14px 12px 8px;
  }
  .chat-inbox__compose {
    flex-shrink: 0;
    background: #fff;
    border-top: 1px solid var(--mk-border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .chat-inbox__compose-row {
    padding: 8px 10px;
    gap: 6px;
  }
  .chat-inbox__compose-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
  }
  .chat-inbox__input {
    height: 38px;
    font-size: 1rem;
    border-radius: 19px;
    padding: 0 14px;
  }
  .chat-inbox__send-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
  }
  .chat-inbox__file-chip {
    padding: 6px 12px;
  }
  .chat-inbox__thread {
    padding: 12px 16px;
  }
  .chat-inbox__thread-avatar {
    width: 44px;
    height: 44px;
  }
  .chat-inbox__call-buttons {
    gap: 4px;
  }
  .chat-inbox__call-btn {
    width: 34px;
    height: 34px;
  }
}

@media (min-width: 769px) {
  .chat-inbox__back-btn {
    display: none;
  }
}

/* ════ Tablet tweaks ═════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .chat-inbox__sidebar {
    width: 300px;
    min-width: 280px;
  }
}


/* ==========================================================
   COMMUNITY PAGE  (comm__)
   ========================================================== */

/* Header card */
.comm__header-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 24px 28px 20px;
}

.comm__header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.comm__eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--indigo-light);
}

.comm__heading {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.comm__subtitle {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
}

.comm__saved-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.comm__saved-btn--active {
  background: var(--indigo-light);
  border-color: var(--indigo-light);
  color: #fff;
}

/* Panel (white card) */
.comm__panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 20px 22px;
}

.comm__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.comm__panel-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

/* Back button */
.comm__back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--indigo-light);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}
.comm__back-btn svg { flex-shrink: 0; }

/* Boards grid */
.comm__boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.comm__board-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 18px 20px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
}
.comm__board-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 2px 8px rgba(99,102,241,0.1);
}

.comm__board-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.comm__board-icon svg { width: 20px; height: 20px; }

.comm__board-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comm__board-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.comm__board-desc {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.comm__board-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.comm__board-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
}
.comm__board-stat svg { flex-shrink: 0; }

/* Board navigation */
.comm__board-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.comm__board-nav-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.comm__board-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comm__board-location {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.comm__new-post-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 18px;
  border-radius: 8px;
  background: var(--indigo-light);
  color: #ffffff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.comm__new-post-btn:hover { background: var(--indigo); }

/* Filter pills */
.comm__filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.comm__filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.comm__filter-pill--active {
  background: var(--indigo-light);
  border-color: var(--indigo-light);
  color: #ffffff;
}
.comm__filter-pill--info {
  margin-left: auto;
}
.comm__filter-pill svg { flex-shrink: 0; }

/* Guidelines panel */
.comm__guidelines-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 22px;
}

.comm__guidelines-title {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.comm__guideline-item {
  margin-bottom: 10px;
}
.comm__guideline-item:last-child { margin-bottom: 0; }
.comm__guideline-item strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}
.comm__guideline-item p {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.5;
  white-space: pre-line;
}

/* Moderation banner */
.comm__moderation-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
}
.comm__moderation-banner--success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.comm__moderation-banner--warning {
  background: #fffbeb;
  color: #854d0e;
  border: 1px solid #fde68a;
}
.comm__moderation-icon { font-size: 1rem; flex-shrink: 0; }
.comm__moderation-text { flex: 1; }
.comm__moderation-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0 2px;
  line-height: 1;
  font-family: inherit;
}

/* Create post panel */
.comm__create-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 20px 22px;
}

.comm__create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.comm__create-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.comm__create-guideline-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #1e40af;
  margin-bottom: 12px;
}
.comm__create-guideline-hint svg { flex-shrink: 0; }

.comm__guideline-link {
  background: none;
  border: none;
  color: #4338ca;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  white-space: nowrap;
}

.comm__create-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comm__create-type-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.comm__type-select {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: capitalize;
}
.comm__type-select--active {
  font-weight: 700;
}

.comm__create-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
}
.comm__create-input:focus { border-color: var(--indigo-light); background: #fff; }

.comm__create-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font: inherit;
  font-size: 0.85rem;
  color: #0f172a;
  outline: none;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  box-sizing: border-box;
}
.comm__create-textarea:focus { border-color: var(--indigo-light); background: #fff; }

.comm__create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.comm__cancel-btn {
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.comm__submit-btn {
  padding: 9px 22px;
  border-radius: 8px;
  border: none;
  background: var(--indigo-light);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.comm__submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.comm__submit-btn:not(:disabled):hover { background: var(--indigo); }

/* Empty state */
.comm__empty {
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.comm__empty svg { color: #cbd5e1; width: 32px; height: 32px; margin-bottom: 4px; }
.comm__empty p {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #334155;
}
.comm__empty span {
  font-size: 0.82rem;
  color: #94a3b8;
}

/* Posts list */
.comm__posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Post card */
.comm__post-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 18px 22px;
}

.comm__post-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.comm__post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}

.comm__post-author-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comm__post-author {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}
.comm__post-author--link,
.comm__reply-author--link {
  border: none; background: none; padding: 0; margin: 0;
  font: inherit; text-align: left; cursor: pointer;
}
.comm__post-author--link:hover,
.comm__reply-author--link:hover { color: #4338ca; text-decoration: underline; }

.comm__post-time {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.comm__type-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
  flex-shrink: 0;
}

.comm__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
}
.comm__icon-btn:hover { background: #eef2ff; color: var(--indigo-light); border-color: #c7d2fe; }
.comm__icon-btn--active { background: #eef2ff; color: var(--indigo-light); border-color: #c7d2fe; }

/* --- Board nav actions + member options menu --- */
.comm__board-nav-actions { display: flex; align-items: center; gap: 8px; }
.comm__member-menu-wrap { position: relative; }
.comm__member-menu-backdrop {
  position: fixed; inset: 0; z-index: 40;
}
.comm__member-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  min-width: 210px; margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}
.comm__member-menu li { margin: 0; }
.comm__member-menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border: none; background: none; border-radius: 8px;
  font-size: 0.85rem; color: #0f172a; cursor: pointer;
}
.comm__member-menu button:hover { background: #f1f5f9; }
.comm__member-menu button:disabled { opacity: 0.5; cursor: not-allowed; }
.comm__member-menu .comm__member-menu--danger { color: #dc2626; }
.comm__member-menu .comm__member-menu--danger:hover { background: #fef2f2; }

/* --- @mention composer + tokens --- */
.comm__mention-wrap { position: relative; width: 100%; }
.comm__mention {
  color: #4338ca; font-weight: 600; background: #eef2ff;
  border-radius: 4px; padding: 0 3px;
}
.comm__mention-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  max-height: 240px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}
.comm__mention-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
}
.comm__mention-item--active, .comm__mention-item:hover { background: #eef2ff; }
.comm__mention-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comm__mention-name { font-size: 0.85rem; color: #0f172a; font-weight: 500; }
@media (prefers-reduced-motion: reduce) {
  .comm__member-menu, .comm__mention-menu { transition: none; }
}

.comm__post-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px;
  line-height: 1.4;
}

.comm__post-body {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 10px;
  white-space: pre-line;
}

/* Post actions bar */
.comm__post-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.comm__action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.comm__action-btn:hover { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.comm__action-btn--liked { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.comm__action-btn--liked:hover { background: #fee2e2; }
.comm__action-btn--active { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.comm__action-btn svg { flex-shrink: 0; }

/* Replies */
.comm__replies {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comm__replies-status {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
  padding: 6px 0;
  text-align: center;
}

.comm__reply {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 3px solid #e2e8f0;
}

.comm__reply-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.comm__reply-content {
  flex: 1;
  min-width: 0;
}

.comm__reply-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.comm__reply-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
}

.comm__reply-time {
  font-size: 0.68rem;
  color: #94a3b8;
}

.comm__reply-body {
  font-size: 0.82rem;
  color: #475569;
  margin: 0;
  line-height: 1.5;
}

.comm__reply-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.comm__reply-input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font: inherit;
  font-size: 0.82rem;
  outline: none;
  color: #0f172a;
}
.comm__reply-input:focus { border-color: var(--indigo-light); }

.comm__reply-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: var(--indigo-light);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.comm__reply-send:disabled { opacity: 0.5; cursor: not-allowed; }
.comm__reply-send:not(:disabled):hover { background: var(--indigo); }

/* Responsive */
@media (max-width: 640px) {
  .comm__header-card { padding: 18px 16px 14px; }
  .comm__heading { font-size: 1.25rem; }
  .comm__boards-grid { grid-template-columns: 1fr; }
  .comm__board-nav { flex-wrap: wrap; gap: 8px; }
  .comm__board-nav-center { text-align: left; }
  .comm__post-card { padding: 14px 16px; }
  .comm__filter-bar { gap: 5px; }
  .comm__filter-pill { padding: 5px 10px; font-size: 0.75rem; }
  .comm__filter-pill--info { margin-left: 0; }
  .comm__panel { padding: 16px; }
  .comm__create-panel { padding: 16px; }
  .comm__create-type-row { gap: 4px; }
}


/* ─── Market buttons (shared action buttons) ─────────────── */

.market-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    box-shadow 0.18s ease, transform 0.06s ease;
}

.market-btn:focus-visible {
  outline: 2px solid var(--primary, var(--primary));
  outline-offset: 2px;
}

.market-btn:active {
  transform: translateY(1px);
}

.market-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.market-btn--sm {
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: 9px;
}

.market-btn--primary {
  background: linear-gradient(135deg, var(--primary, var(--primary)) 0%, var(--accent, var(--accent)) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.market-btn--primary:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
  filter: brightness(1.04);
}

.market-btn--outline {
  background: var(--mk-surface, #f8fafc);
  border-color: var(--mk-border, #e2e8f0);
  color: #0f172a;
}

.market-btn--outline:hover:not(:disabled) {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--primary, var(--primary));
}

.market-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--primary, var(--primary));
}

.market-btn--ghost:hover:not(:disabled) {
  background: #eff6ff;
}

/* ─── Notification Preferences (toggle rows) ─────────────── */

.notif-prefs__section {
  margin-bottom: 24px;
}

.notif-prefs__section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-prefs__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--mk-surface-light);
}

.notif-prefs__row:last-child {
  border-bottom: none;
}

.notif-prefs__row-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
}

.notif-prefs__row-desc {
  font-size: 0.75rem;
  color: var(--mk-text-muted);
  margin-top: 2px;
}

.notif-prefs__toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
}

.notif-prefs__toggle--on {
  background: var(--primary);
}

.notif-prefs__toggle:disabled {
  opacity: 0.4;
  cursor: default;
}

.notif-prefs__toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.notif-prefs__toggle--on .notif-prefs__toggle-knob {
  left: 22px;
}

/* ── Categories Page — Premium Design ────────────────── */
.cat-page {
  min-height: 100vh;
  background: var(--mk-surface);
  padding: 0 0 48px;
}

.cat-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e40af 100%);
  padding: 48px 24px 56px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
}

.cat-header__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-header__eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 4px;
}

.cat-header__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.cat-header__subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.cat-grid {
  max-width: 960px;
  margin: -28px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  position: relative;
  z-index: 1;
}

@media (max-width: 700px) {
  .cat-grid {
    grid-template-columns: 1fr;
  }
}

.cat-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--mk-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.cat-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
}

.cat-card__name {
  font-size: 15px;
  font-weight: 650;
  color: #0f172a;
  margin: 0;
  flex: 1;
  line-height: 1.35;
}

.cat-card__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.cat-card__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--mk-border);
  background: var(--mk-surface);
  color: var(--mk-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.cat-card__link {
  display: block;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border-top: 1px solid var(--mk-surface-light);
}

.cat-card__subs {
  border-top: 1px solid var(--mk-border);
  background: var(--mk-surface);
  padding: 12px 16px;
}

.cat-sub {
  margin-bottom: 4px;
}

.cat-sub:last-child {
  margin-bottom: 0;
}

.cat-sub__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
}

.cat-sub__link {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
}

.cat-sub__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--mk-border);
  color: var(--mk-text-secondary);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.cat-sub__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--mk-border);
  background: #ffffff;
  color: var(--mk-text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.cat-sub__leaves {
  padding: 4px 0 4px 28px;
}

.cat-leaf__link {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--mk-text-secondary);
  text-decoration: none;
  border-radius: 6px;
}

/* ============================================================
   CLS (Cumulative Layout Shift) prevention — marketplace
   ============================================================ */

/* Seller dashboard hero: reserve stable height so stats bar
   does not push content down when it renders after API call */
.sdash__hero {
  min-height: 200px;
}
.sdash__stats-bar {
  min-height: 100px;
}

/* Search hero: reserve stable height for hero + form area */
.search-hero {
  min-height: 200px;
}

/* Stories row: explicit dimensions prevent reflow when images load */
.fy-stories {
  min-height: 90px;
}
.fy-stories__img {
  width: 58px;
  height: 58px;
  aspect-ratio: 1 / 1;
}

/* Gig/product card images: ensure stable box before image loads */
.search-card {
  contain: layout style;
}
.search-card__image {
  background: var(--mk-surface-light);
}

/* Market card: stable container for content transitions */
.market-card {
  min-height: 120px;
}

/* ─── Gig / Product reel uploader ────────────────────────── */
.gig-reel {
  margin: 1.25rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--market-border, #e2e8f0);
  border-radius: var(--market-radius, 12px);
  background: var(--market-surface-2, #f8fafc);
}
.gig-reel__toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--market-text, #1e293b);
}
.gig-reel__toggle input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--market-primary, var(--primary-bright));
  cursor: pointer;
}
.gig-reel__body {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.gig-reel__hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--market-text-muted, #64748b);
}
.gig-reel__preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.gig-reel__video {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  background: #000;
  object-fit: cover;
  box-shadow: var(--market-shadow, 0 4px 14px rgba(15, 23, 42, 0.12));
}
.gig-reel__current,
.gig-reel__filename {
  font-size: 0.8rem;
  color: var(--market-text-muted, #64748b);
  word-break: break-all;
}
.gig-reel__upload {
  display: inline-block;
  cursor: pointer;
}
.gig-reel__error {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #dc2626;
}

/* ─── For-You reels / stories strip ──────────────────────── */
.reels-strip {
  margin: 0 0 1.25rem;
  padding: 0.25rem 0 0.5rem;
}
.reels-strip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.65rem;
}
.reels-strip__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--market-text, #1e293b);
}
.reels-strip__track {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  padding: 0.25rem 0.1rem 0.6rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.reels-strip__track::-webkit-scrollbar { display: none; }
.reels-strip__item {
  flex: 0 0 auto;
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  scroll-snap-align: start;
}
.reels-strip__ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);
}
.reels-strip__thumb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--market-bg, #fff);
  background: #0f172a;
}
.reels-strip__label {
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--market-text, #1e293b);
  max-width: 74px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Full-screen reel viewer ────────────────────────────── */
.reel-viewer {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-viewer__stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-viewer__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.reel-viewer__bars {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 3;
}
.reel-viewer__bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}
.reel-viewer__bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}
.reel-viewer__bar--done > span { width: 100%; }
.reel-viewer__seller {
  position: absolute;
  top: 26px;
  left: 14px;
  right: 56px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  z-index: 3;
  color: #fff;
}
.reel-viewer__seller-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.reel-viewer__seller-link:hover { opacity: 0.85; }
.reel-viewer__seller-link:active { transform: scale(0.97); }
.reel-viewer__seller-link:disabled { cursor: default; }
.reel-viewer__seller-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.reel-viewer__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: #1e293b;
}
.reel-viewer__seller-name {
  font-weight: 700;
  font-size: 0.9rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.reel-viewer__close {
  position: absolute;
  top: 22px;
  right: 12px;
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.reel-viewer__caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 86px;
  z-index: 3;
  color: #fff;
}
.reel-viewer__caption-title {
  font-weight: 700;
  font-size: 1rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.reel-viewer__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0.72rem 1.5rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
  color: #0f172a;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.reel-viewer__cta::after {
  content: '\2192';
  font-size: 1.05em;
  line-height: 1;
  transition: transform 0.18s ease;
}
.reel-viewer__cta:hover {
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
  transform: translateY(-1px);
}
.reel-viewer__cta:hover::after { transform: translateX(3px); }
.reel-viewer__cta:active { transform: translateY(0); }
.reel-viewer__cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .reel-viewer__cta {
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reel-viewer__cta,
  .reel-viewer__cta::after,
  .reel-viewer__seller-link { transition: none !important; }
}
.reel-viewer__nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32%;
  z-index: 2;
  border: none;
  background: transparent;
  cursor: pointer;
}
.reel-viewer__nav--prev { left: 0; }
.reel-viewer__nav--next { right: 0; }
@media (prefers-reduced-motion: reduce) {
  .reel-viewer__bar > span { transition: none !important; }
}

/* ─── END REDESIGNED STYLES ──────────────────────────────── */

/* ─── Trust panel: evidence attachments ──────────────────── */
.trust-evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 8px 0 4px;
}

.trust-evidence-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.trust-evidence-item__note {
  font-size: 13px;
  color: #334155;
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

.trust-evidence__thumb {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  text-decoration: none;
  aspect-ratio: 16 / 10;
}

.trust-evidence__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.trust-evidence__thumb:hover img,
.trust-evidence__thumb:focus-visible img {
  transform: scale(1.04);
}

.trust-evidence__cta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.78) 100%);
  display: flex;
  align-items: center;
  gap: 5px;
}

.trust-evidence__cta::before {
  content: "\1F50D";
  font-size: 11px;
}

.trust-evidence__thumb:focus-visible {
  outline: 2px solid var(--indigo-light);
  outline-offset: 2px;
}

.trust-evidence__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--indigo);
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  text-decoration: none;
}

.trust-evidence__link::after {
  content: "\2197";
  font-size: 12px;
}

.trust-evidence__link:hover {
  background: #e0e7ff;
}

.trust-evidence__link:focus-visible {
  outline: 2px solid var(--indigo-light);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .trust-evidence__thumb img { transition: none; }
}

/* ── Advanced Service Areas manager ─────────────────────────────── */
.sa-manager {
  border-top: 1px solid var(--mk-border, #e5e7eb);
  margin-top: 1.5rem;
  padding: 1.5rem;
}
.sa-manager__head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.sa-manager__head .market-section-title { margin: 0; }
.sa-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.sa-list__empty {
  background: var(--mk-surface-light, #f8fafc);
  border: 1px dashed var(--mk-border, #e5e7eb);
  border-radius: 12px;
  color: var(--mk-text-muted, #6b7280);
  font-size: 0.9rem;
  padding: 1.25rem;
  text-align: center;
}
.sa-item {
  align-items: center;
  background: var(--mk-surface, #fff);
  border: 1px solid var(--mk-border, #e5e7eb);
  border-radius: 12px;
  display: grid;
  gap: 0.25rem 1rem;
  grid-template-columns: 1fr auto;
  padding: 0.85rem 1rem;
}
.sa-item__main {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sa-item__title { font-weight: 600; }
.sa-item__meta {
  color: var(--mk-text-muted, #6b7280);
  font-size: 0.85rem;
  grid-column: 1 / 2;
}
.sa-item__actions {
  display: flex;
  gap: 0.5rem;
  grid-column: 2 / 3;
  grid-row: 1 / 3;
}
.sa-badge {
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.6rem;
  text-transform: uppercase;
}
.sa-badge--radius { background: #e0f2fe; color: #0369a1; }
.sa-badge--pincode { background: #ecfdf5; color: #047857; }
.sa-badge--multi_zone { background: #faf5ff; color: #7e22ce; }
.sa-item__primary {
  background: var(--mk-accent, var(--indigo-light));
  border-radius: 999px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
}
.sa-form {
  background: var(--mk-surface-light, #f8fafc);
  border: 1px solid var(--mk-border, #e5e7eb);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}
.sa-form__title { font-size: 1rem; font-weight: 700; margin: 0; }
@media (max-width: 640px) {
  .sa-item { grid-template-columns: 1fr; }
  .sa-item__actions { grid-column: 1 / 2; grid-row: auto; }
}

/* ── Gig editor: "How the order will be processed?" (made on order / ready to ship) ── */
.gig-processing {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}
.gig-processing .market-label__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}
.gig-processing__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.gig-processing__opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 15px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.gig-processing__opt:hover {
  border-color: #93c5fd;
}
.gig-processing__opt--active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.gig-processing__opt input[type="radio"] {
  margin-top: 3px;
  accent-color: #2563eb;
}
.gig-processing__opt-label {
  display: grid;
  gap: 3px;
}
.gig-processing__opt-label strong {
  font-weight: 700;
  color: var(--text);
}
.gig-processing__opt-label small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}
.gig-processing__min {
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  align-items: start;
  max-width: 520px;
  margin-top: 4px;
}
.gig-processing__min .market-label {
  min-width: 0;
}
@media (max-width: 640px) {
  .gig-processing__options { grid-template-columns: 1fr; }
  .gig-processing__min { grid-template-columns: 1fr; max-width: none; }
}
