/* Damie Crypto Service — fond charcoal texturé logo DCS */
:root {
  --bg: #1a1a1a;
  --bg-elevated: #222222;
  --bg-panel: #2a2a2a;
  --bg-hover: #333333;
  --border: rgba(212, 175, 55, 0.28);
  --border-soft: rgba(255, 255, 255, 0.1);
  --gold: #d4af37;
  --gold-bright: #f5d76e;
  --gold-deep: #a67c1a;
  --gold-muted: rgba(212, 175, 55, 0.6);
  --gold-grad: linear-gradient(135deg, #f8e7a1 0%, #d4af37 42%, #9a7420 100%);
  --ink: #f7f7f7;
  --white: #f7f7f7;
  --muted: #b0b0b0;
  --muted-2: #888888;
  --green: #0ecb81;
  --red: #f6465d;
  --shadow-gold: 0 0 40px rgba(212, 175, 55, 0.16);
  --radius: 10px;
  --nav-h: 78px;
  --font-display: "Space Grotesk", "IBM Plex Sans", sans-serif;
  --font-ui: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-body: var(--font-ui);
  --max: 1240px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  font-family: var(--font-ui);
  background-color: #1a1a1a;
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(212, 175, 55, 0.08), transparent 55%),
    linear-gradient(180deg, #1c1c1c 0%, #161616 45%, #121212 100%);
  background-attachment: scroll;
  background-repeat: no-repeat;
  color: var(--white);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

img {
  max-width: 100%;
  display: block;
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 1rem;
  box-sizing: border-box;
}

/* ——— Top ticker ——— */
.ticker {
  background: rgba(18, 18, 18, 0.92);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  gap: 2.5rem;
  white-space: nowrap;
  animation: ticker 35s linear infinite;
  width: max-content;
}

.ticker-item {
  font-size: 0.78rem;
  color: #bdbdbd;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  flex-shrink: 0;
}

.ticker-item strong {
  color: #f5d76e;
  font-weight: 700;
}

.ticker-item .up { color: #0ecb81; }
.ticker-item .down { color: #f6465d; }

@keyframes ticker {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@media (max-width: 900px) {
  .ticker-track {
    animation-duration: 28s;
  }
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  padding: 0;
  display: flex;
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(26, 26, 26, 0.92);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1.5rem;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 1rem;
  box-sizing: border-box;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Logo pro : cadre blanc, dessin agrandi et recentré horizontalement */
.brand img,
.hero-brand-line img,
.footer-brand img,
.contact-placeholder .logo-mark {
  display: block;
  object-fit: cover;
  object-position: 49% 42%;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  background: #141414;
  padding: 0;
  /* Fallback zoom (navigateurs sans object-view-box) */
  transform: scale(1.28);
  transform-origin: center center;
}

@supports (object-view-box: inset(16%)) {
  .brand img,
  .hero-brand-line img,
  .footer-brand img,
  .contact-placeholder .logo-mark {
    transform: none;
    /* Même zoom ; cadrage horizontal équilibré (DCS centré dans le cadre) */
    object-view-box: inset(16% 17% 16% 15%);
    object-position: 49% 42%;
  }
}

.brand img {
  width: 56px;
  height: 56px;
  border-radius: 9px;
  clip-path: inset(0 round 9px);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
}

.brand-name .g,
.brand-name .w {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: #ffffff;
}

.brand-sub {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--gold-muted);
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 0.15rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.nav a .nav-illust {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-bright);
}

.nav a .nav-illust svg {
  width: 0.95rem;
  height: 0.95rem;
}

.nav a .nav-label {
  line-height: 1.2;
}

.nav a:hover,
.nav a.active {
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.4);
}

.nav a:hover .nav-illust,
.nav a.active .nav-illust {
  border-color: rgba(212, 175, 55, 0.65);
  background: rgba(212, 175, 55, 0.18);
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s, background 0.2s;
  max-width: 100%;
  box-sizing: border-box;
}

.btn[style*="width:100%"],
.btn[style*="width: 100%"] {
  width: 100% !important;
  justify-content: center !important;
}

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

.btn-gold {
  background: var(--gold-grad);
  color: #111;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  box-shadow: 0 0 28px rgba(212, 175, 55, 0.4);
}

.btn-outline {
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  background: transparent;
}

.btn-logout {
  background: transparent;
  color: #e8b4b4;
  border: 1px solid rgba(180, 70, 70, 0.55);
}

.btn-logout:hover {
  background: rgba(140, 40, 40, 0.35);
  border-color: rgba(220, 100, 100, 0.8);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.1);
}

.btn-ghost {
  color: var(--muted);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: var(--bg-panel);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--gold);
}

/* ——— Hero PI ——— */
.hero-pi {
  position: relative;
  padding: 2.5rem 0 1.5rem;
  overflow: hidden;
}

.hero-pi::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.04), transparent),
    radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.15), transparent 45%);
  pointer-events: none;
  animation: pulse-glow 6s ease-in-out infinite;
}

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

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  position: relative;
}

