* {
  font-family: 'Tajawal', 'Cairo', Arial, sans-serif;
}

input,
button,
.otp-box,
.pin-key {
  font-family: Arial, sans-serif !important;
}

* {
  font-variant-numeric: normal;
  unicode-bidi: plaintext;
}

body,
input,
button,
textarea {
  font-feature-settings: normal;
}

/* ══════════════════════════════════════════════════════
   ROOT VARIABLES
══════════════════════════════════════════════════════ */
:root {
  --gold: #C9A84C;
  --gold-l: #F0D878;
  --gold-d: #8A6520;
  --navy: #08101E;
  --n2: #0F1A2E;
  --n3: #162035;
  --nb: #1C2D4A;
  --white: #EEE8DC;
  --muted: #7A8BAA;
  --red: #E85050;
  --green: #2ECC71;
  --blue: #3B82F6;
  --ws: #25D366;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: calc(64px + var(--safe-b));
  --top-h: calc(58px + var(--safe-t));
  --sidebar-w: 240px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

input,
textarea,
select,
[contenteditable] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* ★ FIX: Restore tap highlight on ALL interactive elements.
   The global transparent tap-highlight makes buttons feel dead on mobile.
   This gives instant visual feedback when any button/link is touched. */
button,
a,
[onclick],
.tab,
.card,
.btn-gold,
.btn-primary,
.btn-outline,
.f-submit,
.re-tab-btn,
.pin-key {
  -webkit-tap-highlight-color: rgba(201, 168, 76, .15);
}

/* Ensure all buttons respond to touch immediately */
button:active,
[onclick]:active,
.tab:active {
  opacity: .8;
  transition: none !important;
}

html,
body {
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
  max-width: 100vw;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--navy);
  color: var(--white);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

body,
input,
button,
span,
div,
td,
th {
  font-variant-numeric: normal;
  font-feature-settings: "lnum" 1;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gold-d);
  border-radius: 2px;
}

input,
select,
textarea,
button {
  font-family: 'Tajawal', sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
}

img,
video {
  max-width: 100%;
  height: auto;
}

/* ══════════════════════════════════════════════════════
   VIEWS — only one visible at a time
══════════════════════════════════════════════════════ */
.view {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-x: hidden;
}

.view.active {
  display: flex;
}

/* ══════════════════════════════════════════════════════
   AUTH VIEW
══════════════════════════════════════════════════════ */
#auth-view {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: radial-gradient(ellipse 80% 80% at 50% 0%, rgba(201, 168, 76, .07), transparent 60%), var(--navy);
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top, 24px));
  padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-card,
.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 24px;
  padding: 28px 20px 32px;
  margin: 0 auto;
  animation: fadeUp .5s both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes akidSpin {
  to {
    transform: rotate(360deg);
  }
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-ico {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}

.auth-logo-ico img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.auth-logo h1 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 2px;
}

.auth-logo p {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.auth-step {
  display: none;
}

.auth-step.on {
  display: block;
}

.auth-title {
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.6;
}

/* Phone input */
.phone-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1.5px solid var(--nb);
  border-radius: 12px;
  overflow: hidden;
  background: var(--n2);
  margin-bottom: 16px;
  transition: border-color .2s;
}

.phone-row:focus-within {
  border-color: var(--gold);
}

.phone-flag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: var(--n3);
  border-right: 1.5px solid var(--nb);
  font-size: .9rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 80px;
  justify-content: center;
}

#phone-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px 12px;
  color: var(--white);
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  direction: ltr;
  min-width: 0;
}

#phone-input::placeholder {
  color: var(--muted);
  font-size: .9rem;
}

/* OTP boxes */
.otp-wrap {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}

.otp-box {
  width: 46px;
  height: 54px;
  background: var(--n2);
  border: 1.5px solid var(--nb);
  border-radius: 10px;
  color: var(--white);
  font-family: 'Cairo', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  outline: none;
  transition: border-color .2s;
  direction: ltr;
}

.otp-box:focus {
  border-color: var(--gold);
}

input[inputmode="numeric"],
input[type="number"],
input[type="tel"],
.otp-box {
  font-variant-numeric: normal;
  -webkit-text-security: none;
}

