/* Quantum brand: Corporate Blue #0F73C3, Royal #002878, Sky #00B6F1,
   Green #74A534, Orange #F47F16, Red #A72123, neutrals #6A7B84 / #B0B9BF */
:root {
  --blue: #0f73c3;
  --royal: #002878;
  --sky: #00b6f1;
  --green: #74a534;
  --orange: #f47f16;
  --red: #a72123;
  --ink: #1c242b;
  --muted: #6a7b84;
  --line: #d5dee6;
  --paper: #ffffff;
  --wash: #f3f7fb;
  --warn-bg: #fff6eb;
  --danger-bg: #fdf3f3;
  --ok-bg: #f3f8ec;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  background: #f6f7f8;
  color: var(--ink);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  line-height: 1.7;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #5c6166;
  color: #fff;
  border-bottom: 3px solid #ed8922;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toolbar a, .toolbar button {
  font-family: inherit;
  font-size: 14px;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  min-height: 40px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar a.print,
.toolbar button {
  background: #ed8922;
  color: #1e1810;
  border-color: #ed8922;
  font-weight: 700;
}

.toolbar a {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.toolbar a.home { border-color: #ed8922; }

.toolbar a.snap {
  background: #ed8922;
  color: #1e1810;
  border-color: #ed8922;
  font-weight: 800;
}

.toolbar .short { display: none; }

.toolbar .hint { font-size: 12px; color: #f4f1ee; }

.sheet {
  max-width: 210mm;
  margin: 22px auto 40px;
  background: var(--paper);
  box-shadow: 0 10px 40px rgba(58, 58, 58, 0.14);
}

.mast {
  background: #5c6166;
  color: #fff;
  padding: 22px 22px 18px;
  border-bottom: 6px solid #ed8922;
}

.mast { display: flex; flex-direction: column; align-items: flex-start; }
.brand {
  display: inline-flex;
  direction: ltr;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 6px 12px;
}

.rasam-mark {
  height: 52px;
  width: auto;
  max-width: 100%;
  display: block;
}

a.doclink {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
}

.word {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 22px;
}

.subbrand {
  display: block;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 13px;
  color: #d7f3ff;
  margin-top: 2px;
}

.doc-kicker {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #f6efe6;
}

h1 {
  margin: 4px 0 0;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.45;
}

.lead {
  margin: 8px 0 0;
  font-size: 16.5px;
  color: #f7f4f1;
  max-width: 62em;
}

.body { padding: 16px 20px 24px; }

.note, .warn, .danger, .ok {
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 14px;
  font-size: 16px;
}

.note { background: var(--wash); border-inline-start: 4px solid var(--sky); }
.warn { background: var(--warn-bg); border-inline-start: 4px solid var(--orange); }
.danger { background: var(--danger-bg); border-inline-start: 4px solid var(--red); }
.void {
  background: #fde8e8;
  border: 2px solid #a72123;
  color: #8d1517;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 12px;
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.85;
}
.ok { background: var(--ok-bg); border-inline-start: 4px solid var(--green); }
.expert {
  border: 1.5px solid var(--blue);
  background: #f3f8fd;
  border-radius: 8px;
  padding: 8px 10px 2px;
  margin: 8px 0 2px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.expert p { margin: 0 0 4px; font-size: 15.5px; }
.expert b { color: var(--royal); }
.expert-choices label {
  display: inline-flex;
  direction: rtl;
  align-items: center;
  gap: 5px;
  margin-inline-end: 14px;
  font-size: 15.5px;
}
.expert-choices input { accent-color: var(--blue); width: 14px; height: 14px; }
.lines.tight { margin: 4px 0 6px; }
.lines.tight .row { height: 22px; }

.note strong, .warn strong, .danger strong { font-weight: 700; }

h2 {
  margin: 18px 0 8px;
  font-size: 19px;
  color: var(--royal);
  border-inline-start: 4px solid var(--blue);
  padding-inline-start: 10px;
  line-height: 1.4;
}
.page-break { display: none; }
h2.critical {
  background: #8d1517;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
}

h3 {
  margin: 12px 0 6px;
  font-size: 16.5px;
  color: var(--blue);
  break-after: avoid;
}

p { margin: 0 0 8px; font-size: 16.5px; }

.meta {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 8px;
  font-size: 16px;
}

.meta th, .meta td, .spec th, .spec td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: middle;
  text-align: right;
}

.meta th {
  width: 28%;
  background: var(--wash);
  color: var(--royal);
  font-weight: 600;
  white-space: nowrap;
}

.fill {
  display: inline-block;
  min-width: 70%;
  border-bottom: 1px dotted #8aa0b0;
  height: 1.1em;
}

.fill.short { min-width: 28%; }
bdi[dir="ltr"] {
  direction: ltr;
  unicode-bidi: isolate;
}

.spec tr.key td {
  background: #fff4e8;
  font-weight: 700;
}
.spec tr.key td:first-child { border-inline-start: 4px solid #ed8922; }

a.snap-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  background: #ed8922;
  color: #1e1810;
  font-weight: 800;
  text-decoration: none;
  border-radius: 6px;
  padding: 8px 14px;
}
.spec th { background: var(--royal); color: #fff; font-weight: 600; }
.spec tr:nth-child(even) td { background: #f7fafc; }
.spec td.num, .spec th.num {
  text-align: center;
  direction: ltr;
  unicode-bidi: isolate;
}

ol.items, ul.items { list-style: none; margin: 0; padding: 0; }

.item {
  break-inside: avoid;
  page-break-inside: avoid;
  border-bottom: 1px solid #e6eef3;
}

.item label {
  display: flex;
  direction: ltr;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 2px;
  cursor: pointer;
}

.item input { margin-top: 5px; accent-color: var(--blue); width: 15px; height: 15px; }

.item .t { font-size: 16px; direction: rtl; text-align: right; flex: 1; line-height: 1.65; }
.item .t b { color: var(--royal); font-weight: 700; }
.item .src {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 1px;
}

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  border-radius: 99px;
  padding: 0 7px;
  margin-inline-start: 6px;
  vertical-align: 1px;
}
.tag.must { background: #fde8e8; color: var(--red); }
.tag.rec { background: #e7f6fd; color: #08608a; }

.lines { margin: 6px 0 12px; }
.lines .row {
  border-bottom: 1px solid #c5d2dc;
  height: 28px;
}

.sign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px 12px;
  break-inside: avoid;
}

.card h3 { margin-top: 0; }

.card .rowline {
  display: flex;
  direction: ltr;
  flex-direction: row-reverse;
  gap: 8px;
  align-items: flex-end;
  margin: 8px 0;
  font-size: 16px;
}

.card .rowline span.grow {
  flex: 1;
  border-bottom: 1px dotted #8aa0b0;
  height: 1.15em;
}

.stamp {
  margin-top: 8px;
  height: 78px;
  border: 1px dashed var(--blue);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 15px;
}

.footer {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 2px solid var(--blue);
  color: var(--muted);
  font-size: 13px;
}

.footer a { color: var(--blue); }

.steps { margin: 0 0 16px; padding-inline-start: 1.3em; font-size: 16.5px; }
.steps li { margin: 0 0 6px; }

.snap-form { margin-top: 8px; display: grid; gap: 10px; max-width: 32em; }
.field { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.field input {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  width: 100%;
  background: #fff;
}
.pick {
  display: inline-flex;
  align-items: center;
  background: #5c6166;
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
}
#snap-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.file-name { margin-top: 10px; color: var(--muted); }
.snap-msg { min-height: 1.4em; font-weight: 700; }
.snap-msg.bad { color: #a72123; }
.snap-msg.ok { color: #3d6b12; }
button.send {
  background: #ed8922;
  color: #1e1810;
  font-family: inherit;
  font-weight: 800;
  border: 0;
  border-radius: 6px;
  padding: 10px 18px;
  cursor: pointer;
}

.keep { break-inside: avoid; page-break-inside: avoid; }

@media screen and (max-width: 1024px) {
  .sheet { margin: 12px 12px 28px; }
  .mast { padding: 16px 14px 14px; }
  .body { padding: 14px 12px 22px; }
  h1 { font-size: 23px; }
  .meta th { white-space: normal; }
}

@media screen and (max-width: 720px) {
  .toolbar {
    padding: 6px 8px;
    gap: 6px;
  }
  .toolbar-actions {
    flex-wrap: nowrap;
    width: 100%;
    gap: 6px;
  }
  .toolbar-actions a,
  .toolbar-actions button {
    flex: 1 1 0;
    width: auto;
    min-height: 0;
    padding: 4px 4px;
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
  }
  .toolbar .long { display: none; }
  .toolbar .short { display: inline; }
  .toolbar .hint { display: none; }
  .sign-grid { grid-template-columns: 1fr; }
  .rasam-mark { height: 42px; }
  .lead, p, .item .t { font-size: 16.5px; }
  .body { overflow-x: auto; }
  .meta, .meta tbody, .meta tr, .meta th, .meta td { display: block; width: 100%; }
  .meta tr { margin-bottom: 8px; }
  .meta th { border-bottom: 0; }
  .fill, .fill.short { display: block; min-width: 0; width: 100%; }
}

@page {
  size: A4;
  margin: 12mm 11mm 14mm 11mm;
  @bottom-center {
    content: "\200e" counter(page) " / " counter(pages);
    direction: ltr;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-size: 9pt;
    color: #6a7b84;
  }
}

body.paginate .sheet {
  width: 188mm;
  max-width: 188mm;
  margin: 0;
}
body.paginate .body { padding: 8px 0 0; }
body.paginate .mast { padding: 10px 0 8px; }
body.paginate .rasam-mark { height: 42px; }
body.paginate h1 { font-size: 19pt; }
body.paginate h2 { font-size: 15.5pt; }
body.paginate h3 { font-size: 14.5pt; }
body.paginate .lead { font-size: 13.5pt; }
body.paginate .item .t,
body.paginate p,
body.paginate .meta,
body.paginate .note,
body.paginate .warn,
body.paginate .danger,
body.paginate .ok,
body.paginate .void,
body.paginate .expert p,
body.paginate .card .rowline,
body.paginate .steps { font-size: 13.5pt; }
body.paginate .spec { font-size: 11.5pt; }
body.paginate .item label { padding-top: 6px; padding-bottom: 6px; }
body.paginate .fill-sheet,
body.paginate .fill-page {
  min-height: 0 !important;
  display: block !important;
}
body.paginate .fill-sheet ol.items,
body.paginate .fill-sheet ul.items,
body.paginate .fill-sheet .lines {
  display: block !important;
  flex: none !important;
}

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .sheet { margin: 0; box-shadow: none; max-width: none; }
  .mast { padding: 10px 0 8px; }
  .rasam-mark { height: 42px; }
  a.doclink { color: #0f73c3; text-decoration: underline; }
  .body { padding: 8px 0 0; }
  h1 { font-size: 19pt; }
  h2 { font-size: 15.5pt; margin-top: 12pt; }
  h3 { font-size: 14.5pt; }
  .lead { font-size: 13.5pt; }
  .page-break { display: none !important; height: 0; }
  h1, h2, h3, p, .item, .expert, .keep, .note, .warn, .void, .ok, .danger,
  table, tr, thead, tbody, .sign-grid, .card, .fill-sheet, .fill-page, .lines, .meta {
    break-before: auto !important;
    break-after: auto !important;
    break-inside: auto !important;
    page-break-before: auto !important;
    page-break-after: auto !important;
    page-break-inside: auto !important;
  }
  .sheet, .body { overflow: visible; }
  .item .t, p, .meta, .note, .warn, .danger, .ok, .void, .expert p, .card .rowline { font-size: 13.5pt; }
  .item .src, .footer, .stamp { font-size: 11pt; }
  .spec { font-size: 11.5pt; }
  .item label { padding-top: 6px; padding-bottom: 6px; }
  .fill-sheet, .fill-page {
    min-height: 0 !important;
    display: block !important;
  }
  .fill-sheet ol.items,
  .fill-sheet ul.items,
  .fill-sheet .lines {
    display: block !important;
    flex: none !important;
    min-height: 0 !important;
  }
  .print-page {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
    break-after: page;
    page-break-after: always;
  }
  .print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  .print-page > .item,
  .print-page > table,
  .print-page > .expert,
  .print-page > .sign-grid,
  .print-page > .lines {
    flex: 1 1 auto;
  }
  body.checklist .print-page > .item,
  body.checklist .print-page > table,
  body.checklist .print-page > .expert,
  body.checklist .print-page > .sign-grid,
  body.checklist .print-page > .lines,
  body.checklist .print-page > .warn {
    flex: 0 0 auto;
  }
  .print-page > h2,
  .print-page > p,
  .print-page > .void,
  .print-page > .warn,
  .print-page > .ok,
  .print-page > .note,
  .print-page > .footer {
    flex: 0 0 auto;
  }
  .print-page > .item { display: block; }
  .print-page.fit-opening > .note,
  .print-page.fit-opening > h2 { flex: 0 0 auto; }
  .print-page.fit-opening > table.meta {
    flex: 1 1 auto;
    height: 100%;
  }
  body.checklist .print-page.fit-opening > table.meta {
    flex: 0 0 auto;
    height: auto;
  }
  .print-page.fit-opening.compact .note {
    margin-bottom: 6px;
    line-height: 1.45;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .print-page.fit-opening.compact .meta th,
  .print-page.fit-opening.compact .meta td,
  .print-page.fit-opening.compact .fill-meta th,
  .print-page.fit-opening.compact .fill-meta td {
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .print-page > .expert {
    display: flex;
    flex-direction: column;
  }
  .print-page > .expert .lines {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .print-page > .expert .row {
    flex: 1 1 auto;
    height: auto;
    min-height: 28px;
  }
  body.checklist .print-page > .expert {
    display: block;
  }
  body.checklist .print-page > .expert .lines,
  body.checklist .print-page > .expert .row {
    flex: 0 0 auto;
    display: block;
  }
  .fill-page .spec th,
  .fill-page .spec td {
    padding: 12px 10px;
    line-height: 1.65;
  }
  .fill-page h2 { margin-bottom: 12px; }
  .fill-page .warn {
    margin-top: 14px;
    padding: 14px 12px;
    line-height: 1.65;
  }
  .fill-sheet {
    min-height: 266mm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
  }
  .fill-sheet ol.items,
  .fill-sheet ul.items {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 auto;
    margin: 0;
  }
  .fill-sheet .lines:not(.tight) {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .fill-sheet .lines:not(.tight) .row {
    height: auto;
    min-height: 28px;
    flex: 1 1 auto;
  }
  .fill-meta th,
  .fill-meta td {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .fill-cover th,
  .fill-cover td {
    padding-top: 14px;
    padding-bottom: 14px;
    line-height: 1.65;
  }
  a { color: inherit; text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