.hero-brand-line {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  animation: fade-up 0.7s ease both;
}

.hero-brand-line img {
  width: 72px;
  height: 72px;
  border-radius: 11px;
  border-width: 2px;
  clip-path: inset(0 round 11px);
}

.hero-kicker {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 5.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: 0.6rem;
  color: #ffffff;
  animation: fade-up 0.7s 0.1s ease both;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.hero-title span,
[data-brand-name] {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: #ffffff;
}

.hero-tagline {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 36ch;
  margin-bottom: 1.5rem;
  animation: fade-up 0.7s 0.2s ease both;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: fade-up 0.7s 0.3s ease both;
}

.pi-spotlight {
  position: relative;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(212, 175, 55, 0.14), transparent 55%),
    rgba(42, 42, 42, 0.88);
  box-shadow: var(--shadow-gold);
  backdrop-filter: blur(10px);
  animation: fade-up 0.8s 0.15s ease both, float-soft 5s ease-in-out infinite;
}

@keyframes float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.pi-spotlight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.pi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.coin-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  overflow: hidden;
  background: #1a1a1a;
}

.coin-icon.pi,
.coin-icon:has(img[alt="PI"]),
.coin-icon:has(img[alt="Pi Coin"]) {
  border-radius: 8px;
  background: #55338b;
}

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

.pi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(85, 51, 139, 0.35);
  background: #55338b;
}

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

.pi-pair {
  font-size: 1.05rem;
}

.pi-pair small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.pi-live {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pi-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: blink 1.4s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.pi-price {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.35rem;
}

.pi-change {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.pi-change .up {
  color: var(--green);
  font-weight: 700;
}

.pi-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}

.pi-meta div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pi-meta span {
  font-size: 0.68rem;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pi-meta strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--white);
}

/* ——— Stats strip ——— */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem auto 2rem;
  width: min(100% - 2rem, var(--max));
}

.stat-cell {
  background: rgba(34, 34, 34, 0.85);
  padding: 1rem 1.15rem;
  text-align: center;
  backdrop-filter: blur(8px);
}

.stat-cell span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-cell strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold-bright);
}

/* ——— Markets ——— */
.section {
  padding: 1.5rem 0 3rem;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.section-head p {
  color: var(--muted);
  font-size: 0.85rem;
}

.markets-live-status {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
  align-self: center;
}

.markets-live-status.is-live {
  color: #0ecb81;
  border-color: rgba(14, 203, 129, 0.35);
}

.markets-live-status.is-offline {
  color: #f6465d;
  border-color: rgba(246, 70, 93, 0.35);
}

.vision-section {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.mission-vision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 2.5rem;
  align-items: start;
}

.vision-block {
  max-width: none;
  margin: 0;
  padding: 1.75rem 0 1rem;
}

.vision-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.65rem;
}

.vision-block h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  color: var(--white);
}

.vision-text {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 42ch;
}