input[type="text"],
input[type="tel"],
input[type="number"],
.otp-box {
  -webkit-text-stroke: 0;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}

/* PIN dots */
.pin-dots {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 20px 0 10px;
}

.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--nb);
  transition: all .2s;
}

.pin-dot.filled {
  background: var(--gold);
  border-color: var(--gold);
}

/* PIN pad */
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 280px;
  margin: 0 auto 8px;
}

.pin-key {
  min-height: 54px;
  min-width: 54px;
  padding: 14px;
  background: var(--n2);
  border: 1px solid var(--nb);
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.pin-key:active {
  background: var(--nb);
  transform: scale(.95);
}

.pin-key.del {
  font-size: 1rem;
  color: var(--muted);
}

.pin-key.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

/* Buttons */
/* Instant button response — remove all lag */
button,
.auth-btn,
.act-btn,
.nav-btn,
.tbl-action,
[onclick],
.auction-card,
.kpi-card {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
  user-select: none;
}

.auth-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border: none;
  border-radius: 14px;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .1s, opacity .1s;
  will-change: transform;
  box-shadow: 0 5px 20px rgba(201, 168, 76, .3);
  margin-top: 8px;
}

.auth-btn:active {
  transform: scale(.97);
  opacity: .85;
}

.auth-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.auth-link {
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  margin-top: 12px;
}

.auth-link span {
  color: var(--gold);
  cursor: pointer;
  font-weight: 700;
}

.auth-info-box {
  background: rgba(201, 168, 76, .07);
  border: 1px solid rgba(201, 168, 76, .18);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.65;
}

.auth-info-box strong {
  color: var(--gold-l);
}

.otp-demo {
  text-align: center;
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(46, 204, 113, .08);
  border: 1px solid rgba(46, 204, 113, .2);
  border-radius: 8px;
  font-size: .8rem;
  color: var(--green);
}

/* ══════════════════════════════════════════════════════
   MAIN APP VIEW — RESPONSIVE
══════════════════════════════════════════════════════ */
#app-view {
  flex-direction: column;
}

/* ── MOBILE LAYOUT (default) ── */
#mobile-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

#topbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 50;
  height: var(--top-h);
  padding-top: var(--safe-t);
  background: rgba(8, 16, 30, .95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(201, 168, 76, .1);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 10px;
  padding-inline: 16px;
}

.tbar-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Cairo', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--gold);
  cursor: pointer;
}

.tbar-ico {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
}

.tbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: rgba(232, 80, 80, .1);
  border: 1px solid rgba(232, 80, 80, .25);
  border-radius: 100px;
  font-size: .68rem;
  color: var(--red);
  font-weight: 700;
}

.ldot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .3;
    transform: scale(1.8);
  }
}

.icon-btn {
  width: 34px;
  height: 34px;
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  cursor: pointer;
  transition: all .15s;
}

.icon-btn:active {
  transform: scale(.9);
}

/* PAGES */
#pages {
  flex: 1;
  margin-top: var(--top-h);
  margin-bottom: var(--tab-h);
  overflow: hidden;
  overflow-x: hidden;
  position: relative;
  max-width: 100vw;
}

.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
  transition: opacity .22s, transform .22s;
}

.page.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

/* BOTTOM NAV */
#bottomnav {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 50;
  height: var(--tab-h);
  padding-bottom: var(--safe-b);
  background: rgba(10, 16, 28, .97);
  backdrop-filter: blur(24px);
  border-top: 1px solid rgba(201, 168, 76, .1);
  display: flex;
  align-items: flex-start;
  padding-top: 8px;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 2px 0;
  position: relative;
}

.tab:active {
  transform: scale(.9);
}

.tab-ico {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform .2s;
}

.tab-lbl {
  font-size: .6rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .2s;
}

.tab.on .tab-lbl {
  color: var(--gold);
}

.tab.on .tab-ico {
  transform: scale(1.12);
}

.tab-bar {
  position: absolute;
  top: -8px;
  width: 26px;
  height: 3px;
  background: var(--gold);
  border-radius: 0 0 3px 3px;
  opacity: 0;
  transition: opacity .2s;
}

.tab.on .tab-bar {
  opacity: 1;
}

.tab-post .post-btn-wrap {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 16px rgba(201, 168, 76, .4);
  margin-top: -18px;
  transition: all .2s;
}

