/* GH-Cash design system — dark-first, lime accent (same identity as ghawi.app), RTL-first. */
/* Palette = the "Nocturne" theme of ghawi.app (src/lib/classic-themes.ts), so GH-Cash reads as the same family. */
:root {
  --bg: #07080a; --surface: #0e1114; --surface-2: #151a1f; --border: #222a31; --tile: #1a2111;
  --text: #edf0f2; --muted: #9ba5ad; --accent: #d4ff3f; --accent-ink: #0a0c05; --accent-text: #d4ff3f;
  --ok: #4ade80; --warn: #fbbf24; --danger: #f87171; --glow: rgba(212, 255, 63, .16);
  --radius: 22px; --font-head: "Space Grotesk", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font: "Inter", "IBM Plex Sans Arabic", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7f2; --surface: #ffffff; --surface-2: #eef0e8; --border: #dde1d4; --tile: #edf6cf;
    --text: #0d0f0a; --muted: #565d50; --accent: #c8f23a; --accent-ink: #0d0f0a; --accent-text: #476600;
    --ok: #15803d; --warn: #b45309; --danger: #c0362c; --glow: rgba(150, 200, 0, .18); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f7f2; --surface: #ffffff; --surface-2: #eef0e8; --border: #dde1d4; --tile: #edf6cf;
  --text: #0d0f0a; --muted: #565d50; --accent: #c8f23a; --accent-ink: #0d0f0a; --accent-text: #476600;
  --ok: #15803d; --warn: #b45309; --danger: #c0362c; --glow: rgba(150, 200, 0, .18); color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; overflow-x: clip; background: var(--bg); color: var(--text); font: 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
body::before { /* faint grid like ghawi.app */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px; opacity: .28;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 70%);
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--accent-text); text-decoration: none; }
.mut { color: var(--muted); }
.mono, code, pre { font-family: var(--mono); direction: ltr; unicode-bidi: embed; }
.hl { color: var(--accent-text); }
[hidden] { display: none !important; }
.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
section { padding: 56px 0; }

/* nav */
.nav {
  position: sticky; top: 12px; z-index: 20; margin: 12px auto 0; width: min(1120px, calc(100% - 24px));
  display: flex; align-items: center; gap: 16px; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 999px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px);
}
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); direction: ltr; font: 800 1.1rem var(--font-head); letter-spacing: -.01em; }
.logo svg { flex: none; overflow: visible; }
.logo .tag { color: var(--muted); font-weight: 600; }
.nav .btn-sm { height: 38px; }
.nav .links { display: flex; gap: 4px; margin-inline-start: 12px; }
.nav .links a { color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: .95rem; }
.nav .links a:hover { color: var(--text); background: var(--surface-2); }
.nav .sp { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 16px;
}
@media (max-width: 720px) { .nav .links { display: none; } }
/* Phones: the header must fit logo + theme + one or two buttons without spilling out of the pill. */
@media (max-width: 520px) {
  .nav { gap: 6px; padding: 8px 10px; width: calc(100% - 16px); margin-top: 8px; top: 8px; }
  .nav .btn-sm { height: 36px; padding-inline: 12px; font-size: .86rem; white-space: nowrap; }
  .nav .icon-btn { width: 36px; height: 36px; flex: none; }
  .nav .logo svg { height: 20px; width: 40px; }
  .nav .logo { gap: 6px; font-size: 1rem; }
}
@media (max-width: 360px) { .nav .logo .tag { display: none; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  border-radius: 999px; padding: 11px 22px; font: 700 .98rem var(--font); cursor: pointer; transition: transform .12s, background .12s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-sm { padding: 7px 14px; font-size: .86rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* chips / badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .82rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 9%, transparent); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.chip.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 9%, transparent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.method { font: 700 .74rem var(--mono); padding: 3px 9px; border-radius: 8px; direction: ltr; }
.method.get { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.method.post { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card.glow { box-shadow: 0 0 0 1px var(--border), 0 30px 80px -30px var(--glow); }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.ico {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); font: 800 1.1rem var(--font-head);
}

/* hero */
.hero { padding-top: 72px; text-align: center; position: relative; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 -120px 0; height: 340px; z-index: -1;
  background: radial-gradient(ellipse at 50% 100%, var(--glow), transparent 65%);
}
.hero p.lead { max-width: 640px; margin: 0 auto 28px; color: var(--muted); font-size: 1.12rem; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.hero .chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.demo { max-width: 460px; margin: 52px auto 0; text-align: start; }
.demo .row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.demo .row:last-child { border: 0; }
.demo .amount { font: 800 2rem var(--font-head); direction: ltr; }
.demo .status { position: relative; height: 34px; margin-top: 6px; }
.demo .status > span { position: absolute; inset-inline-end: 0; top: 0; animation: swap 6s infinite; }
.demo .status > .paid { animation-name: swap2; }
@keyframes swap { 0%, 45% { opacity: 1 } 55%, 100% { opacity: 0 } }
@keyframes swap2 { 0%, 45% { opacity: 0 } 55%, 100% { opacity: 1 } }

/* steps */
.step-n { font: 800 .85rem var(--mono); color: var(--accent-text); margin-bottom: 10px; display: block; }
.price { font: 800 3rem var(--font-head); direction: ltr; display: inline-block; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.checks { list-style: none; padding: 0; margin: 16px 0 24px; }
.checks li { padding: 5px 0; padding-inline-start: 26px; position: relative; }
.checks li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--accent-text); font-weight: 800; }

/* code */
pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; overflow: auto;
  font-size: .85rem; line-height: 1.6; margin: 12px 0; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere;
}
code { background: var(--surface-2); padding: 2px 7px; border-radius: 7px; font-size: .88em; }
pre code { background: none; padding: 0; }

/* forms */
label { display: block; font-size: .88rem; color: var(--muted); margin: 14px 0 6px; }
input, select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: 1rem var(--font);
}
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.err { color: var(--danger); font-size: .9rem; min-height: 1.4em; margin-top: 10px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; margin-bottom: 8px; }
.tabs button { flex: 1; border: 0; padding: 9px; border-radius: 999px; background: none; color: var(--muted); font: 700 .95rem var(--font); cursor: pointer; }
.tabs button.on { background: var(--accent); color: var(--accent-ink); }
.auth { min-height: calc(100vh - 90px); display: grid; place-items: center; padding: 32px 0; }
.auth .card { width: min(440px, 100%); }

/* app shell */
.app { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 24px 0 96px; align-items: start; }
.side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; }
.side a, .bottom a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; color: var(--muted); font-weight: 600;
}
.side a:hover { background: var(--surface-2); color: var(--text); }
.side a.on, .bottom a.on { background: var(--accent); color: var(--accent-ink); }
.bottom {
  display: none; position: fixed; inset: auto 12px 12px 12px; z-index: 30; padding: 8px; gap: 4px; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 999px;
}
.bottom a { flex-direction: column; gap: 0; font-size: .74rem; padding: 8px 14px; border-radius: 999px; }
@media (max-width: 820px) { .app { grid-template-columns: 1fr; } .side { display: none; } .bottom { display: flex; } }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-h h2 { margin: 0; }
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); margin-bottom: 18px;
}
.wallet { display: flex; flex-direction: column; gap: 14px; }
.wallet .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wallet .addr { font: .85rem var(--mono); color: var(--muted); word-break: break-all; direction: ltr; text-align: start; }
.wallet .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }

/* modal + toast */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); }
.modal .box { width: min(480px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 24px; }
.modal .box .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.qr { display: grid; place-items: center; min-height: 240px; background: #fff; border-radius: 16px; padding: 12px; margin: 14px 0; }
.qr img { width: 100%; max-width: 260px; image-rendering: pixelated; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #ddd; border-top-color: #111; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg) } }
.steps-l { padding-inline-start: 20px; color: var(--muted); } .steps-l li { margin: 4px 0; }
.tx { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tx:last-child { border: 0; }
.tx .amt { font: 700 1rem var(--mono); direction: ltr; }
.tx .amt.in { color: var(--ok); } .tx .amt.out { color: var(--danger); }
.toast { position: fixed; inset: auto 0 90px 0; margin-inline: auto; width: max-content; max-width: calc(100% - 32px); z-index: 60; padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; }
.kv { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.kv code { flex: 1; overflow-wrap: anywhere; padding: 10px; }

/* docs */
.endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border); }
.endpoint:last-child { border: 0; }
.endpoint code { background: none; padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* FAQ + icon sizing */
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-text); font: 700 1.2rem var(--mono); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 16px; }
.side a svg, .bottom a svg { flex: none; }
.chip, .btn { white-space: nowrap; }
.tx { flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stats .card { padding: 14px 16px; }
.stats .v { font: 700 1.5rem var(--font-head); margin: 2px 0; direction: ltr; text-align: right; }
@media (max-width: 520px) { .stats .v { font-size: 1.15rem; } .stats .card { padding: 12px; } }

/* pay page */
.pay { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.pay .card { width: min(440px, 100%); text-align: center; }
.pay .big { font: 800 2.6rem var(--font-head); direction: ltr; margin: 4px 0 18px; }
.pay .field { text-align: start; background: var(--surface-2); border-radius: 14px; padding: 12px 14px; margin: 10px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pay .field small { color: var(--muted); display: block; }
.pay .state { margin-top: 18px; padding: 12px; border-radius: 14px; background: var(--surface-2); font-weight: 600; }
.pay .state.paid { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pay .state.expired { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