@media (max-width: 800px) {
  .mission-vision-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.founder-block {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  max-width: 42ch;
}

.founder-name {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  margin-bottom: 0.25rem;
}

.founder-role {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

[data-leader-title] {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  vertical-align: middle;
}

/* Drapeau du Bénin : vert | jaune / rouge */
.flag-bj {
  display: inline-block;
  width: 1.4em;
  height: 0.95em;
  flex-shrink: 0;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: #008751;
  background-image: linear-gradient(to bottom, #fcd116 50%, #e8112d 50%);
  background-size: 62% 100%;
  background-position: right center;
  background-repeat: no-repeat;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.founder-footer {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.founder-footer strong {
  color: var(--gold-bright);
  font-weight: 600;
}

.market-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  background: rgba(42, 42, 42, 0.85);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

.search-box {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(42, 42, 42, 0.85);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  min-width: min(100%, 220px);
}

.tabs button {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.tabs button.active {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-bright);
}

.search-box input {
  width: 100%;
  outline: none;
  color: var(--white);
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.markets-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  background: rgba(34, 34, 34, 0.88);
  backdrop-filter: blur(10px);
}

.markets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.markets-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  font-weight: 600;
  background: rgba(26, 26, 26, 0.95);
  border-bottom: 1px solid var(--border-soft);
}

.markets-table th:nth-child(n+3),
.markets-table td:nth-child(n+3) {
  text-align: right;
}

.markets-table tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s;
  cursor: pointer;
}

.markets-table tbody tr:hover {
  background: var(--bg-hover);
}

.markets-table tbody tr.featured {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.12), transparent 60%);
}

.markets-table tbody tr.featured:hover {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.04) 60%);
}

.markets-table td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
}

.coin-cell {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.stable-pill {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-bright);
  vertical-align: middle;
}

.pi-meta.pi-meta-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 720px) {
  .pi-meta.pi-meta-4 {
    grid-template-columns: 1fr 1fr;
  }
}

.coin-name {
  font-weight: 700;
}

.coin-name small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.75rem;
}

.price-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.change-up { color: var(--green); font-weight: 700; }
.change-down { color: var(--red); font-weight: 700; }

.spark {
  width: 88px;
  height: 28px;
  margin-left: auto;
}

.trade-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-bright);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.trade-btn:hover {
  border-color: var(--gold);
}

/* ——— Modules grid ——— */
.modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.module-link {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.25rem 1.15rem 1.3rem;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(48, 44, 32, 0.55), rgba(28, 28, 28, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.module-link:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}

.module-link .mod-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-bright);
}

.module-link .mod-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.module-link h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 8px;
  background: rgba(18, 18, 18, 0.45);
  color: var(--white);
  width: fit-content;
  max-width: 100%;
}

.module-link p {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

/* ——— Page layouts ——— */
.page-hero {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1.5rem;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
}

.page-hero h1 span {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-hero p {
  color: var(--muted);
  max-width: 50ch;
}

.panel {
  background: rgba(42, 42, 42, 0.88);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.35rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
}

.panel + .panel {
  margin-top: 1rem;
}

.panel h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
  min-width: 0;
  max-width: 100%;
}

.grid-2 > * {
  min-width: 0;
  max-width: 100%;
}

.balance-big {
  font-family: var(--font-display);
  font-size: 2rem;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0.5rem 0 0.15rem;
}

.balance-big.is-hidden-balance {
  letter-spacing: 0.12em;
}

.wallet-balance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.btn-balance-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: rgba(20, 20, 20, 0.55);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
}

.btn-balance-toggle:hover,
.btn-balance-toggle[aria-pressed="true"] {
  color: var(--gold-bright);
  border-color: rgba(212, 175, 55, 0.45);
}

.balance-eye {
  font-size: 0.9rem;
  line-height: 1;
}

.balance-usd {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold-bright);
  margin-bottom: 0.65rem;
  letter-spacing: 0.02em;
}

.asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}

.asset-row:last-child {
  border-bottom: none;
}