.tab-post:active .post-btn-wrap {
  transform: scale(.9);
}

/* ── DESKTOP SIDEBAR LAYOUT ── */
#desktop-app {
  display: none;
  width: 100%;
  height: 100%;
}

#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--n3);
  border-left: 1px solid var(--nb);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 20px;
}

.sb-logo {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--nb);
  margin-bottom: 12px;
}

.sb-logo span {
  font-family: 'Cairo', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold);
}

.sb-ico {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.sb-user {
  margin: 0 12px 14px;
  padding: 12px;
  background: var(--n2);
  border: 1px solid var(--nb);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sb-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold-d), var(--nb));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sb-user-name {
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.sb-user-bal {
  font-size: .7rem;
  color: var(--gold);
}

.sb-nav {
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .18s;
  font-size: .86rem;
  font-weight: 600;
  color: var(--muted);
}

.sb-link:hover {
  background: rgba(201, 168, 76, .07);
  color: var(--white);
}

.sb-link.on {
  background: rgba(201, 168, 76, .12);
  color: var(--gold);
}

.sb-link-ico {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.sb-section {
  padding: 8px 20px 4px;
  font-size: .65rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-top: 8px;
}

.sb-logout {
  margin: 16px 12px 0;
  padding: 11px;
  background: rgba(232, 80, 80, .08);
  border: 1px solid rgba(232, 80, 80, .2);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .83rem;
  font-weight: 700;
  color: var(--red);
  transition: all .18s;
}

.sb-logout:hover {
  background: rgba(232, 80, 80, .15);
}

#desktop-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#desktop-topbar {
  padding: 16px 28px;
  background: rgba(8, 16, 30, .95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201, 168, 76, .1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.dt-title {
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
}

.dt-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dt-live {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(232, 80, 80, .1);
  border: 1px solid rgba(232, 80, 80, .25);
  border-radius: 100px;
  font-size: .75rem;
  color: var(--red);
  font-weight: 700;
}

.dt-wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 700;
}

.dt-wallet-amt {
  color: var(--gold);
}

.btn-gold {
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border: none;
  border-radius: 9px;
  color: var(--navy);
  font-size: .85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(201, 168, 76, .3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201, 168, 76, .45);
}

.btn-gold:active {
  transform: scale(.95) !important;
  box-shadow: 0 2px 8px rgba(201, 168, 76, .4);
  opacity: .85;
}

#desktop-pages {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.dpage {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 28px;
  display: none;
}

.dpage.active {
  display: block;
}

/* ══════════════════════════════════════════════════════
   SHARED COMPONENTS
══════════════════════════════════════════════════════ */
/* Cards */
.card {
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 14px;
  overflow: hidden;
}

.ac-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #162035, #0a1628);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  position: relative;
}

.ac-thumb.wide {
  aspect-ratio: 16/9;
  font-size: 3.5rem;
}

.ac-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: .62rem;
  font-weight: 700;
}

.b-live {
  background: rgba(232, 80, 80, .9);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 3px;
}

.b-hot {
  background: rgba(201, 168, 76, .9);
  color: var(--navy);
}

.b-new {
  background: rgba(46, 204, 113, .12);
  border: 1px solid rgba(46, 204, 113, .3);
  color: var(--green);
}

.b-end {
  background: rgba(232, 80, 80, .1);
  border: 1px solid rgba(232, 80, 80, .3);
  color: var(--red);
}

.bid-cnt {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 3px 7px;
  background: rgba(8, 16, 30, .82);
  border-radius: 100px;
  font-size: .62rem;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Grid / scroll */
.v-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}

.v-grid.cols3 {
  grid-template-columns: repeat(3, 1fr);
}

.v-grid.single {
  grid-template-columns: 1fr;
}

.h-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 16px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.h-scroll::-webkit-scrollbar {
  display: none;
}

