
:root {
  color-scheme: light dark;
  --paper: #f6f5f1;
  --card: #ffffff;
  --ink: #1d2422;
  --muted: #5a6562;
  --line: #d9dcd6;
  --accent: #14584f;
  --accent-ink: #ffffff;
  --danger: #a4262c;
  --danger-tint: #fbeced;
  --ok: #14584f;
  --ok-tint: #e4f1ee;
  --note: #6b4e00;
  --note-tint: #fbf3d9;
  --note-line: #e6d59a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141817;
    --card: #1d2321;
    --ink: #ecefec;
    --muted: #a3aeaa;
    --line: #333c39;
    --accent: #6fcdbd;
    --accent-ink: #0e1f1c;
    --danger: #ff9a9e;
    --danger-tint: #3a1c1e;
    --ok: #6fcdbd;
    --ok-tint: #17302b;
    --note: #f0d68a;
    --note-tint: #33290c;
    --note-line: #5c4c1c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", "Noto Sans", Tahoma, sans-serif;
}
:lang(ar) { line-height: 1.75; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}
.wordmark {
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.top a.lang { color: var(--muted); font-size: 14px; }
main {
  display: grid;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
main.narrow { max-width: 460px; }
.card {
  min-width: 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
h2 { margin: 0 0 12px; font-size: 18px; line-height: 1.35; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); font-size: 14px; }
.after-form { margin-top: 16px; }
.next-section { margin-top: 20px; }
a { color: var(--accent); }
form { display: grid; gap: 14px; margin: 0; }
form.inline { display: inline; }
label { display: grid; gap: 6px; min-width: 0; font-weight: 600; font-size: 15px; }
label small { color: var(--muted); font-weight: 400; font-size: 13px; }
input, textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--muted);
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}
textarea { min-height: 112px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.ltr { direction: ltr; text-align: left; unicode-bidi: isolate; }
.fields-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 560px) { .fields-two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
button {
  min-height: 46px;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button.quiet { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }
button.danger { min-height: 44px; padding: 4px 14px; background: transparent; color: var(--danger); border-color: var(--danger); font-size: 14px; font-weight: 600; }
.message { padding: 12px 14px; border-radius: 8px; font-size: 15px; }
.message.error { background: var(--danger-tint); color: var(--danger); }
.message.ok { background: var(--ok-tint); color: var(--ok); }
.message.note { background: var(--note-tint); color: var(--note); }
.stand-in {
  margin-bottom: 14px;
  padding: 14px;
  background: var(--note-tint);
  color: var(--note);
  border: 1px dashed var(--note-line);
  border-radius: 8px;
  font-size: 14px;
}
.stand-in strong {
  display: block;
  margin-top: 4px;
  font: 700 30px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  direction: ltr;
  text-align: center;
}
.code-input { font: 700 24px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.25em; text-align: center; direction: ltr; }
.link-box {
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 14px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  direction: ltr;
  text-align: left;
  overflow-wrap: anywhere;
  user-select: all;
}
.rows { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows li:last-child { padding-bottom: 0; }
.grow { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.grow a { display: inline-block; padding: 6px 0; font-weight: 600; }
.chip {
  display: inline-block;
  padding: 1px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.chip.on { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--note-tint); color: var(--note); border-color: transparent; }
.chip.danger { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.search { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-bottom: 14px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 14px; }
.signed-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.signed-in .who { min-width: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; }
.steps a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.steps a::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  font-size: 14px;
}
.steps .done a::before { content: "✓"; background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.steps .next a { border-color: var(--accent); border-width: 2px; }
.steps .label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.button-link {
  display: block;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.progress-line { margin-bottom: 14px; }
.services { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.services a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.services .label { min-width: 0; overflow-wrap: anywhere; }
.services .chip { font-weight: 400; }
.tallies { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.tally {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}
.tally strong { font-size: 22px; line-height: 1.2; }
.tally.warn strong { color: var(--note); }
.tally.danger strong { color: var(--danger); }
.tally.selected { border-color: var(--accent); border-width: 2px; padding: 9px 11px; }
.role-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; flex: 1 1 260px; }
button.small { min-height: 44px; padding: 4px 14px; font-size: 14px; }
.filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-bottom: 14px; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.next-line { margin-top: 10px; }
summary { min-height: 44px; padding: 10px 0; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.files .thumb { display: grid; gap: 2px; padding: 0; font-weight: 400; text-decoration: none; text-align: center; }
.thumb img { display: block; width: 84px; height: 84px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.files .file-link { padding: 6px 0; font-weight: 400; overflow-wrap: anywhere; }
input[type="file"] { padding: 9px 12px; }
input.check { width: auto; min-height: 0; margin-inline-end: 6px; }
label:has(input.check) { display: block; }