.asset-row > span:first-child {
  flex: 0 1 auto;
  min-width: 0;
}

#ref-username {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--gold-bright);
  direction: ltr;
  unicode-bidi: isolate;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-control {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.75rem 0.9rem;
  background: rgba(20, 20, 20, 0.65);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  color: var(--white);
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.form-control:focus {
  border-color: var(--gold);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%23d4af37'%3E%3Cpath d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}

.swap-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -0.35rem auto;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--gold);
  position: relative;
  z-index: 1;
}

.course-list {
  display: grid;
  gap: 0.85rem;
}

.course-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(34, 34, 34, 0.75);
  transition: border-color 0.2s;
}

.course-item:hover {
  border-color: var(--gold);
}

.course-item h4 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.course-item p {
  font-size: 0.8rem;
  color: var(--muted);
}

.course-video-wrap {
  margin-top: 0.75rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0a0a;
  max-width: 100%;
}

.course-video {
  display: block;
  width: 100%;
  max-height: 420px;
  background: #000;
}

.price-pi {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--gold-bright);
  white-space: nowrap;
}

.community-feed {
  display: grid;
  gap: 0.85rem;
}

.feed-post {
  padding: 1rem 1.1rem;
  border-left: 2px solid var(--gold);
  background: var(--bg-elevated);
  border-radius: 0 10px 10px 0;
}

.feed-post .meta {
  font-size: 0.72rem;
  color: var(--muted-2);
  margin-bottom: 0.4rem;
}

.feed-post p {
  font-size: 0.9rem;
  color: var(--muted);
}

.contact-placeholder {
  text-align: center;
  padding: 3rem 1.5rem;
}

.contact-placeholder .logo-mark {
  width: 128px;
  height: 128px;
  margin: 0 auto 1.25rem;
  border-radius: 14px;
  border-width: 2px;
  clip-path: inset(0 round 14px);
}

.contact-placeholder h2 {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.contact-placeholder p {
  color: var(--muted);
  max-width: 40ch;
  margin: 0 auto 1.5rem;
}

.contact-fields {
  display: grid;
  gap: 0.75rem;
  max-width: 420px;
  margin: 0 auto;
  text-align: left;
}

.contact-field {
  padding: 0.9rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted-2);
  font-size: 0.85rem;
}

.contact-field strong {
  display: block;
  color: var(--gold-muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

/* ——— Footer ——— */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.95);
  padding: 2.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
}

.footer-brand img {
  width: 72px;
  height: 72px;
  border-radius: 11px;
  border-width: 2px;
  margin-bottom: 0.75rem;
  clip-path: inset(0 round 11px);
}

.footer-brand p {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 32ch;
}

.footer-brand .tag {
  margin-top: 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.25rem 0;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--gold-bright);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-bottom a,
.legal-links a {
  color: var(--gold-bright);
  text-decoration: underline;
  font-weight: 600;
}

.footer-bottom a:hover,
.legal-links a:hover {
  color: var(--gold);
}

