/* RAKAN · homepage additions (2026-10-27): command chips on the feature cards, the live leaderboard window, quick start, the category
   comparison, the commands page and the floating Support button. Loaded after pro.css (and before mobile.css) on index.html / ar.html,
   and after the page styles on docs / leaderboard / commands pages. Reuses the site variables (styles.css + pro.css). */

:root {
  --hm-card: var(--card-bg, linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)), #08111f);
  --hm-line: var(--card-line, rgba(150, 185, 230, 0.13));
  --hm-shadow: var(--card-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 48px -30px rgba(0, 0, 0, 0.75));
  --hm-gold: #ffcf6e;
}

/* ── command chips (copy buttons) ── */
.cmd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.cmd-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font: 500 .74rem/1 var(--mono); letter-spacing: 0; color: #d6ecff;
  padding: 6px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(34, 195, 255, 0.22); cursor: pointer; white-space: nowrap;
  direction: ltr; unicode-bidi: isolate; transition: border-color .2s, background .2s, color .2s; }
.cmd-chip .arg { color: var(--mute); font-weight: 400; }
.cmd-chip .cc-ico { width: 12px; height: 12px; flex: none; opacity: .55; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cmd-chip:hover { border-color: rgba(34, 195, 255, 0.55); background: rgba(34, 195, 255, 0.08); color: #fff; }
.cmd-chip:hover .cc-ico { opacity: 1; }
.cmd-chip.is-copied { border-color: rgba(52, 211, 153, 0.6); color: #c9f7e4; background: rgba(52, 211, 153, 0.08); }
.cmd-chip.is-copied::after { content: attr(data-done); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 5px 8px; border-radius: 6px;
  font: 600 .68rem/1 var(--body); color: #04121f; background: var(--lower); white-space: nowrap; pointer-events: none; z-index: 2; }
html[dir="rtl"] .cmd-chip.is-copied::after { font-family: var(--ar, var(--body)); }
.feat .cmd-chips, .svc .cmd-chips { margin-top: 4px; }
.svc .cmd-chips { margin-top: 12px; }
.feat .cmd-chips + .feat-btn { margin-top: 2px; }
.plan-tag { display: inline-block; margin-inline-start: 6px; padding: 3px 7px; border-radius: 999px; font: 600 .62rem/1 var(--mono); letter-spacing: .06em; vertical-align: middle;
  color: #cfe9ff; border: 1px solid rgba(34, 195, 255, 0.3); background: rgba(34, 195, 255, 0.06); white-space: nowrap; }
.plan-tag.free { color: #c9f7e4; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.06); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── live leaderboard window ── */
.lbw-band .sec-head, .qs-band .sec-head, .vs-band .sec-head { margin-inline: auto; text-align: center; justify-items: center; }
.lbw { max-width: 920px; margin: 0 auto; border-radius: 18px; overflow: hidden; background: var(--hm-card); border: 1px solid var(--hm-line); box-shadow: var(--hm-shadow), 0 40px 90px -50px rgba(255, 181, 71, 0.35); }
.lbw-bar { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--hm-line); background: rgba(255, 255, 255, 0.025); }
.lbw-dots { display: inline-flex; gap: 6px; flex: none; } .lbw-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.lbw-dots i:nth-child(1) { background: rgba(255, 90, 106, 0.55); } .lbw-dots i:nth-child(2) { background: rgba(255, 181, 71, 0.55); } .lbw-dots i:nth-child(3) { background: rgba(52, 211, 153, 0.55); }
.lbw-url { flex: 1; min-width: 0; font: 500 .74rem/1 var(--mono); color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; unicode-bidi: isolate; text-align: center; }
.lbw-live { display: inline-flex; align-items: center; gap: 7px; flex: none; font: 600 .66rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #b9c9dc; }
.lbw-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--lower); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); animation: hmPulse 1.6s ease-in-out infinite; }
.lbw[data-state="error"] .lbw-live i { background: var(--caution); box-shadow: 0 0 0 3px rgba(255, 181, 71, 0.18); animation: none; }
.lbw[data-state="loading"] .lbw-live i { background: var(--cyan); }
html[dir="rtl"] .lbw-live { letter-spacing: normal; text-transform: none; font-family: var(--ar, var(--mono)); }
@keyframes hmPulse { 50% { opacity: .35; } }
.lbw-body { display: grid; gap: 16px; padding: 18px; }
.lbw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lbw-tile { min-width: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--hm-line); background: rgba(255, 255, 255, 0.02); }
.lbw-tile b { display: block; font: 700 clamp(1.15rem, 2.6vw, 1.55rem)/1.15 var(--display); color: var(--white); overflow-wrap: anywhere; unicode-bidi: plaintext; }
.lbw-tile.best b { color: var(--hm-gold); }
.lbw-tile span { display: block; margin-top: 6px; font: 500 .7rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
html[dir="rtl"] .lbw-tile span { letter-spacing: normal; text-transform: none; font-family: var(--ar, var(--mono)); font-size: .78rem; }
.lbw-scroll { overflow-x: auto; border-radius: 14px; border: 1px solid var(--hm-line); }
.lbw-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.lbw-table th { padding: 10px 12px; font: 600 .68rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); text-align: start; border-bottom: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.02); white-space: nowrap; }
html[dir="rtl"] .lbw-table th { letter-spacing: normal; text-transform: none; font-family: var(--ar, var(--mono)); font-size: .76rem; }
.lbw-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lbw-table tbody tr:last-child td { border-bottom: 0; }
.lbw-table td.r { width: 3ch; font: 700 .95rem/1 var(--display); color: var(--white); }
.lbw-table td.nm { color: var(--white); font-weight: 600; white-space: normal; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: start; }
.lbw-table td.num { font-family: var(--mono); unicode-bidi: plaintext; }
.lbw-table td.pts { color: var(--hm-gold); font-weight: 600; }
.lbw-table td.up { color: var(--lower); } .lbw-table td.gold { color: var(--hm-gold); }
.lbw-table td.lbw-empty { padding: 22px 12px; text-align: center; color: var(--mute); white-space: normal; }
.lbw-table tr.sk td { color: transparent; }
.lbw-table tr.sk td span { display: block; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); }
.lbw-status { margin: 0; min-height: 1.3em; font-size: .85rem; color: var(--mute); }
.lbw[data-state="error"] .lbw-status { color: var(--caution); }
.lbw-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 2px; }
.lbw-foot p { margin: 0; font-size: .8rem; color: var(--mute); max-width: 52ch; }