.h-scroll>* {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Section */
.sec-pad {
  padding: 16px;
}

.sec-title {
  font-family: 'Cairo', sans-serif;
  font-size: .98rem;
  font-weight: 900;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sec-title a {
  font-size: .72rem;
  color: var(--gold);
  font-weight: 600;
  cursor: pointer;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  background: rgba(201, 168, 76, .09);
  border: 1px solid rgba(201, 168, 76, .2);
  border-radius: 100px;
  font-size: .67rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* Chips */
.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 16px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  white-space: nowrap;
  padding: 7px 14px;
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .18s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chip:active {
  transform: scale(.95);
}

.chip.on {
  background: rgba(201, 168, 76, .12);
  border-color: var(--gold);
  color: var(--gold);
}

/* AC grid card */
.ac-card,
.auction-card {
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .1s;
  will-change: transform;
}

.ac-card:active,
.auction-card:active {
  transform: scale(.98);
}

.ac-info {
  padding: 10px 11px;
}

.ac-cat {
  font-size: .62rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 3px;
}

.ac-name {
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.ac-pr {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ac-price {
  font-family: 'Cairo', sans-serif;
  font-size: .9rem;
  font-weight: 900;
  color: var(--gold);
}

.ac-timer {
  font-family: 'Cairo', sans-serif;
  font-size: .7rem;
  font-weight: 700;
  color: var(--red);
}

/* Wide card */
.ac-wide {
  width: 230px;
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
}

.ac-wide:active {
  transform: scale(.97);
}

.ac-wide-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #162035, #0a1628);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
}

.ac-wide-body {
  padding: 10px 12px;
}

.ac-wide-name {
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.ac-wide-price {
  color: var(--gold);
  font-weight: 900;
  font-size: .86rem;
}

.ac-wide-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3px;
}

/* Property card */
.prop-card {
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s;
}

.prop-card:active {
  transform: scale(.98);
}

.prop-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #162035, #0a1628);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
}

.prop-body {
  padding: 14px;
}

.prop-tag {
  font-size: .65rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.prop-name {
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.35;
}

.prop-specs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.prop-spec {
  font-size: .72rem;
  color: var(--muted);
}

.prop-pr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(201, 168, 76, .07);
  border: 1px solid rgba(201, 168, 76, .13);
  border-radius: 9px;
  padding: 9px 11px;
}

.prop-price {
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--gold);
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px;
  margin: 12px 0;
}

.stat-box {
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}

.stat-n {
  font-family: 'Cairo', sans-serif;
  font-size: .95rem;
  font-weight: 900;
  color: var(--gold);
}

.stat-l {
  font-size: .58rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Wallet card */
.wallet-card {
  background: linear-gradient(135deg, var(--n3), var(--n2));
  border: 1px solid rgba(201, 168, 76, .25);
  border-radius: 16px;
  padding: 18px;
  margin: 0 16px 16px;
}

.wc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.wc-label {
  font-size: .72rem;
  color: var(--muted);
}

.wc-balance {
  font-family: 'Cairo', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold);
}

.wc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wc-item {
  background: var(--navy);
  border: 1px solid var(--nb);
  border-radius: 10px;
  padding: 10px;
}

.wc-item-lbl {
  font-size: .65rem;
  color: var(--muted);
  margin-bottom: 3px;
}

.wc-item-val {
  font-family: 'Cairo', sans-serif;
  font-size: .92rem;
  font-weight: 900;
}

/* Live ticker */
.live-strip {
  background: var(--n2);
  border-top: 1px solid var(--nb);
  border-bottom: 1px solid var(--nb);
  padding: 0 14px;
  overflow: hidden;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.live-strip-lbl {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  color: var(--red);
  font-weight: 700;
  white-space: nowrap;
}

.strip-scroll {
  flex: 1;
  overflow: hidden;
}

.strip-inner {
  display: flex;
  gap: 22px;
  white-space: nowrap;
  animation: stripMove 22s linear infinite;
}

@keyframes stripMove {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.strip-item {
  font-size: .7rem;
  color: var(--muted);
}

.strip-item span {
  color: var(--gold);
  font-weight: 700;
}

/* Hero banner */
.home-hero {
  margin: 12px 16px;
  background: linear-gradient(135deg, var(--n3), #0d1e3a);
  border: 1px solid var(--nb);
  border-radius: 18px;
  padding: 20px 16px;
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: -30px;
  left: -30px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(201, 168, 76, .1), transparent 70%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  background: rgba(201, 168, 76, .1);
  border: 1px solid rgba(201, 168, 76, .22);
  border-radius: 100px;
  font-size: .7rem;
  color: var(--gold-l);
  font-weight: 600;
  margin-bottom: 10px;
}

.home-hero h1 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 7px;
}

.home-hero h1 em {
  font-style: normal;
  background: linear-gradient(130deg, var(--gold-l), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-hero p {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
}

.hero-btns {
  display: flex;
  gap: 8px;
}

.btn-primary {
  flex: 1;
  padding: 11px 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border: none;
  border-radius: 10px;
  color: var(--navy);
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 16px rgba(201, 168, 76, .3);
  transition: all .18s;
}

.btn-primary:active {
  transform: scale(.97);
}

.btn-outline {
  flex: 1;
  padding: 11px 6px;
  background: transparent;
  border: 1.5px solid rgba(238, 232, 220, .15);
  border-radius: 10px;
  color: var(--white);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* ══════════════════════════════════════════════════════
   BOTTOM SHEET
══════════════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.overlay.open {
  display: flex;
}

/* ★ FIX: When any overlay/sheet is open, disable touch on nav bars.
   Applied via JS: body.overlay-open class is toggled by openSheet/closeSheet.
   This fixes the "buttons only work after scrolling" bug on mobile. */
body.overlay-open #bottomnav,
body.overlay-open #topbar {
  pointer-events: none !important;
}

/* Also fix for the auction-confirm-overlay (uses display:block, not .overlay class) */
body.overlay-open .tab {
  pointer-events: none !important;
}

.sheet {
  width: 100%;
  max-width: 520px;
  background: var(--n2);
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--nb);
  border-bottom: none;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetUp .3s cubic-bezier(.22, 1, .36, 1);
}

.sheet > .sh-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(24px + var(--safe-b));
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.sh-handle {
  width: 34px;
  height: 4px;
  background: var(--nb);
  border-radius: 2px;
  margin: 12px auto 0;
}

.sh-hdr {
  padding: 14px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--nb);
}

.sh-title {
  font-family: 'Cairo', sans-serif;
  font-size: 1.02rem;
  font-weight: 900;
}

.sh-close {
  width: 28px;
  height: 28px;
  background: var(--n3);
  border: none;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sh-close:active {
  transform: scale(.9);
}

.sh-body {
  padding: 16px 20px;
}

/* Form elements */
.fg {
  margin-bottom: 13px;
}

.fg label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.fg input,
.fg select,
.fg textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 9px;
  color: var(--white);
  font-size: .88rem;
  outline: none;
  transition: border-color .2s;
  direction: rtl;
}

.fg input:focus,
.fg select:focus {
  border-color: var(--gold);
}

.fg input::placeholder {
  color: rgba(122, 139, 170, .4);
}

.f-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ★ Fixed footer inside sheets — always visible, never scrolls away */
.sh-footer {
  flex-shrink: 0;
  padding: 12px 20px calc(12px + var(--safe-b));
  background: var(--n2);
  border-top: 1px solid var(--nb);
}

.f-submit {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border: none;
  border-radius: 11px;
  color: var(--navy);
  font-size: .96rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(201, 168, 76, .28);
  transition: all .18s;
}

.f-submit:active {
  transform: scale(.98);
}

.f-note {
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  margin-top: 10px;
}

.f-note a {
  color: var(--gold);
  cursor: pointer;
}

/* Deposit info box */
.deposit-box {
  background: rgba(232, 80, 80, .07);
  border: 1px solid rgba(232, 80, 80, .2);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 14px;
}

.deposit-box h4 {
  font-size: .82rem;
  font-weight: 800;
  margin-bottom: 5px;
  color: var(--red);
}

.deposit-box p {
  font-size: .75rem;
  color: var(--muted);
  line-height: 1.65;
}

.deposit-box .dep-amount {
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--red);
  margin-top: 6px;
}

/* Bid sheet */
.cur-price-box {
  background: rgba(201, 168, 76, .08);
  border: 1px solid rgba(201, 168, 76, .18);
  border-radius: 13px;
  padding: 14px;
  text-align: center;
  margin-bottom: 14px;
}

.cp-lbl {
  font-size: .7rem;
  color: var(--muted);
  margin-bottom: 3px;
}

.cp-val {
  font-family: 'Cairo', sans-serif;
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

.cp-sub {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 4px;
}

.live-bids {
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 13px;
}

.lbh {
  padding: 8px 13px;
  border-bottom: 1px solid var(--nb);
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.lb-list {
  max-height: 140px;
  overflow-y: auto;
}

.lb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 13px;
  border-bottom: 1px solid rgba(28, 45, 74, .4);
}

.lb-item.top {
  background: rgba(201, 168, 76, .05);
}

.lb-item.flash {
  animation: flashBid .7s ease;
}

@keyframes flashBid {
  0% {
    background: rgba(201, 168, 76, .18);
  }

  100% {
    background: transparent;
  }
}

.lb-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.lb-av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--nb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: var(--gold-l);
}

.lb-name {
  font-size: .75rem;
  font-weight: 600;
}

.lb-time {
  font-size: .62rem;
  color: var(--muted);
}

.lb-amt {
  font-family: 'Cairo', sans-serif;
  font-size: .8rem;
  font-weight: 900;
  color: var(--gold);
}

.bid-input {
  width: 100%;
  padding: 12px;
  background: var(--n3);
  border: 1.5px solid var(--nb);
  border-radius: 10px;
  color: var(--white);
  font-family: 'Cairo', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  direction: ltr;
  transition: border-color .2s;
  margin-bottom: 10px;
}

.bid-input:focus {
  border-color: var(--gold);
}

.quick-row {
  display: flex;
  gap: 6px;
  margin-bottom: 13px;
  flex-wrap: wrap;
}

.qbtn {
  flex: 1;
  min-width: 70px;
  padding: 8px 4px;
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 8px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all .18s;
}

.qbtn:active {
  background: rgba(201, 168, 76, .1);
  border-color: var(--gold);
  color: var(--gold);
  transform: scale(.95);
}

.confirm-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border: none;
  border-radius: 11px;
  color: var(--navy);
  font-size: .97rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 5px 18px rgba(201, 168, 76, .3);
  transition: all .18s;
}

.confirm-btn:active {
  transform: scale(.98);
}

.bid-note {
  text-align: center;
  font-size: .7rem;
  color: var(--muted);
  margin-top: 9px;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--nb);
  border-radius: 13px;
  padding: 26px 14px;
  text-align: center;
  cursor: pointer;
  transition: all .22s;
  margin-bottom: 13px;
}

.upload-zone:active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, .03);
}

