:root {
  --bg: #f6f0e8;
  --bg2: #efe3d5;
  --card: #ffffff;
  --card-soft: #fffaf5;
  --line: #e5d3c1;
  --text: #2c2622;
  --muted: #7b6f65;
  --accent: #f08d22;
  --accent2: #f4b24c;
  --soft: #f5e9db;
  --success: #2f7a4a;
  --danger: #ad4141;
  --radius: 24px;
  --shadow: 0 14px 30px rgba(91, 61, 35, 0.1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
}

body {
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
}

.app-shell {
  width: 100%;
  max-width: 1200px;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  background: linear-gradient(180deg, #f8f3ec, #efe3d6);
  padding: 0 16px;
}

.auth-screen,
.app-screen {
  display: none;
  min-height: 100vh;
}

.auth-screen.active-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
}

.app-screen.active-screen {
  display: block;
}

.screen {
  display: none;
  animation: fade 0.22s ease;
}

.screen.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0.6;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* AUTH */

.auth-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-logo {
  width: 74px;
  height: 74px;
  margin: 0 auto 14px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #ffffff;
  font-size: 2rem;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0 0 6px;
  text-align: center;
  font-size: clamp(1.55rem, 5vw, 2.1rem);
}

.auth-card p {
  margin: 0 0 18px;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

.tabs-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-tab {
  border: none;
  border-radius: 14px;
  padding: 14px 12px;
  background: #e9e1d8;
  font-weight: 700;
  color: var(--muted);
}

.auth-tab.active {
  background: var(--accent);
  color: #ffffff;
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

.auth-legal {
  margin-top: 12px;
  text-align: center;
  font-size: 0.9rem;
  color: #6f6a64;
  line-height: 1.5;
}

.auth-legal a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.auth-legal a:hover {
  text-decoration: underline;
}

/* HEADER */

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.mobile-header > div:last-child {
  flex-shrink: 0;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 1.3rem;
  box-shadow: var(--shadow);
}

.brand-wrap h1 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.15;
}

.brand-wrap p {
  max-width: 180px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.language-select {
  border-radius: 14px;
  margin: 0;
  padding: 10px 12px;
}

/* MAIN */

.mobile-main {
  padding: 14px 14px calc(115px + env(safe-area-inset-bottom));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 16px;
  margin-bottom: 14px;
}

.card-inner {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--card-soft);
  border: 1px solid var(--line);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
  font-size: 1.04rem;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

/* FORMS */

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid #dbcab7;
  background: #ffffff;
  color: var(--text);
  margin-bottom: 10px;
  outline: none;
}

.password-eye-wrap {
  position: relative !important;
  width: 100% !important;
  display: block !important;
}

.password-eye-wrap input {
  width: 100% !important;
  padding-right: 58px !important;
}

.password-eye-btn {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;

  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  margin: 0 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  border-radius: 12px !important;
  border: 1px solid #dbcab7 !important;
  background: #ffffff !important;
  color: var(--accent) !important;

  font-size: 18px !important;
  line-height: 1 !important;
  z-index: 50 !important;
}

#appScreen.dark-mode .password-eye-btn {
  background: #2d2d2d !important;
  color: #ffffff !important;
  border-color: #4a4a4a !important;
}

@media (max-width: 600px) {
  .password-eye-wrap input {
    padding-right: 60px !important;
  }

  .password-eye-btn {
    right: 7px !important;
    width: 42px !important;
    height: 42px !important;
    z-index: 999 !important;
  }
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 141, 34, 0.15);
}

.form-stack {
  margin-top: 10px;
}

.primary-btn,
.secondary-btn,
.theme-btn,
.market-mode-btn,
.payment-method-btn {
  border-radius: 16px;
  padding: 13px 15px;
  font-weight: 700;
}

.primary-btn,
.secondary-btn {
  width: 100%;
  border: none;
}

