/* Mada user help site — standalone (no Vite build needed), RTL Arabic. */
:root {
    --bg: #eff3ef;
    --surface: #ffffff;
    --surface-2: #e3eae4;
    --ink: #16231f;
    --muted: #55655d;
    --accent: #795c23;
    --accent-soft: #ece8e0;
    --warn: #b5762a;
    --warn-soft: #f3e6d2;
    --danger: #a33b3b;
    --danger-soft: #f2dedd;
    --mark: #e11d48;
    --border: #d3dbd5;
    --shadow: 0 1px 2px rgba(22, 35, 31, .06), 0 6px 20px -8px rgba(22, 35, 31, .12);
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111816; --surface: #19221f; --surface-2: #222d29; --ink: #e8efeb; --muted: #9fb0a7;
        --accent: #d0a55a; --accent-soft: #2b2619; --warn: #e0a457; --warn-soft: #33281a;
        --danger: #e07a7a; --danger-soft: #3a2222; --border: #2d3a35;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px -8px rgba(0, 0, 0, .5);
    }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 16px/1.85 "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; }
code, kbd { font-family: Consolas, "Courier New", monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; direction: ltr; unicode-bidi: embed; }

.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
    height: 64px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; white-space: nowrap; }
.topbar .brand img { width: 34px; height: 34px; }
.topbar .brand small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); }
.topbar .search { position: relative; margin-inline-start: auto; width: min(420px, 100%); }
.topbar .search input {
    width: 100%; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px;
}
.search-results {
    position: absolute; inset-inline: 0; top: 46px; max-height: 60vh; overflow: auto; display: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.search-results a { display: block; padding: 10px 14px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--border); font-size: 14px; }
.search-results a small { display: block; color: var(--muted); font-size: 12px; }
.search-results a:hover, .search-results a.active { background: var(--accent-soft); }
.menu-btn { display: none; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 10px; height: 40px; padding: 0 12px; font: inherit; }
.to-app { font-size: 14px; font-weight: 700; white-space: nowrap; }

.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); overflow: auto; padding: 20px 14px 40px; border-inline-end: 1px solid var(--border); }
.sidebar .group { margin: 18px 6px 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--muted); }
.sidebar a { display: block; padding: 6px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.6; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a.current { background: var(--accent); color: #fff; font-weight: 700; }
.sidebar .sub a { padding-inline-start: 26px; font-size: 13px; color: var(--muted); }
.sidebar .sub a.here { color: var(--accent); font-weight: 700; }

main { padding: 32px clamp(16px, 4vw, 48px) 80px; min-width: 0; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(26px, 4vw, 34px); line-height: 1.3; }
.page-head p { margin: 0; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }

section.topic { margin-top: 28px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
section.topic h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.4; }
section.topic h3 { margin: 22px 0 6px; font-size: 17px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 6px 0 14px; font-size: 13px; color: var(--muted); }
.meta b { color: var(--ink); }
.path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.path span { background: var(--surface-2); border-radius: 8px; padding: 0 8px; color: var(--ink); font-weight: 700; }

figure { margin: 16px 0; }
figure img { display: block; border: 1px solid var(--border); border-radius: 12px; cursor: zoom-in; background: #fff; }
figure.phone img { max-width: 340px; margin: 0 auto; }
figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); text-align: center; }

ol.steps { list-style: none; margin: 12px 0; padding: 0; counter-reset: none; }
ol.steps > li { position: relative; padding-inline-start: 44px; margin: 10px 0; }
ol.steps > li > .n {
    position: absolute; inset-inline-start: 0; top: 2px; width: 30px; height: 30px; border-radius: 50%;
    background: var(--mark); color: #fff; font: 800 14px/30px system-ui, sans-serif; text-align: center;
}
ol.plain { padding-inline-start: 22px; }
ol.plain li, ul li { margin: 4px 0; }

.note { margin: 14px 0; padding: 12px 16px; border-radius: 12px; border-inline-start: 4px solid; font-size: 15px; }
.note.tip { background: var(--accent-soft); border-color: var(--accent); }
.note.warn { background: var(--warn-soft); border-color: var(--warn); }
.note.danger { background: var(--danger-soft); border-color: var(--danger); }
.note b:first-child { display: block; margin-bottom: 2px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 18px; }
.card { display: block; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card .icon { font-size: 26px; }
.card h3 { margin: 6px 0 4px; font-size: 17px; }
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.7; }

table.simple { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
table.simple th, table.simple td { padding: 8px 10px; border: 1px solid var(--border); text-align: start; vertical-align: top; }
table.simple th { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

details.faq { margin: 10px 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq[open] summary { margin-bottom: 6px; color: var(--accent); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; }
.pager a { flex: 1; padding: 14px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 700; }
.pager a small { display: block; color: var(--muted); font-weight: 400; }
.pager a.next { text-align: end; }

.lightbox { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .82); cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset-block: 64px 0; inset-inline-start: 0; width: 290px; z-index: 30; background: var(--surface); transform: translateX(110%); transition: transform .2s; height: auto; }
    .sidebar.open { transform: none; box-shadow: var(--shadow); }
    .menu-btn { display: inline-block; }
    .topbar .to-app, .topbar .brand small { display: none; }
    section.topic { padding: 16px; }
}
@media (max-width: 560px) {
    .topbar .brand span { display: none; }
}
@media print {
    .topbar, .sidebar, .pager { display: none; }
    .layout { display: block; }
    section.topic { break-inside: avoid-page; box-shadow: none; }
}
