:root {
  --gold: #d4af37;
  --gold2: #f6dc7a;
  --gold3: #8a6a12;
  --bg: #0a0806;
  --bg2: #110d09;
  --card: #15110c;
  --line: #2e2417;
  --txt: #f3ece0;
  --mut: #a99f8e;
  --red: #ff3b57;
  --emerald: #34d399;
  --cyan: #38bdf8;
  --gtext: linear-gradient(100deg, #8a6a12 0%, #f6dc7a 28%, #fff6cf 50%, #f6dc7a 72%, #8a6a12 100%);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(212, 175, 55, 0.15);
}

[hidden] {
  display: none !important;
}

/* Fix fast-scroll white flashes: solid dark root + overscroll control + custom scrollbar */
html {
  scroll-behavior: smooth;
  background-color: #0a0806;
  color-scheme: dark;
  overscroll-behavior-y: none;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: #0a0806;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8a6a12, #d4af37);
  border-radius: 8px;
  border: 2px solid #0a0806;
}
::-webkit-scrollbar-thumb:hover {
  background: #f6dc7a;
}

body {
  margin: 0;
  background-color: #0a0806;
  color: var(--txt);
  font-family: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  line-height: 1.8;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* GPU-accelerated ambient background (prevents repaint white flashes during fast scroll) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(950px 520px at 50% -8%, rgba(44, 32, 12, 0.65) 0%, transparent 65%),
    radial-gradient(650px 450px at 88% 85%, rgba(212, 175, 55, 0.05) 0%, transparent 60%),
    #0a0806;
  transform: translateZ(0);
  backface-visibility: hidden;
}

img {
  background-color: #110d09;
  color: transparent;
}

a {
  color: var(--gold2);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #fff6cf;
}
::selection {
  background: var(--gold);
  color: #111;
}

/* Reading / Scroll Progress Bar */
#scrollBar {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  height: 3px;
  width: 0%;
  z-index: 120;
  background: linear-gradient(90deg, #8a6a12, #f6dc7a, #fff6cf, #d4af37);
  box-shadow: 0 0 14px rgba(246, 220, 122, 0.75);
  transition: width 0.08s linear;
  pointer-events: none;
}

/* Announcement Banner */
.ann-bar {
  background: linear-gradient(90deg, #171108, #261c0d, #171108);
  border-bottom: 1px solid #d4af3755;
  color: var(--gold2);
  text-align: center;
  padding: 7px 16px;
  font-size: 0.92rem;
  font-weight: 600;
}

/* Gold Shimmering Text */
.gold-text {
  background: var(--gtext);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine {
  to { background-position: -220% 0; }
}
h1, h2, h3, .logo {
  font-family: "El Messiri", "Cairo", serif;
}
html[lang=en] h1, html[lang=en] h2, html[lang=en] .logo {
  font-family: "Cinzel", "El Messiri", serif;
  letter-spacing: 0.04em;
}

/* Navigation */
header.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 24px;
  background: rgba(10, 8, 6, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--gold3), var(--gold2), var(--gold3), transparent) 1;
}
.logo {
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.navr {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hi {
  color: var(--mut);
  font-size: 0.92rem;
}

/* Luxury Buttons (warm gold shimmer, no white flash) */
button, .btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f6dc7a, #c79a22 55%, #8a6a12);
  color: #17110a;
  border: 0;
  border-radius: 10px;
  padding: 9px 18px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.96rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.2s, box-shadow 0.25s, filter 0.2s;
  box-shadow: 0 2px 14px rgba(212, 175, 55, 0.16);
}
button::after, .btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 246, 207, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s;
  pointer-events: none;
}
button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(212, 175, 55, 0.35);
  color: #17110a;
}
button:hover::after, .btn:hover::after {
  left: 130%;
}
button:active {
  transform: translateY(0);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
button.ghost, a.btn.ghost {
  background: rgba(212, 175, 55, 0.05);
  color: var(--gold2);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: none;
}
button.ghost:hover, a.btn.ghost:hover {
  background: rgba(212, 175, 55, 0.14);
  color: #fff6cf;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.22);
}
button.danger {
  background: linear-gradient(135deg, #e0445c, #8d1d30);
  color: #fff;
}
button.sm, .btn.sm {
  padding: 5px 12px;
  font-size: 0.84rem;
  border-radius: 8px;
}
:focus-visible {
  outline: 2px solid var(--gold2);
  outline-offset: 2px;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: #0a0806;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  animation: kenburns 26s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 4%, rgba(10, 8, 6, 0.4) 45%, rgba(10, 8, 6, 0.1) 100%);
}
.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.hero .in {
  position: relative;
  z-index: 2;
  padding: 34px 22px 56px;
  max-width: 980px;
  margin: auto;
  width: 100%;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: 30px;
  background: rgba(20, 16, 11, 0.78);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: var(--gold2);
  font-size: 0.86rem;
  margin-bottom: 10px;
  backdrop-filter: blur(8px);
}
.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  margin: 0 0 8px;
  line-height: 1.22;
  filter: drop-shadow(0 4px 24px #000c);
}
.hero p {
  font-size: 1.15rem;
  max-width: 650px;
  color: #eadfca;
  text-shadow: 0 2px 12px #000;
  margin: 8px 0 18px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.social-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.soc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 30px;
  background: rgba(20, 16, 11, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold2);
  font-size: 0.88rem;
  transition: 0.25s;
}
.soc-btn:hover {
  border-color: var(--gold2);
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(212, 175, 55, 0.25);
}
.hero .in > * {
  animation: rise 0.9s both;
}
.hero .in > *:nth-child(2) { animation-delay: 0.15s; }
.hero .in > *:nth-child(3) { animation-delay: 0.3s; }
.hero .in > *:nth-child(4) { animation-delay: 0.45s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
}

/* Sections */
section {
  max-width: 980px;
  margin: auto;
  padding: 40px 22px;
}
h2 {
  position: relative;
  font-size: 1.95rem;
  margin: 0 0 20px;
  padding-bottom: 10px;
  background: var(--gtext);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 8s linear infinite;
}
h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 96px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold2), transparent);
}
html[dir=rtl] h2::after {
  background: linear-gradient(270deg, var(--gold2), transparent);
}
h3.sub {
  color: var(--gold2);
  margin: 24px 0 10px;
  font-size: 1.2rem;
}
.tags span {
  display: inline-block;
  margin: 4px;
  padding: 5px 16px;
  border: 1px solid #3a2e1f;
  border-radius: 20px;
  color: var(--mut);
  background: rgba(255, 255, 255, 0.02);
  transition: 0.25s;
}
.tags span:hover {
  border-color: var(--gold);
  color: var(--gold2);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.18);
}