.uz-ico {
  font-size: 1.9rem;
  margin-bottom: 7px;
}

.uz-title {
  font-size: .86rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.uz-sub {
  font-size: .73rem;
  color: var(--muted);
}

/* Toast */
#toast {
  position: fixed;
  bottom: calc(var(--tab-h, 80px) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  background: var(--n3);
  border: 1px solid rgba(46, 204, 113, .3);
  border-radius: 100px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .82rem;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .4);
  opacity: 0;
  pointer-events: none;
  transition: all .28s;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Install banner */
#install-banner {
  position: fixed;
  bottom: calc(var(--tab-h, 80px) + 10px);
  left: 12px;
  right: 12px;
  z-index: 300;
  background: var(--n3);
  border: 1px solid rgba(201, 168, 76, .3);
  border-radius: 14px;
  padding: 13px 14px;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  animation: fadeUp .35s both;
}

#install-banner.show {
  display: flex;
}

.ib-ico {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.ib-txt {
  flex: 1;
}

.ib-ttl {
  font-size: .82rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.ib-sub {
  font-size: .7rem;
  color: var(--muted);
}

.ib-btn {
  padding: 8px 13px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border: none;
  border-radius: 8px;
  color: var(--navy);
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.ib-x {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  padding: 4px;
}

/* iOS guide */
#ios-guide {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 14px;
}

#ios-guide.show {
  display: flex;
}

.ios-box {
  background: var(--n2);
  border: 1px solid var(--nb);
  border-radius: 22px 22px 0 0;
  padding: 24px 20px calc(24px + var(--safe-b));
  width: 100%;
  max-width: 480px;
  text-align: center;
  animation: sheetUp .3s cubic-bezier(.22, 1, .36, 1);
}

.ios-box h3 {
  font-family: 'Cairo', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.ios-box p {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.ios-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.ios-step {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--n3);
  border-radius: 11px;
  padding: 11px 13px;
  text-align: right;
}

.ios-sn {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 900;
  color: var(--navy);
  flex-shrink: 0;
}

.ios-st {
  font-size: .8rem;
  font-weight: 600;
  flex: 1;
}

.ios-close {
  padding: 12px;
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 10px;
  width: 100%;
  color: var(--white);
  font-family: 'Tajawal', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}

/* Prevent Chrome search bar interference */
input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
}

/* Responsive desktop */
@media(min-width:768px) {
  #mobile-app {
    display: none;
  }

  #desktop-app {
    display: flex;
  }

  #toast {
    bottom: 20px;
  }

  #install-banner {
    bottom: 20px;
  }
}

