:root {
  --bg: #f7faf6; --surface: #ffffff; --text: #18201b; --muted: #4c5a50;
  --green: #00522c; --accent: #0f6d3d; --gold: #f2a007; --line: #dce5de;
  --header: #00522c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1511; --surface: #171f1a; --text: #e2ebe4; --muted: #a9b8ad;
    --green: #8fd8a8; --accent: #8fd8a8; --gold: #ffd45c; --line: #2a362e;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
header { background: var(--header); color: #fff; padding: 28px 16px 24px; }
header .wrap { max-width: 760px; margin: 0 auto; }
header a { color: #ffd45c; text-decoration: none; font-weight: 600; }
header h1 { margin: 6px 0 4px; font-size: 1.9rem; line-height: 1.2; }
header p { margin: 0; opacity: .9; }
header .top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
header a.lang { color: #fff; font-weight: 500; opacity: .9; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 2px 12px; font-size: .9rem; }
html[dir="rtl"] body { font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif; line-height: 1.8; }
main { max-width: 760px; margin: 0 auto; padding: 8px 16px 48px; }
h2 { color: var(--green); margin: 32px 0 8px; font-size: 1.25rem; }
h3 { margin: 20px 0 4px; font-size: 1.05rem; }
a { color: var(--accent); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 4px 20px; margin: 16px 0;
}
.summary li { margin: 6px 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: start; vertical-align: top; padding-block: 8px; padding-inline: 0 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
small, .muted { color: var(--muted); }
ol li, ul li { margin: 4px 0; }
footer { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: .9rem; }

/* Per-app colours: each page sets a class on body. SpendWise keeps the defaults above. */
body.studio { --header: #1f2b25; }
body.daftari { --header: #0e4a36; --bg: #f6f2e9; --text: #1b1f1c; --green: #0e4a36; --accent: #0e4a36; --line: #e3dccb; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.daftari {
    --bg: #12140f; --surface: #1b1e17; --text: #e8e4d8; --muted: #b3ad9c;
    --green: #9fd4b9; --accent: #9fd4b9; --line: #2f3328;
  }
}
.apps { list-style: none; padding: 0; margin: 0; }
.apps li { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.apps li:last-child { border-bottom: 0; }
.apps a { font-weight: 600; font-size: 1.1rem; }
.apps span { display: block; color: var(--muted); }