/* Scroll Reveal (composited to prevent flicker) */
.rv {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 0.65s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
  backface-visibility: hidden;
}
.rv.shown {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Interactive Card Spotlight Glow */
.svc > div, .prj-card, .post, .fcard, .stat {
  --mx: 50%;
  --my: 50%;
}
.svc > div::after, .prj-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(246, 220, 122, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.svc > div:hover::after, .prj-card:hover::after {
  opacity: 1;
}

/* Services & Portfolio Cards */
.svc, .prj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
  gap: 16px;
}
.svc > div, .prj-card {
  position: relative;
  background: linear-gradient(160deg, #1a140c, var(--card));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.svc > div::before, .prj-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold2), transparent);
  opacity: 0;
  transition: 0.3s;
}
.svc > div:hover, .prj-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 14px 40px rgba(212, 175, 55, 0.15);
}
.svc > div:hover::before, .prj-card:hover::before {
  opacity: 1;
}
.svc h3, .prj-card h3 {
  margin: 0 0 6px;
  color: var(--gold2);
  font-size: 1.18rem;
}
.svc p, .prj-card p {
  margin: 0;
  color: var(--mut);
}
.prj-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold2);
  margin-bottom: 8px;
}

/* Blog Filter & Search Bar */
.blog-Controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.search-input {
  flex: 1;
  min-width: 220px;
  margin: 0;
  padding: 10px 16px;
  border-radius: 30px;
  background: #120e0a;
  border: 1px solid #3a2e1f;
}
.cat-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-pill {
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.86rem;
  background: #14100b;
  border: 1px solid #3a2e1f;
  color: var(--mut);
}
.cat-pill.active, .cat-pill:hover {
  background: linear-gradient(135deg, #f6dc7a, #c79a22);
  color: #17110a;
  border-color: transparent;
}

/* Author & Role Badges */
.author-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 12px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #3a2e1f;
  font-size: 0.84rem;
  color: var(--txt);
}
.author-pill .uname {
  color: var(--gold2);
  font-family: monospace;
  font-size: 0.82rem;
  direction: ltr;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 1px 10px;
  border-radius: 20px;
}
.role-badge.owner {
  background: linear-gradient(135deg, #f6dc7a, #c79a22);
  color: #17110a;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}
.role-badge.assistant {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.45);
}

/* Posts on Home */
.post {
  position: relative;
  margin: 20px 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--card) center/cover no-repeat;
  border: 1px solid var(--line);
  transition: transform 0.35s, box-shadow 0.35s, border-color 0.35s;
}
.post:hover {
  transform: translateY(-5px);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 18px 50px #000c, 0 0 34px rgba(212, 175, 55, 0.16);
}
.post .ov {
  padding: 28px;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0.72), rgba(10, 8, 6, 0.93));
}
.post-top-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.cat-tag {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold2);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 1px 10px;
  border-radius: 20px;
}
.post h3 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}
.post h3 a {
  color: var(--gold2);
}
.post time, .read-info {
  color: var(--mut);
  font-size: 0.85rem;
}
.post p {
  white-space: pre-wrap;
  margin: 10px 0 16px;
  color: #e6dcc8;
}
.ft {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid #3a2e1f;
  border-radius: 30px;
  color: var(--mut);
  font-size: 0.88rem;
  transition: 0.25s;
}
.chip svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.chip:hover {
  border-color: var(--gold);
  color: var(--gold2);
}
.more {
  margin-inline-start: auto;
  font-weight: 700;
}

