/* Pay Mohab — light and clean. The receipt is the interface.
   Pale grey-green ground, white receipt and cards, near-black ink, one green accent. */
:root {
  --bg: #eef1ee;
  --card: #ffffff;
  --field: #f8faf8;
  --line: #dfe4df;
  --line-2: #d3d9d3;
  --rule: #d8ddd8;
  --chip: #f1f4f1;
  --ink: #15201a;
  --soft: #5b665f;
  --accent: #0f7b57;
  --accent-ink: #0a5139;
  --mint: #d3f2e0;
  --warn: #b54708;
  --amber-bg: #fff1d6;
  --amber-ink: #7a4300;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(21, 32, 26, .06), 0 8px 24px -12px rgba(21, 32, 26, .18);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
bdi { unicode-bidi: isolate; }
.amt { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 150px; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 10px; padding: 18px 4px 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.stub { width: 16px; height: 20px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 82%, 83% 100%, 67% 82%, 50% 100%, 33% 82%, 17% 100%, 0 82%); }
.lang { margin-inline-start: auto; font-size: 14px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); cursor: pointer; }
.lang:hover { background: var(--chip); }

.hero { padding: 16px 4px 0; }
.kicker { margin: 0; font-size: 14px; color: var(--soft); }
h1 { margin: 2px 0 0; font-size: 28px; line-height: 1.25; font-weight: 700; }
h2 { margin: 0 0 10px; font-size: 17px; font-weight: 700; }
.sub { margin: 6px 0 0; font-size: 15px; color: var(--soft); }
.sub b { color: var(--ink); font-weight: 600; }
.notyou { margin: 6px 0 0; font-size: 13px; }
.notyou button { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; }

.card { background: var(--card); border-radius: 18px; padding: 18px; margin-top: 18px; box-shadow: var(--shadow); }

/* ---------- stepper ---------- */
.steps { display: flex; align-items: center; gap: 8px; margin: 18px 4px 0; font-size: 13px; color: var(--soft); }
.steps .st { all: unset; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.steps button.st { cursor: pointer; color: var(--accent-ink); }
.steps button.st:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.steps .st.cur { color: var(--ink); font-weight: 700; }
.steps .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #dfe5df; color: var(--ink); font-family: var(--mono); font-size: 12px; flex: 0 0 auto; }
.steps .n.on { background: var(--accent); color: #fff; }
.steps .n.done { background: var(--mint); color: var(--accent-ink); }
.steps .sep { flex: 1; height: 1px; background: var(--line-2); min-width: 8px; }
.names { display: grid; gap: 10px; }
.namebtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); text-align: start; font-size: 16px; font-weight: 600; cursor: pointer; }
.namebtn:hover { background: var(--chip); border-color: var(--accent); }
.namebtn .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.namebtn .status { font-weight: 400; }
.paycard .line { padding-block: 7px; font-size: 14.5px; }
.paycard .line .name { font-weight: 400; }
.line.taken { color: var(--soft); }
.line.taken .name { font-weight: 400; }
.ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-inline-start: auto; }
.ctl .stepper { margin-inline-start: 0; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
select.ways { width: auto; min-height: 36px; padding: 4px 8px; font-size: 14px; background: var(--card); }

/* ---------- the receipt ---------- */
.receipt {
  position: relative; background: var(--card); color: var(--ink);
  padding: 20px 18px 24px; margin: 20px 0 0; border-radius: 6px 6px 0 0;
  box-shadow: 0 10px 30px -18px rgba(21, 32, 26, .35); font-size: 15px;
}
.receipt::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background:
    linear-gradient(-45deg, transparent 6px, var(--card) 0) 0 0 / 12px 10px repeat-x,
    linear-gradient(45deg, transparent 6px, var(--card) 0) 0 0 / 12px 10px repeat-x;
}
.receipt .merchant { text-align: center; font-weight: 600; }
.receipt .meta { text-align: center; color: var(--soft); font-size: 12.5px; margin: 2px 0 12px; }
.dash { border: 0; border-top: 1.5px dashed var(--rule); margin: 12px 0; }