/* ══════════════════════════════════════════════════════
   AUCTION DETAIL VIEW — matches main app layout
══════════════════════════════════════════════════════ */
#auction-detail-view {
  flex-direction: column;
}

.detail-topbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 50;
  height: var(--top-h);
  padding-top: var(--safe-t);
  background: rgba(8, 16, 30, .95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(201, 168, 76, .1);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 10px;
  padding-inline: 16px;
}

.detail-content {
  position: absolute;
  top: var(--top-h);
  bottom: var(--tab-h);
  left: 0;
  right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.detail-content-inner {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

.detail-bidbar {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 50;
  min-height: var(--tab-h);
  padding-bottom: calc(var(--safe-b) + 16px);
  box-shadow: 0 20px 0 rgba(10, 16, 28, .97), 0 40px 0 rgba(10, 16, 28, .97);
  background: rgba(10, 16, 28, .97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(201, 168, 76, .1);
  display: flex;
  align-items: center;
  padding-top: 8px;
  padding-inline: 16px;
  gap: 10px;
}

.detail-bidbar input {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 14px;
  background: var(--n3);
  border: 1.5px solid var(--nb);
  border-radius: 10px;
  color: var(--white);
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  direction: ltr;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  color-scheme: dark;
}

.detail-bidbar input::placeholder {
  color: var(--muted);
  font-family: 'Tajawal', sans-serif;
  font-weight: 400;
  font-size: .88rem;
}

.detail-bidbar input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, .15);
}

.detail-bidbar button {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 12px 24px;
  font-size: .88rem;
  font-weight: 800;
  border-radius: 10px;
}

/* ══════════════════════════════════════════════════════
   CUSTOM CATEGORY PICKER
══════════════════════════════════════════════════════ */
.cat-group {
  margin-bottom: 4px;
}

.cat-group-header {
  font-family: 'Cairo', sans-serif;
  font-size: .82rem;
  font-weight: 900;
  color: var(--gold);
  padding: 10px 4px 6px;
  border-bottom: 1px solid rgba(201, 168, 76, .1);
  margin-bottom: 4px;
}

.cat-group-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--n3);
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
}

