:root {
  --orange: #f08a12;
  --orange-dark: #c86c08;
  --gray: #5c636a;
  --ink: #2c3136;
  --muted: #5e666e;
  --line: #e3e5e8;
  --bg: #f3f4f6;
  --card: #fff;
  --critical: #8a3d12;
  --degraded: #b85a10;
  --warning: #c98412;
  --attention: #8a7340;
  --info: #4d5963;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
  line-height: 1.85;
}
.topbar {
  background: #fff;
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 18px;
  border-bottom: 6px solid var(--orange);
}
.top-contact {
  direction: rtl;
  text-align: left;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.55;
}
.top-contact strong { display: block; font-size: 15px; }
.top-contact span { display: block; }
.brand img {
  display: block;
  height: 92px;
  width: auto;
  max-width: min(520px, 58vw);
  background: #fff;
}
.guide-open {
  display: inline-block;
  margin: 0 0 14px;
  background: var(--orange);
  color: #fff;
  border: 0;
  font-weight: 700;
  padding: 8px 16px;
}
.guide-open:hover { background: var(--orange-dark); }
#guide-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(920px, calc(100vw - 28px));
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(44, 49, 54, 0.28);
}
#guide-dialog::backdrop { background: rgba(44, 49, 54, 0.55); }
.guide-close {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  border: 0;
  border-radius: 999px;
  background: var(--gray);
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 8px 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}
.guide-close:hover { background: #3f454b; }
.guide-scroll {
  max-height: 90vh;
  overflow: auto;
  padding: 22px 22px 28px;
}
.guide-scroll h2 { margin: 0 48px 14px 72px; }
.howto { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.howto li { margin: 0 0 22px; }
.howto h3 { margin: 0 0 8px; font-size: 18px; }
.howto img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.wrap { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
.hero { padding: 28px 0 8px; }
.hero h1 { margin: 0 0 8px; font-size: 32px; line-height: 1.4; }
.hero p { margin: 0; color: var(--muted); font-size: 17px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin: 18px 0;
  box-shadow: 0 8px 24px rgba(44, 49, 54, 0.04);
}
label.field { display: block; font-weight: 700; margin-bottom: 8px; }
textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid #cfd3d7;
  border-radius: 12px;
  padding: 14px;
  font: inherit;
  line-height: 1.7;
  background: #fbfbfc;
}
textarea:focus { outline: 3px solid rgba(240, 138, 18, 0.28); border-color: var(--orange); }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
button, .chip {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid transparent;
}
.primary, .ghost, .chip, .sample {
  padding: 8px 16px;
}
.primary { background: var(--orange); color: white; font-weight: 700; }
.primary:hover { background: var(--orange-dark); }
.ghost { background: white; border-color: #cfd3d7; color: var(--ink); }
.samples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sample {
  background: #fff7ee;
  border: 1px solid #f3d2a8;
  color: #7a4b10;
}
.note {
  background: #fff8ef;
  border-right: 4px solid var(--orange);
  padding: 10px 14px;
  border-radius: 10px;
  color: #5c4a32;
  margin-top: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 8px;
  margin: 14px 0 18px;
}
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card h3 { margin: 0; font-size: 24px; }
.card h4 { margin: 16px 0 6px; color: var(--orange-dark); }
.code { margin: 0; font-weight: 800; color: var(--orange-dark); }
.en { margin: 2px 0 0; color: var(--muted); }
.badges, .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  border-radius: 999px;
  padding: 2px 10px;
  background: #eef1f4;
  color: var(--ink);
  font-size: 13px;
}
.pill.ok { background: #e8f6ee; color: #1d6b3a; }
.pill.soft { background: #fff1dc; color: #8a5a10; }
.pill.sev, .sev-critical .pill.sev { background: #f8ebe3; color: var(--critical); }
.sev-degraded .pill.sev { color: var(--degraded); }
.sev-warning .pill.sev { color: var(--warning); }
.sev-attention .pill.sev { color: var(--attention); }
.sev-informational .pill.sev { color: var(--info); }
.steps { margin: 8px 0 16px; padding: 0 22px 0 0; }
.steps li { margin: 8px 0; padding-right: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.facts div { background: #f7f8f9; border-radius: 10px; padding: 8px 10px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-weight: 700; }
.fa-text { font-size: 17px; }
details summary { cursor: pointer; color: var(--muted); }
pre {
  white-space: pre-wrap;
  background: #f7f8f9;
  border-radius: 10px;
  padding: 12px;
  font-family: Consolas, "Courier New", monospace;
}
.ltr { direction: ltr; unicode-bidi: isolate; text-align: left; }
.empty { color: var(--muted); }
.section-title { margin: 28px 0 8px; font-size: 26px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#catalog-filter {
  flex: 1;
  min-width: 220px;
  border: 1px solid #cfd3d7;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { background: white; border-color: #d5d8dc; }
.chip.on { background: var(--gray); color: white; }
.cat-item {
  width: 100%;
  text-align: right;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 10px;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.cat-item b, .cat-item small { display: block; }
.cat-item small { color: var(--muted); font-weight: 400; }
.cat-item .pill.sev-critical { color: var(--critical); }
.cat-item .pill.sev-degraded { color: var(--degraded); }
.cat-item .pill.sev-warning { color: var(--warning); }
.cat-item .pill.sev-attention { color: var(--attention); }
.cat-item .pill.sev-informational { color: var(--info); }
.hint { margin-top: 0; color: #7a5b28; background: #fff8ef; border-radius: 8px; padding: 8px 10px; }
.site-footer {
  margin-top: 36px;
  background: var(--gray);
  color: white;
  padding: 28px 0 36px;
}
.site-footer strong { display: block; font-size: 20px; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: white; }
@media (max-width: 720px) {
  .hero h1 { font-size: 26px; }
  .card-head, .cat-item { display: flex; flex-direction: column; align-items: flex-start; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .brand img { height: 72px; max-width: 100%; }
}
@media print {
  .panel, .chips, .tools, .samples, .note, #catalog, .section-title, .ghost, .primary { display: none !important; }
  body { background: white; }
  .card, .translate { break-inside: avoid; box-shadow: none; }
}