/* ── quick start ── */
.qs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.qs-step { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 22px 20px 20px; border-radius: 16px; background: var(--hm-card); border: 1px solid var(--hm-line); box-shadow: var(--hm-shadow); }
.qs-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font: 700 .95rem/1 var(--display); color: #04121f; background: var(--grad); }
.qs-step h3 { font-size: 1.08rem; }
.qs-step p { margin: 0; color: var(--mute); font-size: .9rem; line-height: 1.55; flex: 1; }
html[dir="rtl"] .qs-step p, html[dir="rtl"] .lbw-foot p, html[dir="rtl"] .vs-note, html[dir="rtl"] .lbw-status { font-family: var(--ar, var(--body)); }
.qs-more { margin: 18px 0 0; text-align: center; font-size: .92rem; color: var(--mute); }
.qs-more a { font-weight: 600; }

/* ── category comparison ── */
.vs-wrap { max-width: 920px; margin: 0 auto; overflow-x: auto; border-radius: 16px; background: var(--hm-card); border: 1px solid var(--hm-line); box-shadow: var(--hm-shadow); }
.vs { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .92rem; }
.vs col.c-feat { width: 40%; }
.vs th, .vs td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.vs tbody tr:last-child th, .vs tbody tr:last-child td { border-bottom: 0; }
.vs thead th { font: 600 .9rem/1.25 var(--display); color: var(--white); background: rgba(255, 255, 255, 0.025); }
.vs thead th.rk { color: #fff; background: linear-gradient(180deg, rgba(34, 195, 255, 0.16), rgba(34, 195, 255, 0.05)); box-shadow: inset 0 2px 0 var(--cyan); }
.vs thead th:first-child { text-align: start; font: 600 .7rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
html[dir="rtl"] .vs thead th:first-child { letter-spacing: normal; text-transform: none; font-family: var(--ar, var(--mono)); font-size: .8rem; }
.vs tbody th { text-align: start; font-weight: 500; color: var(--text); line-height: 1.4; }
.vs td.rk { background: rgba(34, 195, 255, 0.045); }
.vs .mk { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 .8rem/1.2 var(--body); }
.vs .mk svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.vs .mk.y { color: var(--lower); } .vs .mk.p { color: var(--caution); } .vs .mk.n { color: #6f7d93; }
.vs-note { max-width: 920px; margin: 12px auto 0; font-size: .8rem; color: var(--mute); text-align: center; }

/* ── commands page ── */
.cmd-page { padding-block: 34px 80px; }
.cmd-wrap { display: grid; gap: 22px; max-width: 980px; }
.cmd-hero { display: grid; gap: 10px; }
.cmd-hero h1 { font-size: clamp(2rem, 5.4vw, 3.1rem); font-weight: 700; }
.cmd-hero p { margin: 0; color: var(--mute); max-width: 64ch; }
.cmd-search { position: relative; display: block; }
.cmd-search svg { position: absolute; inset-inline-start: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--mute); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.cmd-search input { width: 100%; font: 500 1rem/1.2 var(--body); color: var(--white); padding: 14px 16px; padding-inline-start: 44px; border-radius: 14px; border: 1px solid var(--line-2);
  background: rgba(8, 17, 31, 0.9); outline: none; -webkit-appearance: none; appearance: none; }
.cmd-search input::placeholder { color: #6f7d93; }
.cmd-search input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 195, 255, 0.18); }
.cmd-jump { display: flex; flex-wrap: wrap; gap: 8px; }
.cmd-jump a { font: 600 .82rem/1 var(--body); color: #dce8f6; text-decoration: none; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.cmd-jump a:hover { border-color: rgba(34, 195, 255, 0.5); }
.cmd-group { scroll-margin-top: 20px; border-radius: 18px; padding: 18px; background: var(--hm-card); border: 1px solid var(--hm-line); box-shadow: var(--hm-shadow); }
.cmd-group h2 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; margin-bottom: 6px; }
.cmd-group > p { margin: 0 0 10px; color: var(--mute); font-size: .9rem; }
.cmd-list { margin: 0; padding: 0; list-style: none; }
.cmd-row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: center; gap: 8px 16px; padding: 12px 2px; border-top: 1px solid var(--line); }
.cmd-row:first-child { border-top: 0; }
.cmd-row .cmd-chip { justify-self: start; font-size: .8rem; padding: 8px 10px; }
.cmd-row p { margin: 0; color: var(--text); font-size: .93rem; line-height: 1.5; }
.cmd-row p small { color: var(--mute); font-size: .82rem; }
.cmd-empty { margin: 0; padding: 18px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--mute); text-align: center; }
.cmd-note { margin: 0; font-size: .85rem; color: var(--mute); }
html[dir="rtl"] .cmd-row p, html[dir="rtl"] .cmd-hero p, html[dir="rtl"] .cmd-group > p, html[dir="rtl"] .cmd-note, html[dir="rtl"] .cmd-empty, html[dir="rtl"] .cmd-search input { font-family: var(--ar, var(--body)); }
.cmd-page [hidden] { display: none !important; }