/* ——— Mobile ——— */
@media (max-width: 960px) {
  .hero-grid,
  .grid-2,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .modules {
    grid-template-columns: 1fr 1fr;
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }

  .nav {
    display: none;
    position: absolute;
    top: calc(var(--nav-h) + 36px);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(26, 26, 26, 0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    padding: 0.65rem 0.75rem 0.85rem;
    gap: 0.35rem;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav.open {
    display: flex;
  }

  .nav.open a {
    width: 100%;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    font-size: 0.9rem;
    white-space: normal;
    box-sizing: border-box;
  }

  .nav.open a .nav-illust {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
  }

  .nav.open a .nav-illust svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .menu-toggle {
    display: flex;
  }

  .header-actions .btn-outline {
    display: none;
  }

  .markets-table th:nth-child(4),
  .markets-table td:nth-child(4),
  .markets-table th:nth-child(5),
  .markets-table td:nth-child(5) {
    display: none;
  }

  .search-box {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .brand img,
  .hero-brand-line img,
  .footer-brand img,
  .contact-placeholder .logo-mark {
    transform: none !important;
  }

  .site-header {
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .header-inner {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
    position: relative;
    overflow: visible;
  }

  .nav.open {
    display: flex !important;
    z-index: 200;
  }

  .menu-toggle {
    display: flex !important;
    z-index: 210;
    position: relative;
  }

  .container,
  main.container,
  .hero-pi > .container {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
  }

  .hero-grid,
  .grid-2,
  .modules,
  .stats-strip,
  .mission-vision-grid,
  .footer-grid,
  .buyers-layout {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .panel,
  .auth-panel,
  .pi-spotlight,
  .module-link,
  .form-control,
  .btn {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-hero {
    text-align: center;
  }

  .page-hero p {
    margin-inline: auto;
  }

  .hero-pi .hero-grid > div:first-child {
    text-align: center;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-brand-line {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
  }

  .site-footer .footer-grid {
    text-align: center;
  }

  .footer-brand {
    align-items: center;
    text-align: center;
  }

  .ticker {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .markets-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ——— Anti-décalage Pi Browser ——— */
html, body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.panel,
.auth-panel,
.profile-head,
.form-group,
.form-row-2,
.status-row,
.container,
.header-inner,
main,
.support-form,
.logout-box,
.grid-2 {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

input,
select,
textarea,
.form-control {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.btn,
p,
h1, h2, h3, h4,
#profile-username,
#profile-displayname,
#session-label {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: normal !important;
  direction: ltr !important;
}

/* Pi Browser : forcer le menu hamburger même si le WebView se croit “desktop” */
html.pi-webview .menu-toggle,
body.is-pi-browser .menu-toggle {
  display: flex !important;
}

html.pi-webview .nav,
body.is-pi-browser .nav {
  display: none;
  position: absolute;
  top: calc(var(--nav-h) + 36px);
  left: 0;
  right: 0;
  flex-direction: column;
  background: rgba(26, 26, 26, 0.98);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  padding: 0.65rem 0.75rem 0.85rem;
  gap: 0.35rem;
  z-index: 200;
  width: 100%;
  max-width: 100%;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

html.pi-webview .nav.open a,
body.is-pi-browser .nav.open a {
  width: 100%;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  font-size: 0.9rem;
  white-space: normal;
  box-sizing: border-box;
}

html.pi-webview .nav.open a .nav-illust,
body.is-pi-browser .nav.open a .nav-illust {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
}

html.pi-webview .nav.open a .nav-illust svg,
body.is-pi-browser .nav.open a .nav-illust svg {
  width: 1.25rem;
  height: 1.25rem;
}

html.pi-webview .nav.open,
body.is-pi-browser .nav.open {
  display: flex !important;
}

html.pi-webview .header-actions .btn-outline,
body.is-pi-browser .header-actions .btn-outline {
  display: none;
}

html.pi-webview .grid-2,
body.is-pi-browser .grid-2,
html.pi-webview .form-row-2,
body.is-pi-browser .form-row-2 {
  grid-template-columns: 1fr !important;
}

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

  .pi-meta {
    grid-template-columns: 1fr;
  }

  .brand-text {
    display: none;
  }

  .header-inner {
    gap: 0.65rem;
    justify-content: space-between;
  }

  .page-hero h1,
  .hero-title,
  .panel h3,
  .balance-big {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .btn {
    max-width: 100%;
  }

  #pi-login-btn {
    width: 100%;
    justify-content: center;
  }

  .panel,
  .auth-panel,
  .pi-spotlight,
  .ref-code-box,
  .form-control,
  input,
  select,
  textarea,
  table {
    max-width: 100%;
  }

  .ref-code-box {
    flex-wrap: wrap;
  }

  .footer-grid,
  .footer-bottom {
    overflow-wrap: anywhere;
  }
}

.slippage-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.slippage-presets {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.slip-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(34, 34, 34, 0.85);
  color: var(--muted);
  cursor: pointer;
}

.slip-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.slip-btn.active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-bright);
}

.slippage-input {
  width: 5.5rem;
  flex: 0 0 auto;
}

.slippage-unit {
  font-size: 0.85rem;
  color: var(--muted);
}

.btn-report {
  border-color: rgba(180, 70, 70, 0.55) !important;
  color: #e8b4b4 !important;
}

.btn-report:hover {
  background: rgba(140, 40, 40, 0.35) !important;
  color: #fff !important;
}

.seller-chip-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.seller-chip-wrap .seller-chip {
  flex: 1;
  margin-bottom: 0;
}

.seller-report-btn {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(180, 70, 70, 0.45);
  background: transparent;
  color: #e8b4b4;
  cursor: pointer;
  white-space: nowrap;
}

.seller-report-btn:hover {
  background: rgba(140, 40, 40, 0.35);
  color: #fff;
}

.report-card {
  max-width: 480px;
}

.fee-box {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(20, 20, 20, 0.45);
}

.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.88rem;
}

.fee-row strong {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.fee-row.muted {
  font-size: 0.78rem;
  color: var(--muted);
}

.fee-note {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.75rem;
  color: var(--gold-muted);
  line-height: 1.4;
}

/* ——— Parrainage ——— */
.ref-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filleuls-summary {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(20, 20, 20, 0.45);
}

.filleuls-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-soft);
}

.filleuls-total span {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filleuls-total strong {
  font-family: var(--font-display);
  font-size: 1.85rem;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.filleuls-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.filleuls-breakdown > div {
  text-align: center;
  padding: 0.45rem 0.25rem;
}

.filleuls-breakdown span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.filleuls-breakdown strong {
  font-size: 1.15rem;
  color: var(--gold-bright);
}

.ref-usernames-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.ref-usernames-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ref-user-chip {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.28);
}

.ref-tree h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ref-count-pill {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: #111;
  background: var(--gold-grad);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.ref-level {
  text-align: center;
  padding: 1.35rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(42, 42, 42, 0.88);
  box-shadow: var(--shadow-gold);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.ref-level::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--gold-grad);
}

.ref-level .pct {
  font-family: var(--font-display);
  font-size: 2rem;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  line-height: 1.1;
}

.ref-level .lvl {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.ref-level p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.ref-code-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.ref-code-box .form-control {
  flex: 1;
  min-width: 180px;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  font-size: 0.9rem;
}

#ref-link.form-control {
  font-family: var(--font-body);
  letter-spacing: 0;
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: nowrap;
  direction: ltr;
  text-align: left;
}

.ref-tree .member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.ref-tree .member:last-child {
  border-bottom: none;
}

.ref-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-bright);
}

/* ——— Profil ——— */
.profile-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.profile-head > div {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#profile-username,
#profile-displayname,
#session-label,
.form-control {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.avatar-wrap {
  position: relative;
  display: block;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.avatar-wrap:focus-within {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.avatar-wrap img,
.avatar-fallback {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: var(--shadow-gold);
  background: var(--gold-grad);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.avatar-wrap:hover img,
.avatar-wrap:hover .avatar-fallback,
.avatar-wrap:active img,
.avatar-wrap:active .avatar-fallback {
  filter: brightness(0.88);
}

.avatar-wrap img[hidden],
.avatar-fallback[hidden] {
  display: none !important;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #111;
  line-height: 1;
  text-align: center;
  overflow: hidden;
}

.avatar-upload {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #111;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg, #0d0d0d);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.avatar-wrap.is-uploading {
  pointer-events: none;
  opacity: 0.72;
}

.avatar-wrap.is-uploading .avatar-upload {
  animation: avatar-pulse 0.9s ease infinite alternate;
}

@keyframes avatar-pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

.avatar-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.status-row:last-child {
  border-bottom: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.4rem;
}

.status-dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.off { background: var(--muted-2); }

.tr-balance {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--gold-bright);
  font-weight: 600;
}

.tr-balance.is-empty {
  color: var(--muted);
  font-weight: 500;
}

.tx-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}

.tx-filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}

.tx-filter-btn.active {
  color: #111;
  background: var(--gold-grad);
  border-color: transparent;
}

.tx-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.tx-status.is-pending {
  color: #f5d76e;
}

.tx-status.is-confirmed {
  color: var(--green);
}

.kyc-steps {
  display: grid;
  gap: 0.75rem;
}

.kyc-step {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: rgba(34, 34, 34, 0.75);
}

.kyc-step .num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #111;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.kyc-file-name {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--gold);
}

.kyc-selfie-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.kyc-selfie-preview {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.kyc-selfie-preview img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #111;
}

.kyc-camera-modal .kyc-camera-card {
  width: min(480px, 100%);
}

.kyc-camera-body {
  padding: 1.25rem 1.15rem 1.15rem;
}

.kyc-camera-body h3 {
  margin: 0;
  padding-right: 2rem;
}

.kyc-camera-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 58vh;
  border-radius: 14px;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid var(--border);
}

.kyc-camera-stage video,
.kyc-camera-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
}

.kyc-camera-error {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #f07178;
}

.kyc-camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.kyc-camera-actions .btn {
  flex: 1 1 auto;
  min-width: 120px;
}

@media (max-width: 720px) {
  .ref-levels {
    grid-template-columns: 1fr;
  }

  .filleuls-breakdown {
    grid-template-columns: 1fr;
  }
}

/* ——— Marketplace photos ——— */
.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.photo-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.market-article {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(34, 34, 34, 0.75);
  overflow: hidden;
  margin-bottom: 0.85rem;
  transition: border-color 0.2s;
}

.market-article:hover {
  border-color: var(--gold);
}

.market-article-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
}

.market-article-body h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.market-article-body p {
  font-size: 0.82rem;
  color: var(--muted);
}

.market-article-buy {
  text-align: right;
  flex-shrink: 0;
}

.market-article-buy .trade-btn {
  margin-top: 0.4rem;
}

.article-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.35rem;
  padding: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
}

.article-photos.empty {
  display: block;
  padding: 0.65rem 1rem;
  font-size: 0.75rem;
  color: var(--muted-2);
}

.article-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  padding: 0;
  cursor: zoom-in;
  background: #111;
}

.article-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.article-photo:hover img {
  transform: scale(1.06);
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  cursor: zoom-out;
}

.photo-lightbox img {
  max-width: min(920px, 100%);
  max-height: 85vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-gold);
}

