:root {
  --paper: #f4efe4;
  --ink: #1b2822;
  --muted: #5c675f;
  --line: #d7cdb8;
  --card: #fffaf3;
  --green: #0e5c48;
  --green-soft: #e5f3ee;
  --clay: #8d3d32;
  --clay-soft: #f8ebe7;
  --gold: #a15c2a;
  --shadow: 0 18px 40px rgba(48, 36, 18, 0.08);
  --serif: "Noto Naskh Arabic", "Noto Naskh Arabic", Tahoma, serif;
  --sans: "Vazirmatn", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0%, #efe4cf 0, transparent 36%),
    linear-gradient(180deg, #f7f3ea 0%, var(--paper) 40%);
}
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }

.desk {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.rail {
  padding: 28px 22px;
  border-left: 1px solid var(--line);
  background: #1b2822;
  color: #f4efe4;
}
.mark {
  font-family: var(--serif);
  font-size: 28px;
  margin: 0 0 4px;
}
.mark span { color: #d7b48a; }
.rail p { color: #c9d2cb; font-size: 13px; line-height: 1.7; margin: 0 0 22px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.steps button {
  width: 100%;
  text-align: right;
  background: transparent;
  border: 0;
  color: #d5ddd8;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.steps button[disabled] { opacity: 0.38; cursor: default; }
.steps button.active { background: #294137; color: white; }
.steps i {
  font-style: normal;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid #6d7d74;
  font-size: 12px;
}
.steps button.done i { background: #0e5c48; border-color: #0e5c48; }
.rule {
  margin-top: 28px;
  padding: 14px;
  border-radius: 14px;
  background: #294137;
  font-size: 13px;
  line-height: 1.8;
}
.main { padding: 32px 40px 64px; max-width: 980px; }
.kicker {
  letter-spacing: 0;
  color: var(--gold);
  font-size: 13px;
  margin: 0 0 6px;
}
h1 { font-family: var(--serif); font-weight: 600; font-size: 40px; margin: 0 0 8px; }
.lead { color: var(--muted); line-height: 1.9; margin: 0 0 22px; }
.grid { display: grid; gap: 14px; }
.two { grid-template-columns: 1fr 1fr; }
.card, .choice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.choice {
  text-align: right;
  padding: 18px;
}
.choice strong { display: block; font-size: 18px; margin-bottom: 6px; }
.choice span { color: var(--muted); font-size: 14px; line-height: 1.7; display: block; }
.choice.selected { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
}
textarea { min-height: 88px; resize: vertical; line-height: 1.8; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--green);
  color: white;
  font-size: 15px;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.clay { background: var(--clay); }
.btn:disabled { opacity: 0.45; cursor: default; }
.note, .error {
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.8;
  font-size: 14px;
}
.note { background: var(--green-soft); }
.error { background: var(--clay-soft); color: var(--clay); }
.serp { display: grid; gap: 8px; margin: 12px 0; }
.serp article {
  padding: 10px 12px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
}
.serp b { color: var(--green); margin-left: 6px; }
.serp small { color: var(--muted); display: block; }
.heading-row, .kw-row, .faq-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 88px 1fr auto;
  align-items: center;
  margin-bottom: 8px;
}
.faq-row { grid-template-columns: 1fr 1fr auto; }
.pin { font-size: 12px; color: var(--gold); }
.brief {
  white-space: pre-wrap;
  font-family: var(--sans);
  background: #1b2822;
  color: #f4efe4;
  border-radius: 18px;
  padding: 18px;
  line-height: 1.8;
  font-size: 14px;
}
.preview {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  line-height: 1.9;
}
.preview h2 { font-size: 22px; margin: 1.2em 0 0.4em; }
.preview h3 { font-size: 17px; }
.preview .pai-toc { background: #f6f1e6; padding: 12px 14px; border-radius: 12px; }
.preview .pai-medical-note { border-right: 3px solid var(--clay); padding-right: 12px; color: var(--clay); }
.hidden { display: none; }
body.locked .desk { grid-template-columns: 1fr; }
body.locked .rail { display: none; }
.nav { display: grid; gap: 6px; margin-bottom: 16px; }
.nav button { text-align: right; background: transparent; color: #f4efe4; border: 1px solid #3d5248; border-radius: 12px; padding: 8px 12px; }
.nav button.active { background: #0e5c48; border-color: #0e5c48; }
.login {
  max-width: 420px;
  margin: 12vh auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  margin-bottom: 8px;
}
.article b { display: block; }
.article small { color: var(--muted); }
@media (max-width: 860px) {
  .desk { grid-template-columns: 1fr; }
  .rail { border-left: 0; }
  .two, .heading-row, .faq-row { grid-template-columns: 1fr; }
  .main { padding: 22px 16px 48px; }
  h1 { font-size: 32px; }
}