.primary-btn {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.secondary-btn {
  background: #ffffff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.section-head .primary-btn,
.section-head .secondary-btn,
.subscription-modal-head .secondary-btn,
.favorites-popup-head .secondary-btn,
.private-add-row .secondary-btn,
.product-actions .primary-btn,
.product-actions .secondary-btn,
.cart-summary-actions .primary-btn,
.cart-summary-actions .secondary-btn {
  width: auto;
}

.form-stack > .primary-btn,
.form-stack > .secondary-btn {
  width: 100%;
}

/* LISTES */

.stack-list {
  display: grid;
  gap: 12px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 13px;
  background: var(--card-soft);
  overflow: hidden;
}

.list-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.list-top strong {
  display: block;
  margin-bottom: 4px;
}

.list-meta {
  font-size: 0.84rem;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid #ead9c8;
  color: #654b34;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* PROFILE */

.profile-card {
  width: 100%;
  padding: 18px;
}

.profile-card .profile-top,
.profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.avatar-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.avatar-circle {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.profile-photo {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--line);
  display: none;
}

.profile-photo[src]:not([src=""]) {
  display: block;
}

.profile-photo[src]:not([src=""]) + .avatar-circle {
  display: none;
}

.profile-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-status-select {
  margin-top: 6px;
}

.delete-account-square {
  margin-left: auto;
  width: 52px;
  height: 52px;
  min-width: 52px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff9a1f, #f7b23b);
  color: #ffffff;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(255, 145, 30, 0.25);
}

.delete-account-square:hover {
  transform: scale(1.04);
}

.delete-account-square:active {
  transform: scale(0.96);
}

#profileEmail {
  display: none;
}

/* THEME */

.theme-switcher,
.market-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.theme-btn,
.market-mode-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 16px;
  padding: 12px;
  font-weight: 700;
}

.theme-btn.active,
.market-mode-btn.active {
  background: var(--accent);
  color: #ffffff;
}

/* VERSETS */

.verse-center-card {
  text-align: center;
}

.verse-center-card .section-head {
  justify-content: center;
}

.verse-box {
  margin: 0 0 8px;
  font-size: 1.04rem;
  line-height: 1.7;
}

.date-chip {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  margin: 0 auto 10px;
}

/* HOME GRID */

.home-icon-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.home-icon-card {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 20px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  box-shadow: var(--shadow);
  min-height: 92px;
  text-align: center;
}

.home-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.home-icon-card span {
  font-size: 0.78rem;
  line-height: 1.15;
  text-align: center;
}

/* BOTTOM NAV */

.social-bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(1200px, calc(100% - 32px));
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 900;
}

.social-tab {
  position: relative;
  border: none;
  background: transparent;
  padding: 8px 2px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.social-tab.active {
  background: var(--soft);
  color: var(--accent);
}

.social-icon {
  font-size: 1.1rem;
}

.market-notification-badge {
  position: absolute;
  top: 4px;
  right: 18%;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d92d20;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

body.modal-open .social-bottom-nav {
  display: none;
}

/* MARKET */

.market-mode-card {
  padding: 12px;
}

#market .section-head {
  display: block;
}

#market .section-head h3 {
  margin: 0 0 12px;
}

#productShopTitle {
  display: block;
  width: 100%;
  margin-bottom: 14px;
}

.shop-title-display {
  font-size: 1rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 6px;
}

#marketList.stack-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.product-card,
#marketList .product-card {
  height: 100%;
  min-height: 100%;
  max-height: none;
  overflow: visible;
  padding: 14px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-photo-wrap,
.product-card .product-photo-wrap,
#marketList .product-card .product-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  max-height: 260px;
  border-radius: 16px;
  overflow: hidden;
  background: #f3eee8;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.product-photo,
.product-card .product-photo,
#marketList .product-card .product-photo-wrap .product-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border: none;
  border-radius: 0;
  margin: 0;
}

.product-card .product-info-grid,
#marketList .product-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.product-card .product-info-grid div,
#marketList .product-info-grid div {
  padding: 8px;
  border-radius: 12px;
  background: #f7f1eb;
  border: 1px solid var(--line);
}

.product-card .product-info-grid strong,
#marketList .product-info-grid strong {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 3px;
}

.product-card .product-info-grid span,
#marketList .product-info-grid span {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.product-card p,
#marketList .product-card p {
  flex-grow: 1;
  margin: 6px 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.product-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.product-card .product-actions,
#marketList .product-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.product-card .product-actions input,
#marketList .product-actions input {
  flex: 1 1 100%;
}

.product-card .product-actions .primary-btn,
.product-card .product-actions .secondary-btn,
#marketList .product-actions .primary-btn,
#marketList .product-actions .secondary-btn {
  flex: 1 1 auto;
  min-width: 120px;
}

.product-card-icon-btn,
#marketList .product-card-icon-btn {
  position: absolute;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid var(--accent);
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 20px;
  z-index: 5;
}

.favorite-product-btn,
#marketList .favorite-product-btn {
  top: 10px;
}

.cart-product-btn,
#marketList .cart-product-btn {
  bottom: 10px;
}

.favorite-product-btn.active,
#marketList .favorite-product-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.commission-note {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.market-empty-message,
.premium-locked-box {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #e6d3c2;
  border-radius: 14px;
  background: #fff8f1;
  text-align: center;
}

.premium-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 6px;
}

.delivery-box,
.delivery-choice-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-soft);
}

.delivery-box strong,
.delivery-choice-box strong {
  display: block;
  margin-bottom: 8px;
}