.photo-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #111;
  font-size: 1.4rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .market-article-body {
    flex-direction: column;
  }
  .market-article-buy {
    text-align: left;
  }
}

.market-role-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 0 0 1.35rem;
}

.market-role-btn {
  appearance: none;
  text-align: left;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--white);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.market-role-btn strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  margin-bottom: 0.25rem;
}

.market-role-btn span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.market-role-btn:hover,
.market-role-btn.active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.market-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.panel-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.market-section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  margin: 0;
}

.label-hint {
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.market-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.market-stat {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 0.85rem 1rem;
}

.market-stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.market-stat strong {
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 1rem;
}

.market-rules {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.market-rules li + li {
  margin-top: 0.35rem;
}

.seller-listing-row {
  align-items: flex-start;
}

@media (max-width: 720px) {
  .market-role-bar,
  .market-stats {
    grid-template-columns: 1fr;
  }
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.birthdate-row {
  display: grid;
  grid-template-columns: 0.85fr 1.35fr 1fr;
  gap: 0.45rem;
}

@media (max-width: 640px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.buyers-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  padding-bottom: 3rem;
  align-items: start;
}

.sellers-panel {
  position: sticky;
  top: calc(var(--nav-h) + 48px);
}

.sellers-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.seller-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(20, 20, 20, 0.45);
  color: var(--white);
  transition: border-color 0.15s, background 0.15s;
}

.seller-chip:hover,
.seller-chip.active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
}

.seller-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #111;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.seller-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.seller-meta small {
  color: var(--muted);
  font-size: 0.72rem;
}