/* Like Button + Effects */
button.like {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--mut);
  border: 1px solid #3a2e1f;
  border-radius: 30px;
  padding: 5px 16px;
  box-shadow: none;
  overflow: visible;
}
button.like::after {
  display: none;
}
button.like svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  transition: 0.3s;
}
button.like:hover {
  border-color: var(--red);
  color: #ff8497;
  transform: none;
  box-shadow: 0 0 20px rgba(255, 59, 87, 0.22);
}
button.like.on {
  color: #fff;
  border-color: var(--red);
  background: linear-gradient(135deg, rgba(255, 59, 87, 0.22), rgba(255, 59, 87, 0.07));
  box-shadow: 0 0 24px rgba(255, 59, 87, 0.35);
}
button.like.on svg {
  fill: var(--red);
  stroke: var(--red);
  filter: drop-shadow(0 0 7px var(--red));
}
button.like.fresh svg {
  animation: pop 0.75s cubic-bezier(0.2, 1.6, 0.3, 1);
}
button.like.fresh::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 30px;
  border: 2px solid var(--red);
  animation: ring 0.8s ease-out forwards;
}
.lc.bump {
  animation: bump 0.4s;
}
@keyframes pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.65) rotate(-10deg); }
  60% { transform: scale(0.85) rotate(6deg); }
  100% { transform: scale(1); }
}
@keyframes ring {
  from { opacity: 0.9; transform: scale(1); }
  to { opacity: 0; transform: scale(1.7, 2.4); }
}
@keyframes bump {
  50% { transform: translateY(-5px) scale(1.3); color: #fff; }
}
.burst {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  width: 0;
  height: 0;
}
.spark {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2);
  border-radius: 50%;
  background: radial-gradient(circle, #fff6cf, var(--gold) 55%, transparent 72%);
  box-shadow: 0 0 10px var(--gold2);
  animation: fly 1s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}
.spark.ember {
  background: radial-gradient(circle, #ffd0d6, var(--red) 55%, transparent 72%);
  box-shadow: 0 0 10px var(--red);
}
@keyframes fly {
  to { transform: translate(var(--dx), calc(var(--dy) + 55px)) scale(0.15); opacity: 0; }
}

/* Post Page & Rich Markdown Typography */
.postpage {
  max-width: 840px;
  margin: auto;
  padding: 26px 22px 44px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--mut);
}
.state {
  color: var(--mut);
}
#pTitle {
  font-size: clamp(1.9rem, 5vw, 3rem);
  margin: 8px 0 10px;
  line-height: 1.3;
}
.meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mut);
  margin-bottom: 22px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.body {
  font-size: 1.12rem;
  line-height: 2;
  color: #eee3cf;
  word-break: break-word;
}
.body p {
  margin: 0 0 16px;
  white-space: pre-wrap;
}
.body h2, .body h3, .body h4 {
  color: var(--gold2);
  margin: 26px 0 10px;
  line-height: 1.4;
}
.body blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border-inline-start: 4px solid var(--gold);
  background: rgba(212, 175, 55, 0.06);
  border-radius: 10px;
  color: #f6e7c4;
}
.body ul, .body ol {
  margin: 12px 0 18px;
  padding-inline-start: 24px;
}
.body code.inline-code {
  background: #1d160e;
  border: 1px solid #3a2e1f;
  color: var(--gold2);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.92em;
  direction: ltr;
  display: inline-block;
}
.code-block {
  margin: 16px 0;
  border: 1px solid #3a2e1f;
  border-radius: 14px;
  overflow: hidden;
  background: #0d0a07;
  direction: ltr;
  text-align: left;
}
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: #17120c;
  border-bottom: 1px solid #2e2417;
  font-size: 0.8rem;
  color: var(--mut);
  font-family: monospace;
}
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #f5ebd6;
}
.actions {
  margin: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.share-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Comments & Nested Replies */
#cmts {
  padding: 26px 0 0;
}
.cm {
  padding: 16px 18px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  animation: rise 0.45s both;
}
.cm.reply {
  margin-inline-start: 28px;
  background: #110d09;
  border-inline-start: 3px solid var(--gold3);
}
.cm p {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.cmtop {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cmtop time, .cmtop small {
  color: var(--mut);
  font-size: 0.8rem;
}
.cm-actions {
  margin-inline-start: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.badge {
  background: linear-gradient(135deg, #f6dc7a, #c79a22);
  color: #17110a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 10px;
  border-radius: 20px;
}

/* Dialogs, Inputs & Toasts */
dialog {
  background: linear-gradient(160deg, #1a140c, var(--card));
  color: var(--txt);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 18px;
  padding: 26px;
  width: min(420px, 92vw);
  box-shadow: 0 30px 90px #000, 0 0 50px rgba(212, 175, 55, 0.12);
}
dialog[open] {
  animation: rise 0.3s both;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(5px);
}
dialog h3.sub {
  margin: 0 0 12px;
}
dialog form button {
  margin-top: 6px;
}
input, textarea, select {
  width: 100%;
  margin: 6px 0 12px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid #3a2e1f;
  background: #0e0b08;
  color: var(--txt);
  font-family: inherit;
  font-size: 0.98rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
input[type=file] {
  padding: 8px;
}
.err {
  color: #ff7a8a;
  min-height: 1.2em;
  font-size: 0.9rem;
}
#toasts {
  position: fixed;
  top: 72px;
  inset-inline-start: 14px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: block;
  background: linear-gradient(160deg, #1c150c, var(--card));
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 12px 16px;
  max-width: 320px;
  box-shadow: 0 10px 34px #000c, 0 0 26px rgba(212, 175, 55, 0.18);
  color: var(--txt);
  animation: slide 0.45s cubic-bezier(0.2, 1.2, 0.3, 1) both;
}
@keyframes slide {
  from { opacity: 0; transform: translateX(-30px); }
}
.toast b {
  color: var(--gold2);
}
footer {
  text-align: center;
  color: var(--mut);
  padding: 36px 20px;
  border-top: 1px solid #1f180f;
  margin-top: 30px;
}

/* Floating Back-to-Top Button */
#topBtn {
  position: fixed;
  bottom: 22px;
  inset-inline-end: 22px;
  z-index: 80;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.2rem;
  box-shadow: 0 8px 25px #000c, 0 0 18px rgba(212, 175, 55, 0.3);
}

/* Admin Dashboard */
.note {
  color: var(--mut);
  font-size: 0.9rem;
  margin: 0 0 10px;
}
.note.ok { color: #7be29a; }
.note.bad { color: #ff7a8a; }
.mut { color: var(--mut); }
.lbl {
  display: block;
  margin: 12px 0 2px;
  color: var(--gold2);
  font-weight: 600;
}
.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  cursor: pointer;
}
.chk input {
  width: auto;
  margin: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  position: relative;
  background: linear-gradient(160deg, #1a140c, var(--card));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  color: var(--mut);
  transition: 0.3s;
  overflow: hidden;
}
.stat:hover {
  border-color: rgba(212, 175, 55, 0.55);
  transform: translateY(-3px);
}
.stat b {
  display: block;
  font-size: 2rem;
  font-family: "Cinzel", serif;
  background: var(--gtext);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin: 14px 0;
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.chart {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 170px;
  margin: 10px 0 26px;
}
.chart .c {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}
.chart .v {
  width: 100%;
  background: linear-gradient(to top, #8a6a12, #c79a22);
  border-radius: 5px 5px 0 0;
  min-height: 2px;
  position: relative;
  overflow: hidden;
  transition: 0.3s;
}
.chart .v:hover { filter: brightness(1.3); }
.chart .u {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: linear-gradient(to top, #f6dc7a, #fff1b3);
  opacity: 0.9;
}
.chart small {
  position: absolute;
  bottom: -22px;
  font-size: 0.62rem;
  color: var(--mut);
}
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.bar span {
  min-width: 96px;
  font-size: 0.9rem;
  word-break: break-all;
}
.track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
}
.track i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8a6a12, #f6dc7a);
  border-radius: 8px;
  transition: width 0.3s;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.slugrow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.slugrow input {
  flex: 1;
  min-width: 140px;
  margin: 6px 0;
}
.slugrow .pre {
  color: var(--mut);
  font-size: 0.9rem;
  word-break: break-all;
}
.att {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 8px 0;
  border: 1px dashed #3a2e1f;
  border-radius: 10px;
}
.att img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}
.att span {
  flex: 1;
  word-break: break-all;
}
.linkbox {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--gold);
  border-radius: 14px;
  background: rgba(212, 175, 55, 0.07);
  animation: rise 0.5s both;
}
.post-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.pr-title {
  font-size: 1.2rem;
  font-weight: 700;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.chips span {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 12px;
  font-size: 0.8rem;
  color: var(--mut);
}
.pr-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.md-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 2px;
}

/* Gallery, Lightbox, File Cards, Ads, Media Library */
.noscroll { overflow: hidden; }
.gallery {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 150px;
  margin: 6px 0 22px;
}
.gallery.g1 { grid-template-columns: 1fr; grid-auto-rows: min(58vw, 470px); }
.gallery.g2 { grid-template-columns: 1fr 1fr; grid-auto-rows: min(40vw, 300px); }
.gallery.g3 { grid-template-columns: repeat(3, 1fr); }
.gallery.g6 { grid-template-columns: repeat(4, 1fr); }
.gallery.g3 .gi:first-child, .gallery.g4 .gi:first-child, .gallery.g5 .gi:first-child {
  grid-column: span 2;
  grid-row: span 2;
}
.gallery.g4 .gi:nth-child(2) { grid-column: span 2; }
.gi {
  position: relative;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #110d09;
  cursor: zoom-in;
  box-shadow: 0 10px 34px #000b;
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.gi::after { display: none; }
.gi:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.7);
  box-shadow: 0 18px 50px #000d, 0 0 30px rgba(212, 175, 55, 0.2);
}
.gi img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.gi:hover img { transform: scale(1.07); }
.gi::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 35%, rgba(246, 220, 122, 0.16) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.8s;
}
.gi:hover::before { transform: translateX(120%); }

.lb {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 4, 3, 0.95);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.25s;
}
.lb.show { opacity: 1; }
.lbframe {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 56px 70px;
}
.lbframe img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid rgba(212, 175, 55, 0.6);
  border-radius: 12px;
  box-shadow: 0 0 70px rgba(212, 175, 55, 0.2), 0 30px 90px #000;
  opacity: 0;
}
.lbframe img.in { animation: lbin 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes lbin {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}
.lbbtn {
  position: absolute;
  z-index: 2;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  line-height: 1;
  background: rgba(20, 16, 11, 0.85);
  color: var(--gold2);
  border: 1px solid rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 24px #000;
}
.lbbtn:hover {
  background: var(--gold);
  color: #17110a;
  transform: scale(1.1);
}
.lbx { top: 16px; inset-inline-end: 16px; }
.lbp { top: 50%; inset-inline-start: 14px; margin-top: -23px; }
.lbn { top: 50%; inset-inline-end: 14px; margin-top: -23px; }
.lbcount {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold2);
  font-family: "Cinzel", serif;
  letter-spacing: 0.1em;
  background: rgba(20, 16, 11, 0.85);
  padding: 2px 16px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 12px 0;
}
.fcard {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #1a140c, var(--card));
  color: var(--txt);
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.fcard:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 175, 55, 0.7);
  box-shadow: 0 18px 50px #000d, 0 0 34px rgba(212, 175, 55, 0.2);
  color: var(--txt);
}
.fthumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0c0906;
}
.fthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.fcard:hover .fthumb img { transform: scale(1.08); }
.fthumb.noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #2a200f, #0c0906);
}
.fic svg {
  width: 54px;
  height: 54px;
  fill: none;
  stroke: var(--gold2);
  stroke-width: 1.3;
  filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.4));
}
.fext {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #17110a;
  background: linear-gradient(135deg, #f6dc7a, #c79a22);
  padding: 2px 10px;
  border-radius: 20px;
}
.fthumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 16, 11, 0.8), transparent 55%);
}
.finfo {
  padding: 12px 16px 6px;
  display: flex;
  flex-direction: column;
}
.finfo b {
  word-break: break-word;
  font-size: 1rem;
}
.finfo small { color: var(--mut); }
.fcard .dl {
  margin: 6px 16px 16px;
  text-align: center;
  color: #17110a;
  background: linear-gradient(135deg, #f6dc7a, #c79a22 55%, #8a6a12);
  padding: 7px 14px;
  border-radius: 10px;
  font-weight: 700;
  transition: 0.3s;
}
.fcard:hover .dl {
  box-shadow: 0 8px 26px rgba(212, 175, 55, 0.4);
  letter-spacing: 0.04em;
}
.fcard::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(246, 220, 122, 0.14), transparent);
  transform: skewX(-20deg);
  transition: left 0.8s;
  pointer-events: none;
}
.fcard:hover::after { left: 140%; }
.fcard.pulse { animation: fpulse 0.9s ease-out; }
@keyframes fpulse {
  0% { box-shadow: 0 0 0 0 rgba(246, 220, 122, 0.65); }
  100% { box-shadow: 0 0 0 34px rgba(246, 220, 122, 0); }
}