.delivery-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-weight: 700;
}

.delivery-option input {
  width: auto;
  margin: 0;
}

.delivery-method-line {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* PANIER */

#marketCartCard {
  border: 2px solid rgba(240, 141, 34, 0.25);
}

.cart-summary-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-soft);
}

.cart-summary-items {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.cart-summary-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #fff3e4;
  border: 1px solid var(--line);
}

.cart-summary-item span {
  font-weight: 700;
}

.cart-summary-price-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cart-remove-item-btn {
  width: 22px;
  height: 22px;
  border: 1px solid #e2c9aa;
  border-radius: 50%;
  background: #fff7ec;
  color: #b42318;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cart-remove-item-btn:hover {
  background: #b42318;
  color: #ffffff;
  border-color: #b42318;
}

.cart-subtotal-line,
.cart-total-achats-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #ead7c2;
  border-radius: 14px;
  font-weight: 800;
  background: #fff7ec;
}

.cart-total-achats-line {
  padding: 14px 16px;
  background: var(--card-soft);
}

.cart-total-achats-line strong {
  color: var(--accent);
  font-size: 20px;
}

.cart-summary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cart-summary-actions .primary-btn,
.cart-summary-actions .secondary-btn {
  width: 100%;
}

.cart-summary-actions .clear-cart-btn {
  color: var(--danger);
  border-color: var(--danger);
  background: #ffffff;
}

/* MARKET CHAT */

.market-chat-box {
  margin-top: 12px;
}

.market-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.market-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.market-message-item {
  padding: 12px;
  border-radius: 12px;
  background: var(--card-soft);
  border: 1px solid var(--line);
}

.market-message-item p {
  margin: 6px 0;
}

.market-message-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  flex-wrap: wrap;
}

/* PRIVATE CHAT */

.private-user-picker {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.private-user-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-soft);
}

.private-user-check input {
  width: auto;
  margin: 0;
}

.private-conversation-item {
  cursor: pointer;
}

.private-participants-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-soft);
  margin-bottom: 12px;
}

.private-participant-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.private-participant-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.private-add-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.private-add-row select {
  margin-bottom: 0;
}

.private-add-row button {
  width: auto;
  white-space: nowrap;
}

.private-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px;
  border-radius: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.private-message-item {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--card-soft);
  border: 1px solid var(--line);
}

.private-message-item.mine {
  margin-left: auto;
  background: rgba(240, 141, 34, 0.16);
  border-color: rgba(240, 141, 34, 0.35);
}

.private-message-item strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.private-message-item p {
  margin: 0;
  line-height: 1.45;
}

.private-mini-btn,
.private-remove-btn {
  border: 1px solid var(--danger);
  background: #ffffff;
  color: var(--danger);
  border-radius: 10px;
  padding: 7px 10px;
  font-weight: 700;
}

#privateQuitConversationBtn {
  color: var(--danger);
  border-color: var(--danger);
}

/* EVENTS + DISCUSSION */

.event-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.discussion-message-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-soft);
}

.discussion-message-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.discussion-mini-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.discussion-mini-btn.danger {
  border-color: rgba(173, 65, 65, 0.35);
  color: var(--danger);
}

.clear-event-discussion-btn {
  width: auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--danger);
  border: 1px solid var(--danger);
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: none;
}

.clear-event-discussion-btn:hover {
  background: var(--danger);
  color: #ffffff;
}

/* POLLS */

.event-poll-card,
.discussion-poll-card {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--card-soft);
  border: 1px solid var(--line);
}

.event-poll-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.event-poll-total {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.event-poll-options,
.discussion-poll-options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.poll-option-btn,
.discussion-poll-option {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.poll-option-btn.active,
.discussion-poll-option.active {
  border-color: var(--accent);
  background: rgba(240, 141, 34, 0.12);
}

.poll-bubble,
.discussion-poll-bubble {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent);
}

.poll-label {
  font-weight: 700;
}

.poll-count {
  font-weight: 800;
  color: var(--accent);
}

/* CALENDAR */

#calendarGrid {
  display: grid;
  gap: 16px;
}

#calendarGrid .calendar-month {
  margin-bottom: 16px;
}

#calendarGrid .calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
  width: 100%;
}

#calendarGrid .calendar-weekday {
  display: block;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 2px;
}

#calendarGrid .calendar-empty {
  display: block;
  min-height: 46px;
}

#calendarGrid .calendar-day {
  display: flex;
  min-height: 48px;
  background: #faf5ef;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 6px;
  text-align: center;
  color: var(--text);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  line-height: 1.2;
}

#calendarGrid .calendar-day strong {
  color: inherit;
  font-weight: 800;
}