.market-article-top {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
}

.market-cover {
  width: 100%;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
  background: #111;
}

.market-cover.placeholder {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-bright);
  background: linear-gradient(160deg, rgba(85, 51, 139, 0.5), #1a1a1a);
}

.market-cover.placeholder.large {
  min-height: 160px;
  border-radius: 10px;
}

.article-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.78);
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow: auto;
}

.article-modal[hidden] {
  display: none !important;
}

.article-modal-card {
  position: relative;
  width: min(860px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: rgba(34, 34, 34, 0.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-gold);
  backdrop-filter: blur(12px);
}

.article-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #111;
  font-size: 1.3rem;
  font-weight: 700;
}

.article-modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.4rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
}

.article-modal-content {
  padding: 0 1.25rem 1.35rem;
}

.article-modal-content h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  margin: 0.5rem 0 0.35rem;
}

.article-modal-meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.article-modal-body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--white);
  margin-bottom: 1.25rem;
  white-space: pre-wrap;
}

.article-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

@media (max-width: 900px) {
  .buyers-layout {
    grid-template-columns: 1fr;
  }
  .sellers-panel {
    position: static;
  }
  .market-article-top {
    grid-template-columns: 1fr;
  }
  .market-cover {
    min-height: 160px;
    max-height: 200px;
  }
}