.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; }
.line .name { overflow-wrap: anywhere; font-weight: 500; }
.line .qty { color: var(--soft); font-family: var(--mono); font-size: 13px; margin-inline-start: 4px; }
.line .who { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--soft); }
.line .left { color: var(--warn); }
.line.pick { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.line.pick:hover { background: var(--chip); }
.line.pick[aria-pressed='true'] { background: var(--mint); }
.line.pick[aria-pressed='true'] .who { color: var(--accent-ink); }
.line.static { color: var(--soft); font-size: 14px; padding-block: 6px; }
.line.static .name { font-weight: 400; }
.line.static .note-s { font-size: 12px; }
.line.total { font-weight: 700; font-size: 16px; padding-block: 4px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; background: var(--chip); border: 1px solid var(--line); color: var(--ink); }
.chip.me { background: var(--ink); border-color: var(--ink); color: #fff; }

.stepper { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; direction: ltr; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--accent-ink); background: var(--card); color: var(--ink); font-family: var(--mono); font-size: 1.1rem; cursor: pointer; }
.stepper span { min-width: 28px; text-align: center; font-family: var(--mono); }

/* ---------- forms & buttons ---------- */
label { display: block; font-size: 13px; color: var(--soft); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=url], input[type=number], select {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--field); color: var(--ink);
}
input::placeholder { color: #8a948d; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row > * { flex: 1; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--accent-ink); color: #fff; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--chip); color: var(--ink); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; }
.btn.soft { background: var(--bg); color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.danger:hover { background: #fdecea; color: var(--danger); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn:disabled { background: #dfe4df; color: var(--soft); cursor: not-allowed; }
.btn.block { width: 100%; }

.note { font-size: 13.5px; color: var(--soft); }
.error { background: #fdecea; color: var(--danger); border-radius: 12px; padding: 10px 14px; margin-top: 12px; }
.ok { background: var(--mint); color: var(--accent-ink); border-radius: 12px; padding: 10px 14px; margin-top: 12px; }
.hidden { display: none !important; }
.banner { background: var(--amber-bg); color: var(--amber-ink); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-top: 16px; }

/* ---------- people ---------- */
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #edf0ed; }
.people li:first-child { border-top: 0; }
.avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: var(--ink); }
.people .who { flex: 1; min-width: 0; }
.people .who .amt { display: block; color: var(--soft); font-size: 13px; }
.youtag { color: var(--soft); margin-inline-start: 4px; }
.status { font-size: 12.5px; padding: 3px 10px; border-radius: 99px; white-space: nowrap; background: var(--chip); color: var(--soft); }
.status.paid { background: var(--mint); color: var(--accent-ink); }
.status.pending { background: transparent; border: 1px solid var(--accent); color: var(--accent-ink); }
.status.owes { background: var(--amber-bg); color: var(--amber-ink); }

/* ---------- bottom bar ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card);
  border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px -12px rgba(21, 32, 26, .25);
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
}
.bar .in { max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bar .lbl { font-size: 13px; color: var(--soft); }
.bar .big { font-size: 24px; font-weight: 600; line-height: 1.25; }
.bar .btn { margin-inline-start: auto; min-width: 120px; min-height: 52px; font-size: 17px; border-radius: 14px; }

/* ---------- sheets & dialogs ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(21, 32, 26, .45); }
.sheet.center { align-items: center; padding: 20px; background: rgba(21, 32, 26, .5); }
.sheet .panel {
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; background: var(--card); color: var(--ink);
  border-radius: 24px 24px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); animation: up .22s ease-out;
}
.sheet .handle { width: 40px; height: 4px; border-radius: 99px; background: var(--line-2); margin: 0 auto 14px; }
.sheet.center .panel { border-radius: 24px; max-width: 380px; text-align: center; padding: 28px 22px 22px; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet h2 { font-size: 19px; }
.sheet .line { padding-block: 7px; font-size: 14.5px; }
.sheet .line .name { font-weight: 400; }
.due { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.due .amt { font-size: 28px; font-weight: 600; }
.paybtn { margin-top: 18px; min-height: 56px; font-size: 17px; border-radius: 16px; }
.copyrow { margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); }
[dir=rtl] .copyrow { padding: 8px 8px 8px 14px; }
.copyrow .lbl { font-size: 13px; color: var(--soft); }
.copyrow .amt { margin-inline-start: auto; }
.duo { margin-top: 14px; display: flex; gap: 10px; }
.duo .btn { min-height: 48px; border-radius: 14px; }
.duo .btn:first-child { flex: 1; }
.duo .btn.soft { flex: 0 0 auto; min-width: 88px; }
.ask-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--mint); color: var(--accent); display: grid; place-items: center; }
.ask-amt { margin-top: 10px; font-size: 32px; font-weight: 600; }
.stack { display: grid; gap: 10px; margin-top: 20px; }
.stack .btn { min-height: 52px; border-radius: 16px; }

.stamp { display: inline-block; transform: rotate(-7deg); border: 3px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 26px; padding: 2px 22px; border-radius: 10px; letter-spacing: .04em; }
.stamp.pending { border-color: var(--soft); color: var(--soft); }
.stamp.pop { animation: stamp .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp { from { transform: rotate(-7deg) scale(2.2); opacity: 0; } }

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

/* a quiet explanatory line with an optional icon (bank-name hints) */
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--soft); background: var(--chip); border-radius: 12px; padding: 10px 12px; margin: 12px 0 0; }

/* ---------- Google account ---------- */
img.avatar { object-fit: cover; background: var(--chip); }
.namebtn.me { border-color: var(--accent); background: var(--mint); }
.gcard .note { margin: 0 0 10px; }
.grow { display: flex; align-items: center; gap: 12px; }
.grow .who { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.grow .who .note { display: block; margin: 0; }
.linkbtn { border: 0; background: none; padding: 6px 0; font-size: 13px; color: var(--accent); text-decoration: underline; cursor: pointer; }
.billbtn .nm .note { display: block; font-weight: 400; }
a.linkbtn { display: inline-block; margin-inline-end: 14px; }