#calendarGrid .calendar-day span {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: inherit;
}

#calendarGrid .calendar-feast {
  background: #edf8f0;
  border-color: #c1e1cb;
  color: #214d32;
}

#calendarGrid .calendar-today {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

#calendarGrid .calendar-user-event {
  background: #fff3d7;
  border-color: #f0b24c;
  color: #4a2c00;
}

#calendarGrid .calendar-user-event-title {
  font-weight: 700;
}

#calendarGrid .calendar-focus-day {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* WORLD MAP */

.world-map,
#worldMap {
  width: 100%;
  height: clamp(360px, 55vh, 520px);
  min-height: 360px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  background: #dcdcdc;
}

#worldMap.leaflet-container,
.world-map .leaflet-container {
  width: 100%;
  height: 100%;
  min-height: 360px;
}

.leaflet-tile {
  filter: none;
  opacity: 1;
}

/* MUSIC */

.music-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.music-listen-btn,
.listen-track-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.music-listen-btn:hover,
.listen-track-btn:hover {
  text-decoration: none;
}

/* QUIZ */

.quiz-result-box {
  padding: 12px;
  border-radius: 14px;
  background: rgba(240, 141, 34, 0.1);
  border: 1px solid rgba(240, 141, 34, 0.22);
  margin-top: 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.quiz-corrections {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.quiz-correction-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(240, 141, 34, 0.08);
  border: 1px solid rgba(240, 141, 34, 0.22);
  line-height: 1.5;
}

.quiz-correction-item strong {
  color: var(--text);
}

.quiz-correction-item .muted {
  display: block;
  color: var(--muted);
}

.quiz-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.quiz-fireworks-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 100000;
}

.quiz-firework {
  position: absolute;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
}

.quiz-firework span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  box-shadow: 0 0 10px currentColor;
  animation: quiz-firework-particle 1.25s ease-out forwards;
}

@keyframes quiz-firework-particle {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  80% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0.2);
  }
}

/* MODALS */

.subscription-modal,
.favorites-popup,
.buy-quantity-popup,
.card-payment-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
}

.subscription-modal.open,
.favorites-popup.open,
.buy-quantity-popup.open,
.card-payment-popup.open {
  display: flex;
}

.subscription-modal-content,
.favorites-popup-card,
.buy-quantity-card,
.card-payment-box {
  position: relative;
  width: min(92vw, 520px);
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  background: var(--card-soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.subscription-modal-head,
.favorites-popup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.subscription-modal-head h3,
.favorites-popup-head h3 {
  margin: 0;
}

.subscription-price-box,
.buy-popup-total,
.card-payment-total {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff3e4;
  border: 1px solid var(--line);
  text-align: center;
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}

.payment-method-btn {
  width: 100%;
  min-height: 48px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #d8c3af;
  background: #ffffff;
  color: var(--text);
  font-size: 1rem;
  text-align: left;
}

.payment-method-btn.active {
  border-color: var(--accent);
  background: rgba(240, 141, 34, 0.12);
}

/* FAVORIS POPUP */

#favoritesPopupList,
.favorites-popup-list {
  display: grid;
  gap: 12px;
  max-height: 62vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.favorite-popup-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid #f2c9a0;
  border-radius: 18px;
  background: #ffffff;
}

.favorite-popup-item img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 14px;
  background: #dddddd;
}

.favorite-popup-info {
  min-width: 0;
}

.favorite-popup-info p {
  margin: 8px 0;
  line-height: 1.4;
}

.favorites-popup-card::-webkit-scrollbar,
#favoritesPopupList::-webkit-scrollbar,
.favorites-popup-list::-webkit-scrollbar {
  width: 8px;
}

.favorites-popup-card::-webkit-scrollbar-thumb,
#favoritesPopupList::-webkit-scrollbar-thumb,
.favorites-popup-list::-webkit-scrollbar-thumb {
  background: rgba(240, 141, 34, 0.45);
  border-radius: 999px;
}

.favorites-popup-card::-webkit-scrollbar-track,
#favoritesPopupList::-webkit-scrollbar-track,
.favorites-popup-list::-webkit-scrollbar-track {
  background: rgba(229, 211, 193, 0.45);
  border-radius: 999px;
}

/* BUY POPUP + CARD PAYMENT */

.buy-popup-close,
.card-payment-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
  z-index: 2;
}

.buy-popup-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f3eee8;
  margin-bottom: 12px;
}

.buy-popup-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.buy-popup-line,
.buy-popup-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.buy-popup-label {
  display: block;
  font-weight: 800;
  margin: 10px 0 6px;
}

.buy-popup-error,
.card-payment-error {
  min-height: 20px;
  margin: 8px 0;
  color: var(--danger);
  font-weight: 700;
  font-size: 0.9rem;
}