.cat-item:active {
  transform: scale(.98);
  background: rgba(201, 168, 76, .06);
}

.cat-item.selected {
  border-color: var(--gold);
  background: rgba(201, 168, 76, .08);
}

.cat-item-emoji {
  font-size: 1.3rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--n2);
  border-radius: 9px;
  flex-shrink: 0;
}

.cat-item-label {
  flex: 1;
  font-size: .88rem;
  font-weight: 600;
  color: var(--white);
}

.cat-item-check {
  font-size: .9rem;
  color: var(--gold);
  font-weight: 900;
  width: 20px;
  text-align: center;
}

.cat-item.selected .cat-item-label {
  color: var(--gold);
}

#category-display:active {
  border-color: var(--gold) !important;
}

/* ═══════════════════════════════════════════════════
   LOCATION WARNING BANNERS
   ═══════════════════════════════════════════════════ */

.loc-banner {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .8rem;
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  line-height: 1.5;
  direction: rtl;
}

.loc-same {
  background: rgba(46, 213, 115, .08);
  border: 1px solid rgba(46, 213, 115, .2);
  color: #2ED573;
}

.loc-info {
  background: rgba(100, 149, 237, .08);
  border: 1px solid rgba(100, 149, 237, .2);
  color: #6495ED;
}

.loc-near {
  background: rgba(100, 149, 237, .08);
  border: 1px solid rgba(100, 149, 237, .2);
  color: #6495ED;
}