.adwrap {
  max-width: 980px;
  margin: auto;
  padding: 0 22px;
}
.adslot:empty { display: none; }
.ad {
  position: relative;
  margin: 22px auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  max-width: 100%;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.ad:hover {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 12px 40px #000c, 0 0 26px rgba(212, 175, 55, 0.14);
}
.ad img { display: block; width: 100%; height: auto; }
.ad > a { display: block; }
.adtag {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 2;
  font-size: 0.68rem;
  background: rgba(0, 0, 0, 0.75);
  color: var(--gold2);
  padding: 0 10px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  pointer-events: none;
}
.adtext { display: block; padding: 20px 26px; color: var(--txt); }
.adtext b { display: block; font-size: 1.15rem; color: var(--gold2); font-family: "El Messiri", "Cairo", serif; }
.adtext span { display: block; color: var(--mut); }
.adframe { display: block; width: 100%; border: 0; background: transparent; }

.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.tile { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0e0b08; }
.tile.cover { border-color: var(--gold); box-shadow: 0 0 20px rgba(212, 175, 55, 0.2); }
.tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.tile .cv { position: absolute; top: 6px; inset-inline-start: 6px; background: var(--gold); color: #17110a; font-size: 0.72rem; font-weight: 700; padding: 0 8px; border-radius: 20px; }
.tb { display: flex; gap: 5px; flex-wrap: wrap; padding: 6px; }
.extb { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 10; background: radial-gradient(circle at 50% 40%, #2a200f, #0c0906); color: var(--gold2); font-family: "Cinzel", serif; font-weight: 800; letter-spacing: 0.08em; }
.file-att { align-items: stretch; }
.file-att .fth { width: 92px; flex: none; border-radius: 8px; overflow: hidden; align-self: flex-start; }
.file-att .fth img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.file-att .fb { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.file-att .tb { padding: 6px 0 0; }
dialog.wide { width: min(900px, 94vw); max-height: 88vh; overflow: auto; }
.libhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.libfoot { display: flex; gap: 8px; margin-top: 14px; position: sticky; bottom: -26px; background: var(--card); padding: 10px 0; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 10px 0; }
.mt { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 8px; background: var(--card); color: var(--txt); border: 1px solid var(--line); border-radius: 12px; box-shadow: none; overflow: hidden; }
.mt::after { display: none; }
.mt:hover { border-color: var(--gold); transform: none; box-shadow: 0 0 20px rgba(212, 175, 55, 0.2); color: var(--txt); }
.mt.sel { border-color: var(--gold); background: rgba(212, 175, 55, 0.1); box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.4); }
.mt.static { cursor: default; }
.mt img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; }
.mt .mn { word-break: break-all; font-size: 0.85rem; }
.libbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.chips span.on { border-color: #3fbf6a; color: #7be29a; }
.adprev { width: 120px; max-height: 70px; object-fit: cover; border-radius: 8px; }
.bad { color: #ff7a8a; }

/* Reserved Usernames Grid in Admin */
.uname-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.uname-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: #1a140c;
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold2);
  font-family: monospace;
  font-size: 0.88rem;
  direction: ltr;
  cursor: pointer;
  transition: 0.2s;
}
.uname-chip.active, .uname-chip:hover {
  background: linear-gradient(135deg, #f6dc7a, #c79a22);
  color: #17110a;
  font-weight: 700;
}

/* Mobile Responsive Rules (with .gallery.g6 properly inside media query!) */
@media (max-width: 700px) {
  .hero { display: block; min-height: 0; }
  .hero img { position: static; height: auto; aspect-ratio: 1 / 1; object-position: center top; animation: none; }
  .hero::after { display: none; }
  .hero canvas { height: 100vw; }
  .hero .in { padding: 18px 20px 30px; }
  .hi { display: none; }
  .navr { gap: 6px; }
  .navr .btn, .navr button { padding: 7px 12px; font-size: 0.88rem; }
  .cols { grid-template-columns: 1fr; }
  .post .ov { padding: 20px; }
  header.nav { padding: 10px 14px; }
  .gallery.g3, .gallery.g4, .gallery.g5, .gallery.g6 {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 42vw;
  }
  .gallery.g3 .gi:first-child, .gallery.g4 .gi:first-child, .gallery.g5 .gi:first-child {
    grid-column: span 2;
    grid-row: span 2;
  }
  .gallery.g4 .gi:nth-child(2) { grid-column: auto; }
  .lbframe { padding: 56px 10px; }
  .lbp { inset-inline-start: 6px; }
  .lbn { inset-inline-end: 6px; }
  .gallery.g4 .gi:last-child, .gallery.g6 .gi:last-child:nth-child(even) { grid-column: span 2; }
  .gallery.g3 .gi:last-child:nth-child(even), .gallery.g5 .gi:last-child:nth-child(even) { grid-column: span 2; }
  .cm.reply { margin-inline-start: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
}

/* ===== v4.5: Cloud Scripts Hub, AI Prompt Card & Live Runner Modal ===== */
.ai-prompt-card {
  background: linear-gradient(155deg, #1d160c, #130f09);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.65), 0 0 24px rgba(212, 175, 55, 0.12);
}
.ai-prompt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ai-prompt-pre {
  margin: 14px 0 0;
  padding: 14px;
  background: #0b0906;
  border: 1px solid #3a2e1f;
  border-radius: 12px;
  color: #f3e8d2;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.7;
  max-height: 260px;
  overflow-y: auto;
}
.runner-dlg {
  width: min(1060px, 95vw);
  height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
}
.runner-dlg:not([open]) {
  display: none !important;
}
.runner-frame {
  flex: 1;
  width: 100%;
  min-height: 68vh;
  border: 1px solid #3a2e1f;
  border-radius: 12px;
  background: #fff;
  margin-top: 12px;
}
.exp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}
.exp-badge.perm {
  background: linear-gradient(135deg, #f6dc7a, #c79a22);
  color: #17110a;
  border-color: transparent;
}

/* ===== v5.1: Luxury Visual Polish, Live Stats Strip, Pulse Dot & Mobile Modals ===== */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  max-width: 980px;
  margin: -24px auto 12px;
  padding: 0 22px;
  position: relative;
  z-index: 5;
}
.stat-pill {
  background: linear-gradient(155deg, rgba(26, 20, 12, 0.92), rgba(16, 12, 8, 0.95));
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  transition: transform 0.25s, border-color 0.25s;
}
.stat-pill:hover {
  transform: translateY(-4px);
  border-color: var(--gold2);
}
.stat-pill b {
  display: block;
  font-size: 1.55rem;
  font-family: "Cinzel", "Cairo", sans-serif;
  background: var(--gtext);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-pill span {
  font-size: 0.84rem;
  color: var(--mut);
}

.tpl-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0 4px;
}

.panel {
  transition: border-color 0.3s, box-shadow 0.3s;
}
.panel:hover {
  border-color: rgba(212, 175, 55, 0.35);
}

@media (max-width: 700px) {
  .stats-strip {
    margin-top: 10px;
    grid-template-columns: repeat(2, 1fr);
  }
  dialog.runner-dlg {
    width: 96vw;
    height: 88vh;
    padding: 12px;
  }
  .runner-frame {
    min-height: 66vh;
  }
}

/* ===== v5.2: Luxury Themes (Royal Gold / Emerald / Sapphire / Crimson), Cursor Glow, 3D Tilt, Command Palette & Reactions ===== */
body[data-theme="emerald"] {
  --gold: #10b981;
  --gold2: #6ee7b7;
  --gold3: #047857;
  --line: #17332a;
  --gtext: linear-gradient(100deg, #047857 0%, #6ee7b7 28%, #d1fae5 50%, #6ee7b7 72%, #047857 100%);
}
body[data-theme="sapphire"] {
  --gold: #38bdf8;
  --gold2: #7dd3fc;
  --gold3: #0369a1;
  --line: #152b3b;
  --gtext: linear-gradient(100deg, #0369a1 0%, #7dd3fc 28%, #e0f2fe 50%, #7dd3fc 72%, #0369a1 100%);
}
body[data-theme="crimson"] {
  --gold: #f43f5e;
  --gold2: #fda4af;
  --gold3: #9f1239;
  --line: #361722;
  --gtext: linear-gradient(100deg, #9f1239 0%, #fda4af 28%, #ffe4e6 50%, #fda4af 72%, #9f1239 100%);
}

/* Luxury Ambient Cursor Halo */
#cursorHalo {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translate3d(-500px, -500px, 0);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 65%);
  transition: opacity 0.3s;
  will-change: transform;
}
body[data-theme="emerald"] #cursorHalo { background: radial-gradient(circle, rgba(16, 185, 129, 0.11) 0%, transparent 65%); }
body[data-theme="sapphire"] #cursorHalo { background: radial-gradient(circle, rgba(56, 189, 248, 0.11) 0%, transparent 65%); }
body[data-theme="crimson"] #cursorHalo { background: radial-gradient(circle, rgba(244, 63, 94, 0.11) 0%, transparent 65%); }

/* Theme Switcher Dots */
.theme-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.tdot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid transparent;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.tdot::after { display: none; }
.tdot:hover, .tdot.on { transform: scale(1.22); border-color: #fff; box-shadow: 0 0 10px currentColor; }
.tdot.gold { background: #d4af37; color: #d4af37; }
.tdot.emerald { background: #10b981; color: #10b981; }
.tdot.sapphire { background: #38bdf8; color: #38bdf8; }
.tdot.crimson { background: #f43f5e; color: #f43f5e; }

/* Typing Caret Effect in Hero */
.type-caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--gold2);
  margin-inline-start: 4px;
  vertical-align: middle;
  animation: blinkCaret 0.9s step-end infinite;
}
@keyframes blinkCaret {
  50% { opacity: 0; }
}

/* Multi-Emoji Reactions Bar */
.react-bar {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--txt);
  font-size: 0.88rem;
  box-shadow: none;
}
.react-btn::after { display: none; }
.react-btn:hover, .react-btn.on {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold2);
  transform: translateY(-2px) scale(1.05);
}

/* Floating Luxury Tools Grid & QR */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}
.qr-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.qr-preview img {
  width: 190px;
  height: 190px;
  border-radius: 14px;
  border: 2px solid var(--gold);
  background: #fff;
  padding: 8px;
}

/* Command Palette Dialog (Ctrl+K) */
dialog.cmd-dlg {
  width: min(560px, 94vw);
  padding: 18px;
}
.cmd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: start;
  padding: 10px 14px;
  margin: 5px 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--txt);
  font-weight: 600;
  box-shadow: none;
}
.cmd-item::after { display: none; }
.cmd-item:hover {
  background: rgba(212, 175, 55, 0.14);
  border-color: var(--gold);
  color: var(--gold2);
}

@media (max-width: 700px) {
  #cursorHalo { display: none; }
  .theme-dots { display: none; }
}

/* ===== v5.3: Telegram Premium Style Animated SVG Stickers, Reactions & Burst Effects ===== */
.tg-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  flex-shrink: 0;
}
.tg-ico.lg {
  width: 30px;
  height: 30px;
}
.tg-ico svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 8px rgba(246, 220, 122, 0.55));
}

/* Smooth Telegram-Premium-like continuous animations */
@keyframes tgCrownFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg) scale(1); }
  50% { transform: translateY(-2.5px) rotate(3deg) scale(1.08); }
}
@keyframes tgFireFlicker {
  0%, 100% { transform: scale(1) skewX(0deg); filter: drop-shadow(0 0 8px #ff6b00); }
  35% { transform: scale(1.12, 1.18) skewX(-4deg); filter: drop-shadow(0 0 14px #ff2e55); }
  70% { transform: scale(0.96, 1.06) skewX(3deg); filter: drop-shadow(0 0 10px #ffb800); }
}
@keyframes tgDiamondPulse {
  0%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 7px #38bdf8); }
  50% { transform: scale(1.14) rotate(6deg); filter: drop-shadow(0 0 16px #7dd3fc); }
}
@keyframes tgRocketShake {
  0%, 100% { transform: translate(0, 0) rotate(-6deg); }
  25% { transform: translate(1px, -2px) rotate(0deg); }
  50% { transform: translate(-1px, -3px) rotate(4deg); }
  75% { transform: translate(1px, -1px) rotate(-2deg); }
}
@keyframes tgStarSpin {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.18) rotate(180deg); filter: drop-shadow(0 0 14px #f6dc7a); }
  100% { transform: scale(1) rotate(360deg); }
}
@keyframes tgBoltFlash {
  0%, 85%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px #facc15); }
  92% { transform: scale(1.22); filter: drop-shadow(0 0 18px #fff59d); }
}
@keyframes tgHeartBeat {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.25); }
  40% { transform: scale(0.95); }
  60% { transform: scale(1.18); }
}
@keyframes tgStickerPop {
  0% { transform: scale(0.5) rotate(-18deg); opacity: 0; }
  45% { transform: scale(1.35) rotate(8deg); opacity: 1; }
  100% { transform: translateY(-95px) scale(0.85) rotate(0deg); opacity: 0; }
}

.tg-crown svg { animation: tgCrownFloat 2.8s ease-in-out infinite; }
.tg-fire svg { animation: tgFireFlicker 1.4s ease-in-out infinite; transform-origin: bottom center; }
.tg-diamond svg { animation: tgDiamondPulse 2.4s ease-in-out infinite; }
.tg-rocket svg { animation: tgRocketShake 1.8s ease-in-out infinite; }
.tg-star svg { animation: tgStarSpin 5.5s linear infinite; }
.tg-bolt svg { animation: tgBoltFlash 2.6s ease-in-out infinite; }
.tg-heart svg { animation: tgHeartBeat 1.8s ease-in-out infinite; }

/* Floating Telegram Premium Reaction Burst on Click */
.tg-burst {
  position: fixed;
  z-index: 250;
  pointer-events: none;
  width: 54px;
  height: 54px;
  margin-left: -27px;
  margin-top: -27px;
  animation: tgStickerPop 1.05s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
.tg-burst svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 20px rgba(246, 220, 122, 0.8));
}

/* Interactive Sticker Picker Bar in Comments */
.sticker-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.stk-pick-btn {
  width: 38px;
  height: 38px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid var(--line);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stk-pick-btn::after { display: none; }
.stk-pick-btn:hover {
  transform: scale(1.2) translateY(-3px);
  border-color: var(--gold2);
  background: rgba(212, 175, 55, 0.18);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.28);
}

/* Premium Sticker Showcase Strip */
.tg-showcase {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.14), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(246, 220, 122, 0.45);
}


/* === YelmAi v6.0 Luxury Tech Hero (No Personal Photo) & AdSense Footer === */
.hero {
  min-height: 76vh !important;
  align-items: center !important;
  background: radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.16), transparent 52%),
              radial-gradient(circle at 80% 75%, rgba(180, 120, 40, 0.14), transparent 55%),
              #0a0806 !important;
}
.hero-mesh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 20%, transparent 78%);
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(68px);
  opacity: 0.42;
  will-change: transform;
}
.hero-orb-1 {
  width: 440px;
  height: 440px;
  top: -110px;
  right: -80px;
  background: radial-gradient(circle, var(--gold, #d4af37), transparent 70%);
  animation: orbFloat1 16s ease-in-out infinite alternate;
}
.hero-orb-2 {
  width: 380px;
  height: 380px;
  bottom: -90px;
  left: -60px;
  background: radial-gradient(circle, #9a6b24, transparent 70%);
  animation: orbFloat2 20s ease-in-out infinite alternate;
}
@keyframes orbFloat1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-45px, 35px, 0) scale(1.14); }
}
@keyframes orbFloat2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, -30px, 0) scale(1.12); }
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 0.9rem;
}
.foot-links a {
  color: var(--mut);
  text-decoration: none;
  transition: color 0.2s;
}
.foot-links a:hover {
  color: var(--gold2, #f5d77f);
}


/* === YelmAi v7.0 Telegram-Premium VIP Statuses, Animated Badges & Reading UX === */
.read-progress {
  position: fixed;
  top: 0;
  right: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #f6dc7a, #d4af37, #a855f7);
  z-index: 9999;
  transition: width 0.08s linear;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.7);
}
.role-badge.vip {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(212, 175, 55, 0.28));
  border: 1px solid rgba(212, 175, 55, 0.65);
  color: #fde68a;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.28);
}
.role-badge.guest {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--mut);
}
.vip-name {
  background: linear-gradient(90deg, #fde68a, #f59e0b, #c084fc, #fde68a);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: vipShimmer 4.5s linear infinite;
}
@keyframes vipShimmer {
  0% { background-position: 0% center; }
  100% { background-position: 220% center; }
}
.vip-pill-btn {
  border-color: rgba(212, 175, 55, 0.55) !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.18);
}
.active-vip-stk {
  border-color: #f6dc7a !important;
  background: rgba(212, 175, 55, 0.22) !important;
  transform: scale(1.12);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.45);
}
.tg-wing {
  transform-origin: center;
  animation: tgWingFlap 1.6s ease-in-out infinite alternate;
}
@keyframes tgWingFlap {
  from { transform: scaleX(1) translateY(0); }
  to { transform: scaleX(0.84) translateY(-2px); }
}
.ssr-card {
  padding: 18px;
  border-radius: 16px;
  background: var(--card, rgba(22, 18, 13, 0.85));
  border: 1px solid var(--border, rgba(212, 175, 55, 0.2));
  margin-bottom: 14px;
}
.ssr-card h3 a {
  color: var(--gold2, #f6dc7a);
  text-decoration: none;
}


/* === YelmAi v8.0 Luxury Typography (IBM Plex Sans Arabic + Tajawal), 120-Emoji Modal & Visual Polish === */
html, body, button, input, textarea, select {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Cairo', system-ui, -apple-system, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .logo {
  font-family: 'Tajawal', 'IBM Plex Sans Arabic', 'Cinzel', sans-serif !important;
  letter-spacing: -0.01em;
}
.body {
  font-size: 17.5px;
  line-height: 1.96 !important;
}
.body h2 {
  margin: 28px 0 12px;
  padding-right: 12px;
  border-right: 3px solid var(--gold, #d4af37);
  color: var(--gold2, #f6dc7a);
  font-size: 1.28rem;
}
.body ul {
  padding-right: 22px;
  margin: 12px 0 18px;
}
.body li {
  margin-bottom: 8px;
}
.panel, .card, .ssr-card {
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.card:hover, .ssr-card:hover {
  border-color: rgba(212, 175, 55, 0.55) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 18px rgba(212, 175, 55, 0.14);
  transform: translateY(-2px);
}
/* 120 Premium Emoji Modal Grid */
.emoji-modal {
  max-width: 720px !important;
  width: 94vw !important;
}
.pem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px;
}
.pem-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.16);
  color: var(--text, #f3ece0);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.pem-item:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(246, 220, 122, 0.65);
  background: rgba(212, 175, 55, 0.12);
}
.pem-item small {
  font-size: 0.7rem;
  color: var(--mut);
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pem-item .tg-stk {
  width: 28px;
  height: 28px;
}
/* Extra Telegram-Premium Sticker Animations */
.tg-spin svg { animation: tgSpin 6s linear infinite; }
.tg-bounce svg { animation: tgBounce 1.8s ease-in-out infinite; }
.tg-pulse svg { animation: tgPulse 2s ease-in-out infinite; }
@keyframes tgSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes tgBounce { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.06); } }
@keyframes tgPulse { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(212,175,55,0.45)); } 50% { transform: scale(1.1); filter: drop-shadow(0 0 9px rgba(168,85,247,0.7)); } }