.card-payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card-payment-box label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 700;
  color: var(--text);
}

.card-payment-box hr {
  margin: 16px 0 12px;
  border: none;
  border-top: 1px solid var(--line);
}

/* DARK MODE */

#appScreen.dark-mode {
  background: linear-gradient(180deg, #1e1e1e, #121212);
  color: #f5f5f5;
}

#appScreen.dark-mode .mobile-header,
#appScreen.dark-mode .social-bottom-nav {
  background: rgba(28, 28, 28, 0.96);
  border-color: #3a3a3a;
}

#appScreen.dark-mode .card,
#appScreen.dark-mode .auth-card,
#appScreen.dark-mode .list-item,
#appScreen.dark-mode .card-inner,
#appScreen.dark-mode .home-icon-card,
#appScreen.dark-mode .delivery-box,
#appScreen.dark-mode .delivery-choice-box,
#appScreen.dark-mode .market-message-item,
#appScreen.dark-mode .private-user-check,
#appScreen.dark-mode .private-participants-box,
#appScreen.dark-mode .private-participant-item,
#appScreen.dark-mode .private-message-item,
#appScreen.dark-mode .discussion-message-item,
#appScreen.dark-mode .event-poll-card,
#appScreen.dark-mode .discussion-poll-card,
#appScreen.dark-mode .cart-summary-card,
#appScreen.dark-mode .cart-summary-item,
#appScreen.dark-mode .cart-subtotal-line,
#appScreen.dark-mode .cart-total-achats-line,
#appScreen.dark-mode .subscription-modal-content,
#appScreen.dark-mode .favorites-popup-card,
#appScreen.dark-mode .buy-quantity-card,
#appScreen.dark-mode .card-payment-box {
  background: #232323;
  color: #f5f5f5;
  border-color: #444444;
  box-shadow: none;
}

#appScreen.dark-mode .market-messages,
#appScreen.dark-mode .private-messages {
  background: #2a2a2a;
  border-color: #444444;
}

#appScreen.dark-mode .muted,
#appScreen.dark-mode .brand-wrap p,
#appScreen.dark-mode .list-meta,
#appScreen.dark-mode .delivery-method-line,
#appScreen.dark-mode .market-message-footer,
#appScreen.dark-mode .commission-note {
  color: #c7c7c7;
}

#appScreen.dark-mode input,
#appScreen.dark-mode select,
#appScreen.dark-mode textarea {
  background: #2d2d2d;
  color: #ffffff;
  border-color: #4a4a4a;
}

#appScreen.dark-mode input::placeholder,
#appScreen.dark-mode textarea::placeholder {
  color: #aaaaaa;
}

#appScreen.dark-mode .theme-btn,
#appScreen.dark-mode .icon-btn,
#appScreen.dark-mode .social-tab,
#appScreen.dark-mode .payment-method-btn,
#appScreen.dark-mode .discussion-mini-btn,
#appScreen.dark-mode .poll-option-btn,
#appScreen.dark-mode .discussion-poll-option {
  background: #2a2a2a;
  color: #f5f5f5;
  border-color: #444444;
}

#appScreen.dark-mode .theme-btn.active,
#appScreen.dark-mode .market-mode-btn.active,
#appScreen.dark-mode .social-tab.active,
#appScreen.dark-mode .primary-btn {
  background: var(--accent);
  color: #ffffff;
}

#appScreen.dark-mode .secondary-btn {
  background: #2a2a2a;
  color: #f5f5f5;
  border: 1px solid #555555;
}

#appScreen.dark-mode .tag,
#appScreen.dark-mode .date-chip {
  background: #333333;
  color: #f5f5f5;
  border-color: #555555;
}

#appScreen.dark-mode .avatar-circle,
#appScreen.dark-mode .brand-logo,
#appScreen.dark-mode .auth-logo {
  box-shadow: none;
}

#appScreen.dark-mode .delete-account-square {
  background: linear-gradient(135deg, #ff9a1f, #d97b13);
  color: #ffffff;
}

#appScreen.dark-mode .product-card .product-photo-wrap,
#appScreen.dark-mode #marketList .product-card .product-photo-wrap,
#appScreen.dark-mode .product-card .product-info-grid div,
#appScreen.dark-mode #marketList .product-info-grid div {
  background: #2a2a2a;
  border-color: #444444;
}

#appScreen.dark-mode .product-card .product-info-grid strong,
#appScreen.dark-mode #marketList .product-info-grid strong {
  color: #c7c7c7;
}

#appScreen.dark-mode .product-card .product-info-grid span,
#appScreen.dark-mode #marketList .product-info-grid span {
  color: #f5f5f5;
}