.loc-moderate {
  background: rgba(245, 158, 11, .08);
  border: 1px solid rgba(245, 158, 11, .25);
  color: #F59E0B;
}

.loc-far {
  background: rgba(232, 80, 80, .08);
  border: 1px solid rgba(232, 80, 80, .25);
  color: #E85050;
}

.city-filter-wrap {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}

.city-filter-wrap select {
  background: var(--n3);
  border: 1px solid var(--nb);
  border-radius: 20px;
  color: var(--white);
  font-family: 'Tajawal', sans-serif;
  font-size: .75rem;
  padding: 6px 12px;
  direction: rtl;
  cursor: pointer;
  -webkit-appearance: none;
}

.profile-city-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0 4px;
}

.profile-city-row select {
  flex: 1;
  background: var(--n2);
  border: 1px solid var(--nb);
  border-radius: 10px;
  color: var(--white);
  font-family: 'Tajawal', sans-serif;
  font-size: .82rem;
  padding: 10px 12px;
  direction: rtl;
  -webkit-appearance: none;
}

.profile-city-row button {
  background: rgba(201, 168, 76, .1);
  border: 1px solid rgba(201, 168, 76, .3);
  border-radius: 10px;
  color: var(--gold);
  font-family: 'Tajawal', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
}

/* ── MESSAGE BUBBLES ─────────────────────── */
.msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-family: 'Tajawal', sans-serif;
  font-size: .82rem;
  line-height: 1.6;
  margin-bottom: 6px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.msg-mine {
  background: rgba(201, 168, 76, .12);
  border: 1px solid rgba(201, 168, 76, .2);
  margin-left: auto;
  border-bottom-left-radius: 4px;
}

.msg-theirs {
  background: var(--n3);
  border: 1px solid var(--nb);
  margin-right: auto;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: .62rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Chat view layout — only when active (must not override .view display:none) */
#chat-view.active {
  flex-direction: column;
  height: 100vh;
}

#chat-view .detail-topbar {
  flex-shrink: 0;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ══════════════════════════════════════════════════════════
   COUNTDOWN TIMER STYLES
   ══════════════════════════════════════════════════════════ */
.timer-normal { color: var(--white); font-size: .72rem; }
.timer-hours { color: var(--gold); font-size: .76rem; font-weight: 700; }
.timer-urgent { color: #ff9800; font-size: .8rem; font-weight: 700; animation: timer-pulse 2s infinite; }
.timer-critical { color: #f44336; font-size: .88rem; font-weight: 900; animation: timer-flash 1s infinite; }
.timer-final { color: #f44336; font-size: 1rem; font-weight: 900; animation: timer-flash 0.5s infinite; }
.timer-ended { color: var(--muted); font-size: .72rem; }

/* Detail page timers — larger */
#detail-timer.timer-normal { font-size: 1rem; }
#detail-timer.timer-hours { font-size: 1.2rem; }
#detail-timer.timer-urgent { font-size: 1.4rem; }
#detail-timer.timer-critical { font-size: 1.8rem; }
#detail-timer.timer-final { font-size: 2.2rem; }

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes timer-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ══════════════════════════════════════════════════════════
   RESERVE PRICE BADGE
   ══════════════════════════════════════════════════════════ */
.reserve-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 10px;
  font-family: 'Cairo', sans-serif;
  font-size: .78rem;
  font-weight: 700;
}
.reserve-pending {
  background: rgba(245, 158, 11, .08);
  border: 1px solid rgba(245, 158, 11, .2);
  color: #F59E0B;
}
.reserve-met {
  background: rgba(46, 204, 113, .08);
  border: 1px solid rgba(46, 204, 113, .2);
  color: #2ECC71;
}
.no-reserve {
  background: rgba(107, 122, 153, .06);
  border: 1px solid rgba(107, 122, 153, .15);
  color: var(--muted);
  font-size: .72rem;
}
.reserve-just-met {
  animation: reserve-glow 2s ease-out;
}

@keyframes reserve-glow {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, .6); transform: scale(1.05); }
  50% { box-shadow: 0 0 20px 4px rgba(46, 204, 113, .3); }
  100% { box-shadow: none; transform: scale(1); }
}