/* Maly local test drive — light green + deep emerald, per the brand design. */
:root {
  --green-bg: #e6f4ea;
  --green-soft: #d3e9d8;
  --emerald: #046a38;
  --emerald-dark: #034d29;
  --ink: #1c2b22;
  --card: #ffffff;
  --warn-bg: #fff4d6;
  --warn-ink: #6b5310;
  --error: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--green-bg);
  color: var(--ink);
}
.testmode-banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #e5cf8a;
}
.reset-note {
  background: #fdeceb;
  color: var(--error);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #f2b8b5;
}
main { max-width: 430px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.screen.hidden, .hidden { display: none !important; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; margin-top: 0; }
.brand { text-align: center; margin: 2.5rem 0 1.5rem; }
.brand.small { margin: 1rem 0; }
.brand.left { text-align: left; margin: 0; }
/* Brand lockup — settled design (Ahmed, 2026-11-23, same treatment as
   the waitlist logo fallback): Arabic in bold emerald, the English
   wordmark in bold ink, with a clear blank line of space between them
   (the wordmark's top margin) so the two never collide. The .small
   variant (welcome + dashboard headers) takes a proportionally smaller
   gap so the compact headers stay compact. */
.brand .arabic {
  font-size: 4.2rem;
  line-height: 1.2;
  color: var(--emerald);
  font-weight: 700;
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.18);
  font-family: "Traditional Arabic", "Amiri", "Scheherazade New", serif;
}
.brand.small .arabic { font-size: 2.4rem; }
.brand .wordmark {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  margin-top: 1.4rem;
}
.brand.small .wordmark { font-size: 1.4rem; margin-top: 0.7rem; }
.brand .tagline { font-size: 1rem; color: #33523f; font-style: italic; }
.splash .hint { text-align: center; color: #55705f; }
.card {
  background: var(--card);
  border: 1px solid var(--green-soft);
  border-radius: 14px;
  padding: 1.1rem;
  margin: 0.9rem 0;
  box-shadow: 0 1px 4px rgba(4, 106, 56, 0.08);
}
label { display: block; margin: 0.7rem 0; font-size: 0.95rem; }
input, select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #b9d4c0;
  border-radius: 8px;
  background: #fff;
}
/* Waitlist page (waitlist.html) */
.logo-img { max-width: 230px; width: 100%; border-radius: 18px; }
/* Text-logo fallback (shown when the logo PNG fails to load): Ahmed
   asked for an extra line of space between the Arabic and the English
   "Maly" — the wordmark's top margin is that blank line. */
.logo-fallback .arabic { color: var(--emerald); font-weight: 700; }
.logo-fallback .wordmark { margin-top: 1.4rem; color: var(--ink); font-weight: 700; }
.logo-fallback .tagline { margin-top: 0.35rem; color: var(--emerald); font-weight: 700; }
fieldset.channel-picker { border: 1px solid var(--green-soft); border-radius: 10px; margin: 0.8rem 0; }
fieldset.channel-picker legend { font-size: 0.95rem; padding: 0 0.4rem; }
label.radio, label.check { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0.5rem 0; }
label.radio input, label.check input { width: auto; margin-top: 0.2rem; }
label.check span { font-size: 0.9rem; color: #33523f; }
button {
  cursor: pointer;
  font-size: 1rem;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  width: 100%;
  margin: 0.4rem 0;
}
button.primary { background: var(--emerald); color: #fff; border: none; font-weight: 600; }
button.primary:hover { background: var(--emerald-dark); }
button.outline { background: transparent; color: var(--emerald); border: 2px solid var(--emerald); font-weight: 600; }
button.link { background: none; border: none; color: var(--emerald); width: auto; padding: 0.3rem 0; text-decoration: underline; }
.error { color: var(--error); min-height: 1.2em; font-size: 0.92rem; }
.note { color: #55705f; font-size: 0.9rem; }
.setup-key {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  background: var(--green-bg);
  border: 1px dashed var(--emerald);
  border-radius: 10px;
  padding: 0.8rem;
  text-align: center;
  word-break: break-all;
  margin: 0.6rem 0;
}
/* Dashboard header: a simple row — the brand lockup top-left (the
   shared .brand.small.left rules), the top bar on the right. (Ahmed,
   2026-11-23: the brief centering of this header was reversed the
   same evening — the brand stays top-left because the top of the
   screen is where the menus live.) */
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
/* Top bar (dashboard): Accounts ▾ · Inbox (badge) · Sponsors · Account ▾ */
.topbar { display: flex; align-items: flex-start; gap: 0.15rem; flex-wrap: wrap; justify-content: flex-end; }
button.topbtn {
  width: auto;
  margin: 0;
  padding: 0.35rem 0.5rem;
  background: none;
  border: none;
  color: var(--emerald);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
button.topbtn:hover { text-decoration: underline; }
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  min-width: 190px;
  background: var(--card);
  border: 1px solid var(--green-soft);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(4, 106, 56, 0.16);
  padding: 0.35rem;
  z-index: 20;
}
.menu button {
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.6rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.95rem;
  color: var(--ink);
  border-radius: 8px;
}
.menu button:hover { background: var(--green-bg); }
.menu hr { border: none; border-top: 1px solid #eef4ef; margin: 0.35rem 0; }
.badge-count {
  display: inline-block;
  min-width: 1.25rem;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  vertical-align: super;
}
.nw-label { color: #55705f; font-size: 0.9rem; }
.nw-value { font-size: 2rem; font-weight: 800; color: var(--emerald-dark); margin: 0.2rem 0 0.6rem; }
.account-row { display: flex; justify-content: space-between; padding: 0.45rem 0; border-top: 1px solid #eef4ef; }
.account-row .bal.neg { color: var(--error); }
.tx-row { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.4rem 0; border-top: 1px solid #eef4ef; font-size: 0.92rem; }
.tx-row .amt.neg { color: var(--error); }
.mail { border: 1px solid var(--green-soft); border-radius: 10px; padding: 0.8rem; margin: 0.7rem 0; background: #fff; }
.mail h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.mail pre { white-space: pre-wrap; font-family: inherit; font-size: 0.92rem; margin: 0.4rem 0; }
.mail button { width: auto; }
.budget-row { padding: 0.6rem 0; border-top: 1px solid #eef4ef; }
.budget-row:first-child { border-top: none; }
.budget-head { display: flex; justify-content: space-between; align-items: center; }
.budget-cat { font-weight: 600; text-transform: capitalize; }
.budget-figs { font-size: 0.92rem; margin: 0.3rem 0; }
/* Monthly Budgets — tabular rows (Ahmed, 2026-11-23: no dot-separated
   jumble; figures in columns). Line 1: category, "$spent of $limit",
   percent at the far right. Line 2: remaining, projected, pace word. */
.budget-line1 { display: flex; align-items: baseline; gap: 0.75rem; }
.budget-line1 .budget-pct { margin-left: auto; font-weight: 700; }
.budget-line2 { display: flex; align-items: baseline; gap: 1rem; font-size: 0.92rem; margin-top: 0.25rem; color: #33523f; }
.budget-line2 .pace { margin-left: auto; font-weight: 600; }
.pace.on_pace { color: var(--emerald-dark); }
.pace.over_pace { color: var(--warn-ink); }
.pace.over_budget { color: var(--error); }
.budget-row .row-actions { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.budget-row .row-actions button { width: auto; margin: 0; padding: 0.45rem 0.8rem; font-size: 0.9rem; }
.budget-row details { margin: 0.3rem 0; }
.budget-row summary { cursor: pointer; color: var(--emerald); font-size: 0.9rem; }
.badge { font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--green-soft); color: var(--emerald-dark); }
.badge.over_pace { background: var(--warn-bg); color: var(--warn-ink); }
.badge.over_budget { background: #fdeceb; color: var(--error); }
/* Clickable account rows (dashboard accounts panel + transactions). */
.account-row.tap { cursor: pointer; }
.account-row.tap:hover { background: var(--green-bg); }
.account-row .acct-name { color: var(--ink); }
.tx-account { color: #55705f; font-size: 0.85rem; }
/* Notifications inbox rows. */
.notif-row { padding: 0.7rem 0; border-top: 1px solid #eef4ef; }
.notif-row:first-child { border-top: none; }
.notif-row .notif-title { font-weight: 600; }
.notif-row.unread .notif-title::before { content: "● "; color: var(--error); font-size: 0.7rem; vertical-align: middle; }
.notif-row .notif-body { font-size: 0.92rem; margin: 0.25rem 0; }
.notif-row .notif-meta { color: #55705f; font-size: 0.82rem; }
.notif-row .row-actions { display: flex; gap: 0.5rem; margin-top: 0.35rem; }
.notif-row .row-actions button { width: auto; margin: 0; padding: 0.4rem 0.75rem; font-size: 0.9rem; }
/* Preferences: one toggle row per notification type. */
.pref-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.45rem 0; border-top: 1px solid #eef4ef; }
.pref-row:first-of-type { border-top: none; }
.pref-row input[type="checkbox"] { width: auto; margin: 0; transform: scale(1.25); }
.pref-times { display: flex; gap: 1rem; }
.pref-times label { flex: 1; }