#appScreen.dark-mode .product-card-icon-btn {
  background: rgba(35, 35, 35, 0.94);
  color: #ffffff;
  border-color: var(--accent);
}

#appScreen.dark-mode .shop-title-display {
  color: var(--accent2);
}

#appScreen.dark-mode .cart-total-achats-line strong,
#appScreen.dark-mode .cart-summary-total {
  color: #ffb45c;
}

#appScreen.dark-mode .cart-remove-item-btn {
  background: #3a1f1f;
  color: #ffb4b4;
  border-color: #7a4444;
}

#appScreen.dark-mode .discussion-mini-btn.danger,
#appScreen.dark-mode .private-mini-btn,
#appScreen.dark-mode .private-remove-btn,
#appScreen.dark-mode #privateQuitConversationBtn {
  color: #ffb4b4;
  border-color: #7a4444;
}

#appScreen.dark-mode #calendarGrid .calendar-weekday {
  color: #c7c7c7;
}

#appScreen.dark-mode #calendarGrid .calendar-empty {
  background: transparent;
}

#appScreen.dark-mode #calendarGrid .calendar-day {
  background: #2d2d2d;
  border-color: #444444;
  color: #f5f5f5;
}

#appScreen.dark-mode #calendarGrid .calendar-feast {
  background: rgba(47, 122, 74, 0.32);
  border-color: rgba(85, 170, 110, 0.6);
  color: #d9f7df;
}

#appScreen.dark-mode #calendarGrid .calendar-today {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

#appScreen.dark-mode #calendarGrid .calendar-user-event {
  background: rgba(240, 141, 34, 0.24);
  border-color: rgba(240, 141, 34, 0.75);
  color: #ffe3b8;
}

#appScreen.dark-mode .market-notification-badge {
  background: #ff4d4d;
  color: #ffffff;
}

#appScreen.dark-mode .quiz-result-box,
#appScreen.dark-mode .quiz-correction-item {
  background: #2a2a2a;
  border-color: #444444;
  color: #f5f5f5;
}

#appScreen.dark-mode .quiz-correction-item strong {
  color: #f5f5f5;
}

#appScreen.dark-mode .quiz-firework span {
  box-shadow: 0 0 14px currentColor;
}

#appScreen.dark-mode .favorite-popup-item {
  background: #2a2a2a;
  color: #f5f5f5;
  border-color: #444444;
}

#appScreen.dark-mode .favorite-popup-item img {
  background: #333333;
}

/* RESPONSIVE */

@media (min-width: 900px) {
  .app-shell {
    max-width: 1200px;
    padding: 0 24px;
  }

  .mobile-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 0 calc(110px + env(safe-area-inset-bottom));
  }

  .card,
  .profile-card,
  .verse-center-card {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
  }

  .home-icon-grid {
    max-width: 1100px;
    margin: 0 auto 14px;
  }
}

@media (max-width: 768px) {
  .home-icon-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .home-icon-card {
    min-height: 84px;
    padding: 10px 4px;
  }

  .home-icon {
    font-size: 1.2rem;
  }

  .home-icon-card span {
    font-size: 0.68rem;
  }
}

@media (max-width: 640px) {
  #marketList.stack-list {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .product-card,
  #marketList .product-card {
    height: auto;
    min-height: 0;
  }

  .product-card .product-info-grid,
  #marketList .product-info-grid {
    grid-template-columns: 1fr;
  }

  .product-card .product-photo-wrap,
  #marketList .product-card .product-photo-wrap {
    aspect-ratio: 1 / 1;
    max-height: none;
  }

  .cart-summary-actions,
  .quiz-result-actions {
    grid-template-columns: 1fr;
  }

  .private-add-row {
    flex-direction: column;
  }

  .private-add-row button {
    width: 100%;
  }

  .private-message-item {
    max-width: 100%;
  }

  .favorite-popup-item {
    grid-template-columns: 1fr;
  }

  .favorite-popup-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  #favoritesPopupList,
  .favorites-popup-list {
    max-height: 58vh;
  }

  .card-payment-grid {
    grid-template-columns: 1fr;
  }

  #calendarGrid .calendar-month-grid {
    gap: 4px;
  }

  #calendarGrid .calendar-day {
    min-height: 42px;
    padding: 5px 3px;
    font-size: 0.82rem;
  }

  #calendarGrid .calendar-day span {
    font-size: 0.62rem;
  }
}

@media (max-width: 520px) {
  .delete-account-square {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 14px;
    font-size: 22px;
  }

  .clear-event-discussion-btn {
    width: 100%;
    margin-top: 6px;
  }
}