/* Floating Quick-Actions Dock */
.quick-dock {
  position: fixed;
  bottom: 20px;
  left: 18px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dock-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(16, 12, 8, 0.88);
  color: #f6dc7a;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}
.dock-btn:hover {
  transform: scale(1.1);
  background: rgba(212, 175, 55, 0.22);
}


/* === YelmAi v9.0 Luxury AI Hero Artwork, Notification Bell & Premium Spotlight === */
.hero-bg-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.52;
  z-index: 0;
  animation: kenburns 28s ease-in-out infinite alternate;
  will-change: transform;
  pointer-events: none;
  filter: contrast(1.08) saturate(1.12);
}
.nav {
  border-bottom: 1px solid rgba(212, 175, 55, 0.25) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}
.notif-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.notif-bell-btn.has-unread {
  border-color: rgba(246, 220, 122, 0.75) !important;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
}
.notif-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.notif-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.18);
  margin-bottom: 10px;
}
.toast-click {
  border: 1px solid rgba(246, 220, 122, 0.6) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 16px rgba(212, 175, 55, 0.25);
}
.emoji-showcase-card {
  padding: 16px 18px !important;
  border: 1px solid rgba(212, 175, 55, 0.32) !important;
  background: linear-gradient(135deg, rgba(22, 17, 11, 0.9), rgba(32, 22, 12, 0.72)) !important;
}
.emoji-showcase-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.card, .panel, .ssr-card {
  background-image: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(212, 175, 55, 0.08), transparent 60%);
}


