/* Cicara — the same palette the app uses, in both light and dark. */
:root {
  --leaf-glow: #B7D34A;
  --leaf-mid: #6E9B37;
  --leaf-deep: #3B6428;
  --leaf-ink: #16290F;
  --sun: #F0D95B;
  --ember: #C9382F;
  --cream: #F5F1E1;

  --bg: var(--cream);
  --surface: #ffffff;
  --card: #EDEBD6;
  --line: #DBD7BE;
  --text: #1B2A12;
  --dim: #54655C;
  --accent: var(--leaf-deep);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--leaf-ink);
    --surface: #1E3616;
    --card: #26421C;
    --line: #3B6129;
    --text: #F3F5E6;
    --dim: #A9BC93;
    --accent: var(--leaf-glow);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}

.back {
  display: inline-block;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 1.75rem;
  font-size: 1.05rem;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

h2 {
  font-size: 1.2rem;
  letter-spacing: -0.015em;
  margin: 2.4rem 0 0.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.4rem;
  color: var(--accent);
}

p, li, dd { color: var(--text); }
.updated { color: var(--dim); font-size: 0.88rem; margin-top: 0; }

ul, ol { padding-left: 1.15rem; }
li { margin-bottom: 0.4rem; }

a { color: var(--accent); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.94rem;
  display: block;
  overflow-x: auto;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--dim); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }

dl { margin: 1rem 0 0; }
dt { font-weight: 700; margin-top: 1.35rem; }
dd { margin: 0.3rem 0 0; color: var(--dim); }

form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.4rem;
  margin: 1.6rem 0 0;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 1.05rem 0 0.4rem;
}
label:first-of-type { margin-top: 0; }
.hint { text-transform: none; letter-spacing: 0; font-weight: 400; }

input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0.8rem 0.9rem;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

button {
  margin-top: 1.3rem;
  width: 100%;
  min-height: 52px;
  font: inherit;
  font-weight: 700;
  color: var(--leaf-ink);
  background: var(--leaf-glow);
  border: none;
  border-radius: 20px;
  cursor: pointer;
}
@media (prefers-color-scheme: light) {
  button { background: var(--leaf-deep); color: #fff; }
}
button:disabled { opacity: 0.55; cursor: default; }

.note { margin: 0.9rem 0 0; font-size: 0.92rem; color: var(--dim); min-height: 1.4em; }
.note.good { color: var(--leaf-mid); }
.note.bad { color: var(--ember); }

footer {
  margin-top: 3.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.9rem;
}

/* Arabic reads right to left. The rules above assume the other direction, so
   the few that hard-code a side are mirrored here rather than duplicated. */
[dir="rtl"] th,
[dir="rtl"] td { text-align: right; }
[dir="rtl"] ul,
[dir="rtl"] ol { padding-left: 0; padding-right: 1.15rem; }