@media (max-width: 390px) {
  .brand-wrap p {
    max-width: 120px;
  }

  .social-bottom-nav {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    transform: none;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    row-gap: 0;
    padding-left: 4px;
    padding-right: 4px;
  }

  .social-tab {
    font-size: 0.56rem;
    padding: 7px 1px;
  }

  .social-icon {
    font-size: 0.95rem;
  }

  .mobile-main {
    padding-bottom: calc(105px + env(safe-area-inset-bottom));
  }

  .home-icon-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .home-icon-card {
    min-height: 76px;
    padding: 8px 3px;
    border-radius: 14px;
  }

  .home-icon {
    font-size: 1.05rem;
  }

  .home-icon-card span {
    font-size: 0.58rem;
    line-height: 1.1;
  }
}

/* CORRECTION DÉFINITIVE VENDEUR / ACHETEUR */
/* Empêche une seule carte vendeur de prendre toute la largeur */

#marketList.stack-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch !important;
  grid-auto-rows: 1fr !important;
}

/* Limite la largeur des cartes quand il y en a peu */
#marketList .product-card {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-width: 430px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

/* Le texte prend l’espace disponible */
#marketList .product-card p {
  flex-grow: 1 !important;
}

/* Les boutons restent en bas de la carte */
#marketList .product-actions {
  margin-top: auto !important;
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

/* Les boutons vendeur restent propres */
#marketList .product-actions .primary-btn,
#marketList .product-actions .secondary-btn {
  flex: 1 1 auto !important;
  min-width: 120px !important;
}

/* Mobile : une seule colonne normale */
@media (max-width: 640px) {
  #marketList.stack-list {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
  }

  #marketList .product-card {
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
  }
}

/* Langue mobile : FR / EN compact */
@media (max-width: 600px) {
  .language-select,
  #languageSelect {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    padding: 10px 28px 10px 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center;
  }
}


/* Profil visible / caché : compact sur mobile */
@media (max-width: 600px) {
  .profile-status-select,
  #profileStatus {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    padding: 10px 28px 10px 10px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }
}

/* ========================= */
/* FIX DARK MODE - BOUTIQUE */
/* Vendeur / Acheteur */
/* ========================= */

#appScreen.dark-mode .market-empty-message,
#appScreen.dark-mode .premium-locked-box {
  background: #232323 !important;
  color: #f5f5f5 !important;
  border-color: #444444 !important;
}

#appScreen.dark-mode .market-empty-message,
#appScreen.dark-mode .market-empty-message *,
#appScreen.dark-mode .premium-locked-box,
#appScreen.dark-mode .premium-locked-box * {
  color: #f5f5f5 !important;
}

#appScreen.dark-mode .market-mode-btn {
  background: #2a2a2a !important;
  color: #f5f5f5 !important;
  border-color: #444444 !important;
}

#appScreen.dark-mode .market-mode-btn.active {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
}

#appScreen.dark-mode #marketProductsTitle,
#appScreen.dark-mode #marketConversationsTitle,
#appScreen.dark-mode #marketCartTitle {
  color: #f5f5f5 !important;
}

#appScreen.dark-mode #sellerMarketPanel,
#appScreen.dark-mode #market .card {
  background: #232323 !important;
  color: #f5f5f5 !important;
  border-color: #444444 !important;
}

#appScreen.dark-mode #marketList,
#appScreen.dark-mode #sellerConversationsList,
#appScreen.dark-mode #marketCartSummary {
  color: #f5f5f5 !important;
}

/* ========================= */
/* SORTIES REPLIABLES */
/* Titre visible + contenu ouvrable */
/* ========================= */

.event-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 13px;
  background: var(--card-soft);
  overflow: hidden;
}

.event-title-row {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.event-title-row h4,
.event-title-row strong {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.event-title-info {
  min-width: 0;
}

.event-title-meta {
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--muted);
}

.event-chevron {
  flex: 0 0 auto;
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.event-card.open .event-chevron {
  transform: rotate(180deg);
}

.event-content {
  display: none;
  margin-top: 14px;
}

.event-card.open .event-content {
  display: block;
}

.close-event-btn {
  width: 100%;
  margin-top: 14px;
  padding: 12px 15px;
  border-radius: 16px;
  border: 1px solid var(--accent);
  background: #ffffff;
  color: var(--accent);
  font-weight: 800;
}

.close-event-btn:hover {
  background: var(--accent);
  color: #ffffff;
}

/* Dark mode sorties repliables */

#appScreen.dark-mode .event-card {
  background: #232323;
  color: #f5f5f5;
  border-color: #444444;
}

#appScreen.dark-mode .event-title-row,
#appScreen.dark-mode .event-title-row h4,
#appScreen.dark-mode .event-title-row strong {
  color: #f5f5f5;
}

