
:root {
  --bg: #f7f8fc;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e7e9f1;
  --primary: #f59e0b;        /* brand orange — fills, buttons, active states */
  --primary-dark: #d97706;   /* hover / pressed */
  --brand-ink: #b45309;      /* readable orange for text on light surfaces */
  --brand-soft: #fff4e6;     /* warm orange tint for soft backgrounds */
  --ink: #0e1320;            /* near-black for headings / dark surfaces */
  --accent: #16a34a;         /* success / verified green */
  --danger: #e5484d;
  --warning: #f59e0b;
  --shadow: 0 18px 40px rgba(16, 24, 40, .08);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 4px 12px rgba(16,24,40,.05);
}
* { box-sizing: border-box; }
html { overflow-x: hidden; } /* catch-all: nothing wider than viewport */
body {
  margin: 0;
  overflow-x: hidden;
  background: radial-gradient(circle at top left, #fff4e6, transparent 30%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px max(18px, calc((100vw - 1180px)/2));
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.1rem; }
.brand img { width: 38px; height: 38px; }
.nav nav { display: flex; align-items: center; gap: 14px; color: var(--muted); font-weight: 700; flex-wrap: wrap; }
.nav nav a:hover { color: var(--primary); }
.nav-toggle { display: none; border: 0; background: #fff4e6; color: var(--primary); border-radius: 12px; padding: 9px 12px; font-size: 1.2rem; cursor: pointer; }

/* ── Dropdown nav ───────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-dropdown-btn:hover,
.nav-dropdown.active .nav-dropdown-btn { color: var(--primary); }
.nav-caret { font-size: 1.1rem; transition: transform .2s; }
.nav-dropdown.active .nav-caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  /* Hidden by default — only .active shows it */
  display: none;
  position: absolute;
  /* Extra padding-top bridges the gap between button and panel
     so the mouse never "leaves" the element mid-travel */
  top: 100%;
  padding-top: 10px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  z-index: 200;
}
/* Inner panel holds the visual styling */
.nav-dropdown-menu::before {
  content: '';
  display: block;
}
.nav-dropdown-inner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(16,24,40,.14);
  padding: 8px;
}
/* Only .active opens the menu — no hover trigger */
.nav-dropdown.active .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 400;
  transition: background .12s;
}
.nav-dropdown-menu a:hover { background: #fff7ed; color: var(--primary); }
.dd-icon { font-size: 1.2rem; flex-shrink: 0; width: 28px; text-align: center; }
.nav-dropdown-menu a strong { display: block; font-size: .9rem; font-weight: 700; }
.nav-dropdown-menu a small { display: block; font-size: .78rem; color: var(--muted); margin-top: 1px; }
.dd-divider { height: 1px; background: var(--line); margin: 6px 4px; }
.dd-logout strong { color: #dc2626; }
.dd-logout:hover { background: #fff5f5 !important; }
.pill, .button {
  border-radius: 999px;
  background: var(--primary);
  color: #fff !important;
  padding: 10px 16px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  white-space: nowrap;
}
.button:hover { background: var(--primary-dark); }
.button.secondary { background: #fff4e6; color: var(--primary) !important; }
.button.danger { background: var(--danger); }
.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  background: linear-gradient(135deg, #fff, #f3f5f9);
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 42px;
  box-shadow: var(--shadow);
  align-items: center;
}
.hero.enhanced { position: relative; overflow: hidden; }
.hero.enhanced::after {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  right: -90px; bottom: -90px;
  border-radius: 50%;
  background: rgba(0,168,132,.12);
}
.eyebrow { color: var(--primary); font-weight: 900; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; }
.hero h1, .page-title h1 { font-size: clamp(2.1rem, 5vw, 4.5rem); line-height: .95; margin: 12px 0; letter-spacing: -.055em; }
.hero p, .page-title p { color: var(--muted); font-size: 1.15rem; max-width: 720px; }
.hero-img { width: 100%; max-height: 360px; position: relative; z-index: 1; }
.hero-actions, .detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.trust-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.trust-row span {
  background: #fff;
  color: #344054;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  font-weight: 750;
  font-size: .9rem;
}
.stats {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 14px;
  margin: 24px 0;
}
.stats div, .card, .urgent-card, .form-panel, .auth-panel, .fee-box, .seller-box, .message-card, .total-box, .how article, .profile-header, .admin-panel, .chat-panel, .conversation-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 12px 30px rgba(16,24,40,.05);
}
.stats div { padding: 22px; display: grid; gap: 3px; }
.stats strong { font-size: 2rem; }
.stats span, .muted, small { color: var(--muted); }
.how { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 26px 0; }
.how article { padding: 20px; }
.how span {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border-radius: 50%; background: #fff4e6; color: var(--primary); font-weight: 900;
}
.how h3 { margin: 14px 0 6px; }
.how p { color: var(--muted); margin: 0; }
.category-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0; }
.category-strip a {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 14px; font-weight: 800; color: var(--muted);
}
.category-strip a:hover { color: var(--primary); border-color: #fed7aa; }
.section-head {
  display: flex; justify-content: space-between; align-items: end;
  margin: 34px 0 16px; gap: 16px;
}
.section-head h2 { margin: 0 0 4px; font-size: 2rem; letter-spacing: -.03em; }
.section-head p { margin: 0; color: var(--muted); }
.grid.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.card { overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #fff4e6; }
.card-body { padding: 16px; }
.card h3 { margin: 10px 0 6px; font-size: 1.05rem; }
.card-top { display: flex; gap: 8px; flex-wrap: wrap; }
.tag, .badge {
  display: inline-flex; border-radius: 999px; padding: 5px 9px;
  background: #fff4e6; color: var(--primary); font-size: .75rem; font-weight: 850;
}
.tag.featured { background: #fff7e6; color: #b45309; }
.tag.verified { background: #e7fff7; color: #027a48; }
.price-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.price-row strong { font-size: 1.15rem; }
.price-row span { color: var(--accent); font-weight: 800; }
.save-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 12px;
  margin-top: 12px;
  cursor: pointer;
  color: var(--primary);
  font-weight: 850;
}
.urgent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.urgent-card { padding: 18px; border-left: 5px solid var(--line); }
.urgent-card.priority-1 { border-left-color: var(--warning); }
.urgent-card.priority-2 { border-left-color: var(--danger); }
.offer-form { display: grid; gap: 8px; margin-top: 14px; }
.page-title { margin-bottom: 22px; }
.filters {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto; gap: 10px;
  margin-bottom: 24px;
}
.revenue-form { grid-template-columns: repeat(4, 1fr); }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px;
  font: inherit; background: #fff; color: var(--text);
}
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
.form-panel, .auth-panel { padding: 24px; max-width: 760px; }
.form-panel.compact { max-width: 900px; margin-bottom: 24px; }
.form-panel { display: grid; gap: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox { display: flex; align-items: center; gap: 10px; }
.checkbox input { width: auto; }
.upload-box { background: #f9fafb; border: 1px dashed #fed7aa; border-radius: 20px; padding: 16px; display: grid; gap: 12px; }
.detail-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 28px; }
.detail-image, .detail-copy { background: #fff; border: 1px solid var(--line); border-radius: 30px; padding: 24px; box-shadow: var(--shadow); }
.detail-image img { width: 100%; border-radius: 22px; background: #fff4e6; max-height: 620px; object-fit: cover; }
.detail-copy h1 { font-size: clamp(2rem, 4vw, 3.3rem); margin: 14px 0; letter-spacing: -.04em; }
.fee-box, .seller-box { padding: 16px; margin: 14px 0; }
.seller-profile-mini { display: flex; gap: 14px; align-items: center; }
.seller-profile-mini img, .profile-header img {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: #fff4e6;
}
.message-form, .rating-form, .report-box form { display: grid; gap: 10px; margin-top: 16px; }
.report-box { margin-top: 16px; color: var(--muted); }
/* Hide the native browser disclosure triangle — we style summary ourselves */
.report-box > summary { list-style: none; cursor: pointer; }
.report-box > summary::-webkit-details-marker { display: none; }
.report-box > summary::marker { display: none; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 15px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { background: #f3f5f9; }
.total-box { margin-top: 18px; padding: 22px; font-size: 1.35rem; }
.message-list { display: grid; gap: 12px; }
.conversation-row { padding: 14px; display: flex; gap: 14px; align-items: center; }
.conversation-row img { width: 86px; height: 70px; border-radius: 16px; object-fit: cover; background: #fff4e6; }
.conversation-row h3 { margin: 0 0 5px; }
.conversation-row p { color: var(--muted); margin: 0 0 5px; }
.chat-panel { padding: 18px; display: grid; gap: 12px; }
.bubble { width: min(70%, 640px); padding: 14px; border-radius: 18px; background: #f3f5f9; }
.bubble.mine { margin-left: auto; background: #e7fff7; }
.bubble p { margin: 5px 0; }
.chat-compose { display: grid; gap: 10px; margin-top: 16px; }
.profile-header { padding: 24px; display: flex; gap: 20px; align-items: center; }
.profile-header img { width: 110px; height: 110px; }
.profile-header h1 { margin: 8px 0 4px; font-size: 3rem; letter-spacing: -.04em; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-panel { padding: 18px; }
.admin-panel.wide { grid-column: 1 / -1; }
.admin-row { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.admin-row.horizontal { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flash-wrap { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 16px; background: #fff4e6; font-weight: 700; pointer-events: all; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.flash.error { background: #fff0f0; color: var(--danger); }
.flash.success { background: #ecfdf3; color: #027a48; }
.flash-msg { flex: 1; }
.flash-close { flex-shrink: 0; background: none; border: none; cursor: pointer; font-size: 1.25rem; line-height: 1; opacity: .55; padding: 0 2px; color: inherit; }
.flash-close:hover { opacity: 1; }
.empty { grid-column: 1/-1; background: #fff; border: 1px dashed var(--line); border-radius: 24px; padding: 28px; text-align: center; color: var(--muted); }
.auth-panel { margin: 30px auto; }
.auth-panel form { display: grid; gap: 14px; }
/* ── Footer ──────────────────────────────────────────── */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  margin-top: 3rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr);
  gap: 2.5rem;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 3rem 0 2rem;
}
.footer-brand p {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
  margin: .75rem 0 0;
  max-width: 240px;
}
.footer-col h4 {
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin: 0 0 .85rem;
}
.footer-col a {
  display: block;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  padding: .25rem 0;
  transition: color .15s;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: .85rem;
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--primary); }
/* ══════════════════════════════════════════════════════════
   RESPONSIVE — three breakpoints:
   Tablet  : max-width 900px
   Mobile  : max-width 640px
   XSmall  : max-width 420px
   ══════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 900px) ─────────────────────────────────── */
@media (max-width: 900px) {
  /* Nav: hamburger */
  .nav { flex-wrap: wrap; align-items: center; }
  .nav-toggle { display: block; }
  .nav nav {
    display: none; width: 100%;
    flex-direction: column; align-items: stretch;
    padding: 8px 0 12px;
    border-top: 1px solid var(--line);
  }
  .nav nav.open { display: flex; }
  .nav-dropdown-menu { position: static; transform: none; padding-top: 4px; }
  .nav-dropdown-inner { box-shadow: none; border-radius: 10px; }
  .nav-dropdown-btn { width: 100%; padding: 10px 0; min-height: 44px; }
  .nav-dropdown-menu a { min-height: 44px; padding: 10px 12px; }

  /* Layouts → single column */
  .hero               { grid-template-columns: 1fr; padding: 28px; }
  .detail-layout      { grid-template-columns: 1fr; }
  .checkout-layout    { grid-template-columns: 1fr; }
  .settings-layout    { grid-template-columns: 1fr; }
  .admin-grid         { grid-template-columns: 1fr; }
  .wallet-hero        { grid-template-columns: 1fr; }
  .preview-panel      { position: static; }

  /* Grids */
  .grid.cards         { grid-template-columns: repeat(2, 1fr); }
  .stats              { grid-template-columns: repeat(2, 1fr); }
  .how                { grid-template-columns: repeat(2, 1fr); }
  .urgent-grid        { grid-template-columns: 1fr; }

  /* Forms */
  .three-col          { grid-template-columns: 1fr 1fr; }
  .two-col            { grid-template-columns: 1fr; }
  .filters            { grid-template-columns: 1fr 1fr; }

  /* Footer */
  .footer-inner       { grid-template-columns: 1fr 1fr; }
  .footer-brand       { grid-column: 1 / -1; }

  /* Tables: scroll horizontally rather than overflow page */
  .admin-panel        { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table              { min-width: 540px; }

  /* Misc */
  .bubble             { width: min(90%, 640px); }
}

/* ── Mobile (≤ 640px) ─────────────────────────────────── */
@media (max-width: 640px) {
  main { width: calc(100% - 24px); padding: 20px 0 100px; }

  /* Typography */
  .hero h1, .page-title h1 { font-size: clamp(1.8rem, 8vw, 2.8rem); }
  .detail-copy h1            { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .profile-header h1         { font-size: 2rem; }
  .section-head h2           { font-size: 1.5rem; }
  .wallet-hero h2            { font-size: 2.2rem; }

  /* Hero */
  .hero              { padding: 20px; gap: 16px; }
  .hero-img          { display: none; }   /* hide illustration on phones */
  .hero-actions      { flex-direction: column; }
  .hero-actions .button, .hero-actions .pill { width: 100%; text-align: center; }

  /* Cards: single column */
  .grid.cards        { grid-template-columns: 1fr; }
  .stats             { grid-template-columns: 1fr 1fr; }
  .how               { grid-template-columns: 1fr; }

  /* Forms: fully stacked */
  .three-col         { grid-template-columns: 1fr; }
  .two-col           { grid-template-columns: 1fr; }
  .filters           { grid-template-columns: 1fr; }

  /* All action rows stack vertically */
  .detail-actions,
  .hero-actions,
  .admin-actions,
  .mini-form,
  .topup-form        { flex-direction: column; align-items: stretch; }

  /* Profile */
  .profile-header    { flex-direction: column; align-items: flex-start; gap: 12px; }
  .profile-header img { width: 80px; height: 80px; }

  /* Chat */
  .bubble            { width: 100%; }
  .conversation-row  { flex-wrap: wrap; }
  .conversation-row img { width: 64px; height: 52px; }

  /* Admin panels */
  .admin-panel       { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table             { min-width: 480px; }

  /* Mobile bottom nav */
  main { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .mobile-bottom-nav { display: flex; bottom: max(12px, env(safe-area-inset-bottom, 12px)); }
  /* Hide duplicate links from top nav on mobile */
  .nav nav a[href*="marketplace"],
  .nav nav a[href*="new_listing"],
  .nav nav a[href*="inbox"],
  .nav nav a[href*="payments"] { display: none; }

  /* Touch targets — iOS requires ≥ 44px */
  .button, button, input, select, textarea { min-height: 44px; }
  input, select, textarea { font-size: 16px !important; } /* prevent iOS zoom */

  /* Admin tabs: horizontal scroll, no wrap */
  .admin-tabs {
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 4px;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }

  /* Admin settings overlays */
  .psb { bottom: 80px !important; right: 16px !important; }
  .ps-dr { width: 100vw !important; max-width: 100vw !important; right: -100vw !important; }
  .ps-dr.on { right: 0 !important; }

  /* Filter chips & market search row */
  .mkt-filter-row    { flex-direction: column; }
  .mkt-select        { width: 100%; }
  .mkt-price-range   { width: 100%; }
  .mkt-price-input   { flex: 1; width: auto; min-width: 0; }
  .mkt-tb-btn        { width: 100%; }

  /* Listing detail seller box */
  .seller-profile-mini { flex-wrap: wrap; }

  /* Footer */
  .footer-inner      { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom     { flex-direction: column; align-items: flex-start; }
}

/* ── Extra-small (≤ 420px) ────────────────────────────── */
@media (max-width: 420px) {
  main { width: calc(100% - 16px); }
  .hero { padding: 16px; }
  .stats { grid-template-columns: 1fr; }
  .card-body { padding: 12px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .mkt-search-bar { padding: 4px 4px 4px 10px; }
  .mkt-q-input { font-size: 15px; }
  .mkt-chips { gap: 4px; }
  .mkt-chip { font-size: .72rem; padding: 2px 8px; }
}

.campus-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .85rem;
}
select optgroup {
  font-weight: 900;
  color: var(--text);
}
.checkout-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: start; }
.checkout-summary { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 18px; }
.checkout-summary img { width: 100%; border-radius: 18px; background: #fff4e6; aspect-ratio: 4/3; object-fit: cover; }
.checkout-form h2 { margin-top: 0; }
.payment-option { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #fff; }
.payment-option input { width: auto; margin-top: 4px; }
.payment-option span { display: grid; gap: 4px; }
.payment-option small { color: var(--muted); font-weight: 500; }
.payment-option em { color: var(--accent); font-style: normal; font-weight: 850; }
.buy-button { margin-top: 10px; }
/* checkout-layout responsive handled in main breakpoints above */


.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
  gap: 22px;
  align-items: start;
}
.settings-form {
  max-width: none;
}
.settings-form h2 {
  margin: 20px 0 0;
  letter-spacing: -.02em;
}
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.preview-panel {
  position: sticky;
  top: 86px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.preview-form {
  display: grid;
  gap: 10px;
}
.fee-preview-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-top: 12px;
  background: #f9fafb;
}
.fee-preview-card h3 {
  margin: 0 0 8px;
}
.fee-preview-card p {
  margin: 6px 0;
  color: var(--muted);
}
/* settings-layout / three-col / preview-panel responsive handled in main breakpoints above */

.wallet-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  background: linear-gradient(135deg, #fff, #fff4e6);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.wallet-hero h2 {
  font-size: 3rem;
  margin: 8px 0;
  letter-spacing: -.04em;
}
.topup-form, .mini-form, .admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}
.mini-form input {
  min-width: 130px;
}
/* wallet-hero responsive handled in main breakpoints above */

.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 24px;
}
.admin-tabs a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 850;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(245,158,11,.15);
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-tabs a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.nav-notif-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger, #e53e3e);
  color: #fff;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 900;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin: 0 3px;
  vertical-align: middle;
  line-height: 1;
}
.nav-notif-dot--urgent {
  background: #f59e0b;  /* amber for urgency */
}
/* Badge shown next to individual dropdown items */
.dd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger, #e53e3e);
  color: #fff;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 900;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 1;
}
.dd-badge--urgent {
  background: #f59e0b;
  color: #fff;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.inline-check input {
  width: auto;
}
.admin-row.horizontal input,
.admin-row.horizontal select {
  min-width: 140px;
}

.detail-facts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.detail-facts span {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 700;
}
.admin-row.unread {
  background: #f9fafb;
  border-radius: 16px;
  padding-left: 12px;
}


/* Mobile bottom nav — hidden on desktop, shown via media query */
.mobile-bottom-nav {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 30;
  display: none;
  justify-content: space-around;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 10px;
}
.advanced-filters {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}


.terms-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f9fafb;
  padding: 16px;
  margin: 16px 0;
}
.terms-scroll {
  white-space: pre-wrap;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  margin: 12px 0;
  font-size: .92rem;
  line-height: 1.55;
}

/* ── Enhanced card features ────────────────────────────────── */
.card-img-link { position: relative; display: block; }
.card-status-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: .7rem; font-weight: 800; padding: 3px 10px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .04em;
}
.card-status-badge.sold { background: #065f46; color: #fff; }
.card-status-badge.rented { background: #1d4ed8; color: #fff; }
.card-status-badge.expired { background: #6b7280; color: #fff; }
.card-sold { opacity: .75; }
.card-expired { opacity: .65; }
.card-meta { display: flex; gap: 10px; font-size: .72rem; color: #9ca3af; margin: 4px 0; }
.card-rating { margin: 2px 0 4px; font-size: .88rem; }
.save-btn.saved { color: #ef4444; }

/* ── Block user ───────────────────────────────────────────── */
.block-form button { background: none; border: none; color: #9ca3af; font-size: .75rem; cursor: pointer; padding: 0; text-decoration: underline; }
.block-form button:hover { color: #ef4444; }

/* ── Bump listing ─────────────────────────────────────────── */
.bump-box { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 12px 16px; margin: 10px 0; }
.bump-box h4 { margin: 0 0 4px; font-size: .88rem; color: #92400e; }
.bump-box p  { margin: 0 0 8px; font-size: .78rem; color: #b45309; }

/* ── Referral box ─────────────────────────────────────────── */
.referral-box { background: #f0fdf4; border: 1px solid #6ee7b7; border-radius: 12px; padding: 16px 20px; margin: 16px 0; }
.referral-box h3 { margin: 0 0 6px; font-size: .95rem; color: #065f46; }
.referral-box p  { margin: 0 0 10px; font-size: .82rem; color: #047857; }
.referral-link { background: #fff; border: 1px solid #6ee7b7; border-radius: 8px; padding: 8px 12px; font-size: .82rem; font-family: monospace; word-break: break-all; }
.copy-btn { background: #065f46; color: #fff; border: none; border-radius: 6px; padding: 6px 14px; font-size: .78rem; font-weight: 700; cursor: pointer; margin-top: 8px; }

/* ── Wishlist ─────────────────────────────────────────────── */
.wishlist-card { background: #fff; border: 1px solid #e7e9f1; border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; display: flex; align-items: center; gap: 14px; }
.wishlist-card h4 { margin: 0 0 2px; font-size: .9rem; font-weight: 700; }
.wishlist-card p  { margin: 0; font-size: .78rem; color: #6b7280; }
.wishlist-fulfilled { opacity: .5; text-decoration: line-through; }

/* ── Star rating display ──────────────────────────────────── */
.star-row { color: #f59e0b; letter-spacing: 1px; }
.star-row .empty { color: #d1d5db; }

/* ── Expiry warning ───────────────────────────────────────── */
.expiry-warning { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 10px 14px; margin: 8px 0; font-size: .82rem; color: #c2410c; }

/* ══════════════════════════════════════════════════════════════
   GLOBAL MOBILE TOUCH OPTIMISATIONS
   These apply site-wide, not just at specific breakpoints.
   ══════════════════════════════════════════════════════════════ */

/* Remove 300ms tap delay on all interactive elements */
a, button, .button, .pill, .save-btn, .nav-toggle,
.nav-dropdown-btn, .admin-tabs a, .ps-tab,
input[type="submit"], input[type="button"], input[type="reset"],
label[for], summary {
  touch-action: manipulation;
}

/* ── Mobile bottom nav: better tap targets & active state ── */
.mobile-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-radius: 14px;
  font-size: .78rem;
  transition: background .12s, color .12s;
  min-height: 44px;
}
.mobile-bottom-nav a:active {
  background: #fff4e6;
  color: var(--primary);
}

/* nav z-index on mobile (handled via breakpoints above) */

/* ══════════════════════════════════════════════════════════
   DEVICE-CLASS STYLES  (set by inline JS before first paint)
   .device-mobile / .device-tablet / .device-desktop on <html>
   ══════════════════════════════════════════════════════════ */

/* Search button: icon-only on mobile to save space */
.device-mobile .mkt-btn-text   { display: none; }
.device-mobile .mkt-search-btn { padding: 10px 12px; border-radius: 12px; min-width: 44px; }
.device-mobile .mkt-btn-icon   { display: block; }
.device-desktop .mkt-btn-icon,
.device-tablet  .mkt-btn-icon  { display: none; }

/* Search bar: slightly smaller on mobile */
.device-mobile .mkt-search-bar { padding: 4px 4px 4px 12px; }
.device-mobile .mkt-q-input    { font-size: 15px; }

/* Category select: full-width label */
.device-mobile .mkt-meta       { flex-direction: column; align-items: flex-start; gap: 6px; }

/* Cards: tighter on mobile */
.device-mobile .card-body      { padding: 12px; }
.device-mobile .card h3        { font-size: .95rem; margin: 6px 0 4px; }

/* Profile stat row: wrap on mobile */
.device-mobile .profile-stats  { flex-wrap: wrap; gap: 8px; }

/* Inline flex rows that can overflow: force wrap */
.device-mobile .detail-facts   { gap: 5px; }
.device-mobile .detail-facts span { font-size: .8rem; padding: 5px 8px; }

/* New listing form fee summary: no overflow */
.device-mobile .fee-box        { font-size: .88rem; }

/* Inbox / chat: message bubbles full width on mobile */
.device-mobile .bubble         { width: 100%; max-width: 100%; }

/* My listings: action buttons stack and fill width */
.device-mobile .my-listing-actions { width: 100%; flex-wrap: wrap; }
.device-mobile .my-listing-actions .button,
.device-mobile .my-listing-actions form { flex: 1; min-width: 120px; }
.device-mobile .my-listing-actions .button { text-align: center; justify-content: center; }

/* Price alerts / reports: stat cards wrap */
.device-mobile .report-stats   { flex-wrap: wrap; }
.device-mobile .report-stats > div { flex: 1; min-width: 80px; }

/* Admin tabs: always scroll, never wrap */
.device-mobile .admin-tabs     { flex-wrap: nowrap !important; overflow-x: auto; }

/* Page title: tighter on mobile */
.device-mobile .page-title     { margin-bottom: 14px; }
.device-mobile .page-title h1  { margin: 6px 0; }

/* Prevent any direct child of main from overflowing */
main > * { max-width: 100%; }
img      { max-width: 100%; height: auto; }

/* ══════════════════════════════════════════════════════════
   DESIGN-SYSTEM POLISH LAYER  (orange + near-black refresh)
   Appended 2026 — readable text colors, softer cards,
   refined buttons, focus rings, badges. Keeps CampusSouq id.
   ══════════════════════════════════════════════════════════ */

/* — Readable orange text on light surfaces (contrast-safe) — */
.eyebrow,
.tag, .badge,
.how span,
.save-btn,
.button.secondary,
.category-strip a:hover { color: var(--brand-ink); }
.tag, .badge { background: var(--brand-soft); }
.button.secondary { background: var(--brand-soft); }
.how span { background: var(--brand-soft); }

/* — Buttons: a touch more polish — */
.pill, .button {
  box-shadow: 0 2px 6px rgba(245,158,11,.25);
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
  font-weight: 800;
}
.pill:hover, .button:hover { box-shadow: 0 6px 16px rgba(245,158,11,.30); }
.pill:active, .button:active { transform: translateY(1px); }
.button.secondary { box-shadow: none; }
.button.secondary:hover { background: #ffe9cc; }
.button.danger { box-shadow: 0 2px 6px rgba(229,72,77,.25); }
.button.ghost {
  background: #fff; color: var(--text) !important;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.button.ghost:hover { background: #f9fafb; border-color: #d1d5db; }

/* — Cards: softer, consistent shadow + hover lift — */
.stats div, .card, .urgent-card, .form-panel, .auth-panel, .fee-box,
.seller-box, .message-card, .total-box, .how article, .profile-header,
.admin-panel, .chat-panel, .conversation-row {
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow); }

/* — Inputs: clean focus ring in brand color — */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245,158,11,.18);
}

/* — Status badges (shared, used across admin + user) — */
.s-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .01em;
  text-transform: capitalize; line-height: 1.4; white-space: nowrap;
}
.s-badge.active,  .s-badge.approved, .s-badge.verified,
.s-badge.confirmed, .s-badge.paid, .s-badge.yes        { background:#dcfce7; color:#15803d; }
.s-badge.pending, .s-badge.pending-verification        { background:#fef3c7; color:#b45309; }
.s-badge.sold,    .s-badge.completed                   { background:#dbeafe; color:#1d4ed8; }
.s-badge.rejected,.s-badge.suspended, .s-badge.banned,
.s-badge.disputed, .s-badge.failed                     { background:#fee2e2; color:#b91c1c; }
.s-badge.expired, .s-badge.draft, .s-badge.no,
.s-badge.refunded                                      { background:#f1f5f9; color:#475569; }
.s-badge.rented                                        { background:#ede9fe; color:#6d28d9; }
.s-badge.urgent                                        { background:#ffedd5; color:#c2410c; }

/* — Tables: cleaner header + zebra hover — */
.table { box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.table th {
  background: #fafbfc; color: var(--muted);
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
}
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #fcfcfe; }
.table tbody tr:last-child td { border-bottom: none; }

/* — Toggle switch (settings) — */
.toggle { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .track {
  position: absolute; inset: 0; cursor: pointer; background: #cbd5e1;
  border-radius: 999px; transition: background .18s;
}
.toggle .track::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.toggle input:checked + .track { background: var(--primary); }
.toggle input:checked + .track::before { transform: translateX(20px); }

/* — Empty state polish — */
.empty { background: #fff; border: 1px dashed #d8dbe6; border-radius: 20px; padding: 40px 28px; }
.empty .empty-icon { font-size: 2.4rem; opacity: .55; display: block; margin-bottom: 8px; }

/* — Skeleton loading shimmer — */
.skeleton {
  background: linear-gradient(90deg, #eef0f4 25%, #f6f7fa 50%, #eef0f4 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 10px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