/* ── floating Support button (opposite the back-to-top arrow from nav.js) ── */
.support-fab { position: fixed; z-index: 60; left: max(18px, env(safe-area-inset-left, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 16px 0 13px; border-radius: 14px; font: 600 .88rem/1 var(--display); color: #fff; text-decoration: none;
  background: rgba(8, 17, 31, 0.92); border: 1px solid rgba(34, 195, 255, 0.4); box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: border-color .2s, transform .2s, background .2s; }
.support-fab svg { width: 18px; height: 18px; flex: none; fill: var(--cyan); }
.support-fab:hover { border-color: var(--cyan); background: rgba(10, 30, 52, 0.95); transform: translateY(-2px); }
.support-fab:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
html[dir="rtl"] .support-fab { left: auto; right: max(18px, env(safe-area-inset-right, 0px)); padding: 0 13px 0 16px; font-family: var(--ar, var(--display)); }
@media (prefers-reduced-motion: reduce) { .support-fab, .cmd-chip { transition: none; } .lbw-live i { animation: none; } }

/* ── tablet / phone ── */
@media (max-width: 900px) {
  .qs-grid { grid-template-columns: 1fr; }
  .qs-step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: start; }
  .qs-step > :not(.qs-num) { grid-column: 2; }
  .qs-num { grid-row: 1 / span 3; }
}
@media (max-width: 640px) {
  .lbw-body { padding: 14px; gap: 12px; }
  .lbw-stats { gap: 8px; }
  .lbw-tile { padding: 11px 10px; }
  .lbw-tile span { font-size: .62rem; letter-spacing: .06em; }
  .lbw-table { font-size: .86rem; }
  .lbw-table th, .lbw-table td { padding: 10px 8px; }
  .lbw-table .hide-sm { display: none; }
  .lbw-foot { flex-direction: column; align-items: stretch; }
  .lbw-foot .btn { width: 100%; }
  .vs { font-size: .8rem; }
  .vs col.c-feat { width: 37%; }
  .vs th, .vs td { padding: 11px 6px; }
  .vs thead th { font-size: .74rem; }
  .vs .mk { flex-direction: column; gap: 3px; font-size: .68rem; }
  .cmd-row { grid-template-columns: 1fr; gap: 6px; }
  .support-fab { height: 42px; padding: 0 12px 0 10px; font-size: .8rem; border-radius: 12px; }
  html[dir="rtl"] .support-fab { padding: 0 10px 0 12px; }
}
@media (max-width: 400px) {
  .lbw-url { display: none; }
  .lbw-bar { justify-content: space-between; }
  .lbw-tile b { font-size: 1.05rem; }
}
.feat-grid-last { margin-bottom: 0; }
.cmd-hero h1 em { font-style: normal; }
.lbw-table td.nm { text-align: left; } html[dir="rtl"] .lbw-table td.nm { text-align: right; }
.svc .cmd-chips + .feat-btn { margin-top: 8px; }
.bento4 + .feat-label { margin-top: clamp(36px, 5vw, 56px); }

/* 🎧 support popup (owner 2026-10-27) — support.js turns .support-fab into a button that opens this panel */
.sup-panel { position: fixed; z-index: 61; left: max(18px, env(safe-area-inset-left, 0px)); bottom: calc(max(18px, env(safe-area-inset-bottom, 0px)) + 62px); width: min(340px, calc(100vw - 36px));
  background: rgba(8, 18, 32, 0.97); border: 1px solid var(--line-2); border-radius: 18px; padding: 18px; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .8), 0 0 0 1px rgba(34, 195, 255, .06); display: grid; gap: 12px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: supIn .22s var(--ease, ease) both; }