/* === YelmAi v10.0 Luxury WhatsApp/Telegram Direct Chat & Premium Gold SVG Controls === */
.chat-page-wrap {
  max-width: 860px;
  margin: 26px auto 40px;
  padding: 0 16px;
}
.chat-gate {
  text-align: center;
  padding: 46px 24px !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  background: radial-gradient(circle at top, rgba(212, 175, 55, 0.12), rgba(14, 11, 8, 0.94)) !important;
}
.chat-shell {
  display: flex;
  flex-direction: column;
  height: min(76vh, 700px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background: linear-gradient(180deg, rgba(18, 14, 10, 0.96), rgba(10, 8, 6, 0.98));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65), 0 0 28px rgba(212, 175, 55, 0.1);
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(24, 18, 12, 0.95);
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}
.chat-peer {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(168, 85, 247, 0.22));
  border: 1.5px solid rgba(246, 220, 122, 0.65);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.3);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-image: radial-gradient(rgba(212, 175, 55, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
}
.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--mut);
  max-width: 380px;
  line-height: 1.8;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(212, 175, 55, 0.25);
}
.chat-row {
  display: flex;
  width: 100%;
}
.chat-row.me { justify-content: flex-start; }
.chat-row.them { justify-content: flex-end; }
.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.65;
  animation: chatPop 0.22s ease;
}
@keyframes chatPop {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-bubble.me {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.24), rgba(160, 118, 28, 0.18));
  border: 1px solid rgba(246, 220, 122, 0.42);
  border-bottom-right-radius: 4px;
}
.chat-bubble.them {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-left-radius: 4px;
}
.chat-txt {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.96rem;
}
.chat-meta {
  font-size: 0.72rem;
  color: var(--mut);
  margin-top: 4px;
  text-align: left;
}
.chat-img-box {
  margin-bottom: 6px;
}
.chat-img-box img {
  display: block;
  max-width: 260px;
  max-height: 260px;
  border-radius: 12px;
  cursor: zoom-in;
  border: 1px solid rgba(212, 175, 55, 0.35);
}
.chat-exp-tag {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.chat-exp-tag.perm {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}
.chat-img-expired {
  font-size: 0.82rem;
  color: var(--mut);
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
}
.chat-img-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(212, 175, 55, 0.08);
  border-top: 1px solid rgba(212, 175, 55, 0.22);
}
.chat-img-preview img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
}
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(20, 15, 10, 0.96);
  border-top: 1px solid rgba(212, 175, 55, 0.22);
}
.chat-input-bar input[type="text"] {
  flex: 1;
  margin: 0 !important;
  border-radius: 999px !important;
  padding: 10px 16px !important;
}
.chat-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(255, 255, 255, 0.04);
  color: #f6dc7a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-icon-btn:hover {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(246, 220, 122, 0.7);
}
.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-chat-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
}
@media (max-width: 780px) {
  .admin-chat-grid { grid-template-columns: 1fr; }
}
.admin-chat-threads {
  max-height: 460px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-thread-item {
  width: 100%;
  text-align: right;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.18);
  color: var(--text, #f3ece0);
  cursor: pointer;
}
.admin-thread-item.on {
  border-color: rgba(246, 220, 122, 0.75);
  background: rgba(212, 175, 55, 0.14);
}
.prem-ui-ico {
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.45));
}
.dock-btn {
  text-decoration: none;
  background: linear-gradient(145deg, rgba(28, 21, 13, 0.94), rgba(14, 10, 6, 0.96)) !important;
  border: 1.5px solid rgba(246, 220, 122, 0.55) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 245, 200, 0.25) !important;
}
.dock-chat {
  background: linear-gradient(135deg, #d4af37, #92400e) !important;
  color: #120d06 !important;
}

/* === YelmAi v13.0 Big Telegram-Premium Stickers & Expressive Chat/Comment UX === */
.tg-stk.xl {
  width: 58px !important;
  height: 58px !important;
  margin: 4px 3px !important;
  filter: drop-shadow(0 6px 14px rgba(212, 175, 55, 0.35));
}
.tg-stk.xl svg {
  width: 58px !important;
  height: 58px !important;
}
.cm-live-preview {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px dashed rgba(212, 175, 55, 0.35);
  margin: 6px 0 8px;
  line-height: 1.8;
}
.chat-quick-stickers {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-top: 1px solid rgba(212, 175, 55, 0.16);
}

/* === YelmAi v13.1 Visual Web vs API Runtime Picker === */
.rt-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.rt-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 11px 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(212, 175, 55, 0.22);
  color: var(--text, #f3ece0);
  cursor: pointer;
  transition: all 0.18s ease;
}
.rt-pick-btn small {
  font-size: 0.74rem;
  color: var(--mut);
  font-family: monospace;
}
.rt-pick-btn.on, .rt-pick-btn:hover {
  border-color: var(--gold2, #f6dc7a);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(168, 85, 247, 0.12));
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.22);
}
.rt-pick-btn.on b { color: var(--gold2, #f6dc7a); }