/* ——— Performance ——— */
.site-header,
.panel,
.module-link,
.stat-cell,
.ref-level,
.pi-spotlight,
.article-modal-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.pi-live,
.hero-brand-line img,
.pi-spotlight {
  animation: none !important;
}

.ticker {
  overflow: hidden;
}

a.is-pressed,
button.is-pressed,
.btn.is-pressed {
  opacity: 0.72;
  transform: scale(0.98);
}

html.is-navigating {
  cursor: progress;
}

html.is-navigating body {
  opacity: 0.92;
  transition: opacity 0.12s linear;
}

/* ——— Auth (signup / signin) ——— */
.mfa-enroll-panel {
  margin: 0.75rem 0 1rem;
  padding: 1rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  background: rgba(18, 18, 18, 0.55);
}

.mfa-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0;
}

.mfa-qr-wrap img {
  width: 180px;
  height: 180px;
  background: #fff;
  border-radius: 8px;
  padding: 0.5rem;
}

.auth-panel {
  max-width: 480px;
  width: 100%;
  margin: 0 auto 3rem;
}

.auth-hint {
  font-size: 0.85rem;
  color: var(--gold-muted);
  margin-bottom: 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.06);
}

.auth-error {
  color: var(--red);
  font-size: 0.85rem;
  margin: 0.35rem 0 0.75rem;
}

.auth-switch {
  margin-top: 1.1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-switch a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-demo {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--muted-2);
  text-align: center;
}

.auth-demo code {
  color: var(--gold-muted);
  font-family: var(--font-ui);
}

.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}

.auth-step {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border-soft);
  color: var(--muted);
  background: rgba(20, 20, 20, 0.5);
}

.auth-step.active {
  border-color: var(--gold);
  color: #141414;
  background: var(--gold-grad);
}

.auth-step-line {
  width: 2.5rem;
  height: 1px;
  background: var(--border-soft);
}

.auth-step-label {
  font-size: 0.82rem;
  color: var(--gold-muted);
  margin-bottom: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.otp-input {
  letter-spacing: 0.35em;
  font-size: 1.25rem;
  text-align: center;
  font-weight: 700;
}

.otp-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.otp-actions .btn {
  flex: 1;
  min-width: 140px;
}

/* ——— Toasts transactions ——— */
.dcs-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 9999;
  max-width: min(92vw, 420px);
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(34, 34, 34, 0.96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.dcs-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.dcs-toast strong {
  color: var(--gold-bright);
  font-size: 0.88rem;
}

.dcs-toast span {
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  body {
    background-image: none;
    background-color: #1a1a1a;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