html[dir="rtl"] .sup-panel { left: auto; right: max(18px, env(safe-area-inset-right, 0px)); }
.sup-panel[hidden] { display: none; }
@keyframes supIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.sup-top { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.sup-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(34, 195, 255, .1); border: 1px solid rgba(34, 195, 255, .3); }
.sup-ic svg { width: 22px; height: 22px; fill: var(--cyan); }
.sup-h { font: 700 1.05rem/1.2 var(--display); color: var(--white); margin: 0 0 4px; }
.sup-p { margin: 0; color: var(--mute); font-size: .86rem; line-height: 1.45; }
.sup-x { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.sup-x svg { width: 16px; height: 16px; fill: var(--mute); } .sup-x:hover svg { fill: var(--white); }
.sup-chat { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: 12px; background: var(--grad); color: #fff; text-decoration: none; font: 600 .95rem/1 var(--display); box-shadow: 0 10px 28px -10px rgba(10, 132, 255, .8); }
.sup-chat svg { width: 18px; height: 18px; fill: #fff; } .sup-chat:hover { filter: brightness(1.08); }
.sup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sup-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--white); text-decoration: none; font: 600 .88rem/1 var(--display); background: rgba(255, 255, 255, .02); }
.sup-btn svg { width: 16px; height: 16px; fill: var(--text); } .sup-btn:hover { border-color: var(--cyan); }
.sup-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--mute); font-size: .78rem; line-height: 1.45; }
.sup-note svg { width: 16px; height: 16px; flex: none; fill: #34d399; margin-top: 1px; } .sup-note b { color: var(--white); }
@media (prefers-reduced-motion: reduce) { .sup-panel { animation: none; } }
