/* docs.apera.site — same look as apera.site */
:root {
  --bg: #070B12; --panel: #0E1520; --panel-2: #131A25; --panel-3: #1B2432; --line: #223044;
  --text: #E8F1FA; --muted: #A9B6C6; --dim: #74849A; --accent: #40C8FF; --accent-dim: rgba(64, 200, 255, .13);
  --accent-ink: #04121C; --ok: #4ADE9B; --warn: #F7C948; --code: #0A111B;
  --display: 'Unbounded', 'Segoe UI', sans-serif; --body: 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --side: 280px; --top: 64px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #F6F8FB; --panel: #FFFFFF; --panel-2: #F1F4F9; --panel-3: #E7ECF3; --line: #DAE1EA; --text: #0F1722; --muted: #4B5B70; --dim: #6B7A8F; --accent: #0B84C6; --accent-dim: rgba(11, 132, 198, .1); --accent-ink: #FFFFFF; --code: #EEF2F7; color-scheme: light; }
}
html[lang="ar"] { --display: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.7 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
code { font-family: var(--mono); font-size: .88em; background: var(--code); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* Arabic changes only the words; the layout stays left-to-right */
html[lang="ar"] :is(p, li, h1, h2, h3, td, th, summary, figcaption, .sum, .navitem span, .msg) { unicode-bidi: plaintext; text-align: left; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 17px/1 var(--display); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.brand b { color: var(--accent); font-weight: 600; }
.search { position: relative; flex: 1; min-width: 0; max-width: 520px; margin-left: 20px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; color: var(--dim); }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 15px; }
.search kbd { font: 12px var(--mono); color: var(--dim); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; }
.results { position: absolute; top: 46px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); padding: 6px; max-height: 70vh; overflow: auto; }
.results a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.results a:hover, .results a.on { background: var(--accent-dim); text-decoration: none; }
.results a b { display: block; font-weight: 600; }
.results a span { display: block; color: var(--muted); font-size: 13px; }
.results .none { padding: 12px; color: var(--muted); font-size: 14px; }
.toplinks { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; height: 36px; }
.lang a { display: grid; place-items: center; padding: 0 11px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lang a:hover { text-decoration: none; color: var(--text); }
.lang a[aria-current="true"] { background: var(--accent-dim); color: var(--accent); }
.toplinks .ghost, .toplinks .primary { height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.toplinks .ghost { color: var(--text); border: 1px solid var(--line); }
.toplinks .primary { background: var(--accent); color: var(--accent-ink); }
.toplinks a:hover { text-decoration: none; }
.iconbtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: none; color: var(--text); cursor: pointer; font-size: 15px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow: auto; padding: 18px 14px 40px; border-right: 1px solid var(--line); }
.navgroup { margin-bottom: 18px; }
.navtitle { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); padding: 0 10px 6px; }
.navtitle a { color: inherit; }
.navitem { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 14.5px; line-height: 1.35; }
.navitem svg { flex: none; color: var(--dim); }
.navitem:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.navitem.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.navitem.active svg { color: var(--accent); }
.navitem.cmd { font-family: var(--mono); font-size: 13.5px; padding: 5px 10px 5px 24px; }
.side details summary { list-style: none; cursor: pointer; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 14.5px; display: flex; justify-content: space-between; }
.side details summary::-webkit-details-marker { display: none; }
.side details summary:hover { background: var(--panel-2); color: var(--text); }
.side details[open] summary { color: var(--text); font-weight: 600; }
.count { font-size: 12px; color: var(--dim); font-weight: 400; }
.main { min-width: 0; max-width: 900px; padding: 34px 44px 60px; }

/* ---------- Content ---------- */
h1 { font: 700 clamp(26px, 3.2vw, 38px)/1.2 var(--display); letter-spacing: -.01em; margin: 6px 0 10px; }
h2 { font: 600 22px/1.3 var(--display); margin: 42px 0 12px; }
h3 { font-size: 17px; margin: 0 0 6px; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--dim); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.kicker { color: var(--accent); font-weight: 600; font-size: 14px; margin: 0; }
.hero { padding: 26px 0 8px; }
.hero h1 { font-size: clamp(30px, 4.2vw, 48px); }
.herobtns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; font: 600 15px var(--body); cursor: pointer; border: 1px solid transparent; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: none; border-color: var(--line); color: var(--text); }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.block { margin-top: 44px; }
.block h2 { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; color: var(--text); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.card .ic, .bigic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-dim); color: var(--accent); margin-bottom: 10px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.catgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips a, .chips button { font: 13px var(--mono); color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; cursor: pointer; }
.chips button { font-family: var(--body); font-size: 14px; }
.chips a:hover, .chips button:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.ask { background: linear-gradient(135deg, var(--accent-dim), transparent 70%); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }

.cathead { margin-top: 34px; }
.cmdlist { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cmdrow { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 16px; color: var(--text); border-top: 1px solid var(--line); }
.cmdrow:first-child { border-top: 0; }
.cmdrow:hover { background: var(--panel-2); text-decoration: none; }
.cmdrow code { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; }
.cmdrow .sum { color: var(--muted); font-size: 14.5px; }
.badges { display: flex; gap: 6px; }
.badge { font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); white-space: nowrap; }
.badge.perm { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

.cmdtitle code { font-size: .9em; padding: 2px 12px; background: var(--panel-2); color: var(--accent); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.pill.link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pill code { background: none; border: 0; padding: 0; }
.about { font-size: 16.5px; }
.usage { max-width: 100%; display: flex; align-items: center; gap: 10px; background: var(--code); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0 14px; overflow-x: auto; }
.usage code { background: none; border: 0; padding: 0; white-space: nowrap; font-size: 14.5px; }
.copy { margin-left: auto; flex: none; font: 600 12px var(--body); color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; cursor: pointer; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
table.opts { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 6px 0 10px; }
.opts th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.opts td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.opts td:first-child { white-space: nowrap; color: var(--text); }
.req { font-size: 11px; font-weight: 600; color: var(--warn); margin-left: 4px; }
.choices { margin-top: 4px; font-size: 13px; }
.sub { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 6px; margin: 14px 0; background: var(--panel); }
.sub h3 code { background: none; border: 0; padding: 0; color: var(--accent); font-size: 15px; }
.sub > p { margin: 4px 0 0; color: var(--muted); }
.examples { display: grid; gap: 10px; }
.example { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.example p { margin: 0; color: var(--muted); font-size: 14.5px; }
.dinput { display: flex; align-items: center; gap: 8px; background: #383A40; color: #DBDEE1; border-radius: 8px; padding: 9px 12px; overflow-x: auto; }
.dinput .slash { color: #949BA4; font-weight: 700; }
.dinput code { background: none; border: 0; padding: 0; color: #DBDEE1; white-space: nowrap; }
.notes li { margin: 4px 0; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; }
.pager a { flex: 1; max-width: 48%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; color: var(--text); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a.next { text-align: right; }
.pager span { display: block; font-size: 13px; color: var(--dim); }
.pager code { background: none; border: 0; padding: 0; color: var(--accent); }

.guidehead { display: flex; gap: 16px; align-items: flex-start; }
.guidehead .bigic { flex: none; width: 52px; height: 52px; border-radius: 14px; margin: 10px 0 0; }
.toc { border-left: 2px solid var(--line); padding: 2px 0 2px 14px; margin: 8px 0 10px; display: grid; gap: 4px; }
.toctitle { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.toc a { color: var(--muted); font-size: 14.5px; }
.gsec h2 { position: relative; }
.anchor { position: absolute; left: -22px; color: var(--dim); opacity: 0; }
.gsec h2:hover .anchor { opacity: 1; text-decoration: none; }
.prose p { margin: 0 0 12px; }
.prose ul { padding-left: 22px; margin: 0 0 12px; }
.prose li { margin: 5px 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 4px 0 16px; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding: 10px 14px 10px 50px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-dim); color: var(--accent); font: 700 13px var(--display); }
.shot { margin: 16px 0 22px; }
.shot img, .shot video { border: 1px solid var(--line); border-radius: 12px; width: 100%; height: auto; background: var(--panel); }
.shot.dshot img, .shot img[src*="/cmd-"], .shot img[src*="antinuke"], .shot img[src*="antispam"], .shot img[src*="log-"], .shot img[src*="ticket-panel"], .shot img[src*="giveaway."], .shot img[src*="giveaway-ar"], .shot img[src*="temp-voice-panel"], .shot img[src*="backup-restore"], .shot img[src*="moderation-ban"] { width: auto; max-width: 100%; background: #313338; }
.shot figcaption { font-size: 13.5px; color: var(--dim); margin-top: 6px; }
.helpful { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.helpful p { margin: 0; font-weight: 600; }
.foot { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }
.foot a { color: var(--muted); }

/* ---------- Assistant ---------- */
.chatfab { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font: 600 15px var(--body); cursor: pointer; box-shadow: 0 14px 40px -10px rgba(64, 200, 255, .55); }
.chatfab:hover { filter: brightness(1.08); }
.chat { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 100px)); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); overflow: hidden; }
.chat[hidden] { display: none; }
.chathead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chathead img { border-radius: 8px; }
.chathead div { flex: 1; display: grid; line-height: 1.3; }
.chathead span { font-size: 12.5px; color: var(--dim); }
.chatlog { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 12px; font-size: 14.5px; line-height: 1.6; }
.msg p { margin: 0 0 6px; white-space: pre-wrap; }
.msg p:last-child { margin: 0; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg b.t { display: block; margin-bottom: 4px; }
.msg ol { margin: 6px 0; padding-left: 20px; }
.msg .ex { margin: 6px 0; }
.msg .ex .dinput { padding: 6px 10px; font-size: 13px; }
.msg .ex span { font-size: 13px; color: var(--muted); }
.msg .links { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.msg .links a { font-size: 13.5px; }
.msg .by { display: block; margin-top: 6px; font-size: 11.5px; color: var(--dim); }
.msg.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--dim); animation: blink 1.2s infinite; }
.msg.typing span:nth-child(2) { animation-delay: .2s; } .msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chatform { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chatform input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 15px; }
.chatform input:focus { outline: none; border-color: var(--accent); }
.chatform button { width: 42px; height: 42px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; }
.chatnote { margin: 0; padding: 0 12px 10px; font-size: 11.5px; color: var(--dim); }

/* ---------- Responsive ---------- */
.only-mobile { display: none; }
@media (max-width: 1020px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .main { padding: 28px 28px 60px; } }
@media (max-width: 860px) {
  .only-mobile { display: grid; }
  .only-desktop { display: none !important; }
  .top { padding: 0 12px; gap: 10px; }
  .brand span { display: none; }
  .search { margin-left: 0; padding: 0 10px; }
  .search input { width: 100%; font-size: 14px; }
  .lang a { padding: 0 9px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: var(--top); left: 0; bottom: 0; width: min(300px, 86vw); height: auto; z-index: 25; background: var(--bg); transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 20px 0 50px rgba(0,0,0,.4); }
  .main { padding: 22px 16px 90px; }
  .cards, .catgrid { grid-template-columns: 1fr; }
  .cmdrow { grid-template-columns: 1fr; gap: 4px; }
  .example { grid-template-columns: 1fr; gap: 4px; }
  .opts th:nth-child(2), .opts td:nth-child(2) { display: none; }
  .chatfab span { display: none; }
  .chatfab { width: 52px; padding: 0; justify-content: center; }
  .chat { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100vh - var(--top) - 16px); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card:hover { transform: none; } .side { transition: none; } .msg.typing span { animation: none; } }