#appScreen.dark-mode .event-title-meta {
  color: #c7c7c7;
}

#appScreen.dark-mode .close-event-btn {
  background: #2a2a2a;
  color: #f5f5f5;
  border-color: #555555;
}

.private-conversation-title-row {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.private-conversation-title-row strong {
  color: var(--text);
}

.private-conversation-item.open {
  border-color: var(--accent);
}

#appScreen.dark-mode .private-conversation-title-row,
#appScreen.dark-mode .private-conversation-title-row strong {
  color: #f5f5f5;
}

#appScreen.dark-mode .private-conversation-item.open {
  border-color: var(--accent);
}

.christian-chat-title-row {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.christian-chat-title-row strong {
  color: var(--text);
}

.christian-chat-content {
  display: none;
  margin-top: 10px;
}

.christian-chat-card.open .christian-chat-content {
  display: block;
}

.christian-chat-card.open {
  border-color: var(--accent);
}

.christian-chat-preview {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.christian-chat-card.open .christian-chat-preview {
  display: none;
}

 
#appScreen.dark-mode .christian-chat-title-row,
#appScreen.dark-mode .christian-chat-title-row strong {
  color: #f5f5f5;
}

#mobileBackButton,
.global-back-button {
  display: none !important;
}

.product-photo-zoomable {
  cursor: zoom-in;
}

.market-photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.market-photo-viewer.open {
  display: flex;
}

.market-photo-viewer-card {
  position: relative;
  width: min(94vw, 720px);
  max-height: 92vh;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.market-photo-viewer-card h3 {
  margin: 0 42px 12px 0;
  font-size: 18px;
}

.market-photo-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.market-photo-viewer-frame {
  width: 100%;
  height: min(68vh, 620px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f1ea;
  border-radius: 14px;
}

.market-photo-viewer-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

.market-photo-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.dark-mode .market-photo-viewer-card {
  background: #181818;
  color: #f5f5f5;
}

.dark-mode .market-photo-viewer-frame {
  background: #0f0f0f;
}

/* =====================================================
   PAGE NOTIFICATIONS
===================================================== */

.notifications-page-card {
  display: grid;
  gap: 14px;
}

.notifications-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notifications-filter-row #notificationsMarkAllReadBtn {
  grid-column: 1 / -1;
}

.notification-filter-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.notifications-list {
  display: grid;
  gap: 12px;
}

.notification-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card-soft);
  color: var(--text);
  padding: 13px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.notification-card.unread {
  border-color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(240, 141, 34, 0.14), transparent 40%),
    var(--card);
}

.notification-card.read {
  opacity: 0.78;
}

.notification-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
}

.notification-card-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.notification-card-text strong {
  color: var(--text);
  font-size: 0.98rem;
}

.notification-card-text small {
  color: var(--muted);
  line-height: 1.35;
  font-weight: 700;
}

.notification-card-text em {
  color: var(--accent);
  font-style: normal;
  font-weight: 800;
  font-size: 0.8rem;
}

.notification-card-action {
  color: var(--accent);
  font-weight: 900;
  white-space: nowrap;
  font-size: 0.82rem;
}

.notification-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.notification-delete-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(173, 65, 65, 0.35);
  border-radius: 999px;
  background: #ffffff;
  color: var(--danger);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.notification-delete-btn:hover {
  background: var(--danger);
  color: #ffffff;
}

#appScreen.dark-mode .notification-delete-btn {
  background: #2a2a2a;
  color: #ffb4b4;
  border-color: #7a4444;
}

#appScreen.dark-mode .notification-delete-btn:hover {
  background: #7a2222;
  color: #ffffff;
}

.notifications-empty {
  padding: 26px 14px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: var(--card-soft);
  color: var(--muted);
  font-weight: 800;
}

.notifications-main-badge {
  position: absolute;
  top: 3px;
  right: 16%;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d92d20;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 19px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

@media (max-width: 520px) {
  .social-tab {
    font-size: 0.58rem;
    padding: 7px 1px;
  }

  .social-icon {
    font-size: 0.95rem;
  }

  .notification-card {
    grid-template-columns: auto 1fr;
  }

  .notification-card-action {
    grid-column: 2;
  }

  .notifications-main-badge {
    top: 2px;
    right: 8%;
  }
}

.notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notifications-close-btn {
  width: auto;
  min-width: 96px;
  padding: 10px 14px;
  border-radius: 14px;
}

@media (max-width: 520px) {
  .notifications-head {
    align-items: flex-start;
  }

  .notifications-close-btn {
    min-width: 82px;
    padding: 9px 12px;
    font-size: 0.85rem;
  }
}
