.hint:empty {
  display: none;
}
button.tx svg {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -.25em;
  margin-inline-end: 5px;
}
span.bd {
  background: var(--lkb);
  color: var(--lk);
}
.av-t {
  border-collapse: collapse;
  width: 100%;
}
.av-t th, .av-t td {
  border: 1px solid var(--ln);
  padding: 2px 4px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}
.av-t th {
  background: var(--pn);
  font-weight: 600;
  color: var(--ink);
}
.av-t td.t {
  text-align: right;
  white-space: normal;
}
.av-t td.n {
  direction: ltr;
}
.av-t td input {
  width: 100%;
  min-width: 64px;
  border-radius: 3px;
  padding: 3px 5px;
}
.av-t td input[type=checkbox], .av-t th input[type=checkbox] {
  width: auto;
  min-width: 0;
}
.av-t td select {
  width: 100%;
  min-width: 90px;
  border-radius: 3px;
  padding: 3px 5px;
}
.av-t td.eff {
  font-variant-numeric: tabular-nums;
}
.av-t tr.mod td {
  background: var(--bg);
}
.av-t tr.mod td input:not([type=checkbox]), .av-t tr.mod td select {
  background: var(--pn);
}
.av-t tr.cu td {
  background: var(--lkb);
}
.av-t td.act {
  white-space: nowrap;
}
#avpg {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.layout {
  display: flex;
  min-height: 100vh;
}
.side {
  flex: 0 0 210px;
  background: var(--pn);
  border-inline-start: 1px solid var(--ln);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 15px;
  font-weight: 800;
  color: var(--ac);
  padding: 0 8px;
  margin-bottom: 14px;
}
.nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.nav a:hover {
  background: var(--bg);
}
.nav a.on {
  background: var(--ac);
  color: var(--acx);
  border-color: var(--ac);
  font-weight: 600;
}
.nav a.sub {
  padding-inline-start: 24px;
  font-size: 12px;
  color: var(--mut);
}
.nav a.sub.on {
  color: var(--acx);
}
.pick {
  margin: 0 0 14px;
  padding: 0 4px;
}
.pick.bottom {
  margin: auto 0 0;
  padding-top: 14px;
}
.pick label {
  display: block;
  font-size: 11px;
  color: var(--mut);
  margin-bottom: 3px;
}
.pick select {
  width: 100%;
  font: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--ln);
  border-radius: 6px;
  padding: 4px 6px;
}
.pick select:focus {
  outline: 2px solid var(--ac);
  outline-offset: 1px;
}
.backlink {
  font-size: 12px;
  color: var(--mut);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 5px;
  padding: 1px 4px;
}
.backlink:hover {
  color: var(--ac);
  text-decoration: underline;
}
button.ic {
  padding: 5px 9px;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.ic.on {
  color: var(--ac);
  border-color: var(--ac);
}
.phead {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 260px;
}
.phead .ptitle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: auto;
  max-width: 100%;
}
.phead .ptitle .doc {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
}
.phead select.projsel {
  flex: 0 1 360px;
  width: 360px;
  max-width: 100%;
  min-width: 0;
  height: 32px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--ink);
  background: var(--pn);
  border: 1px solid var(--ln);
  border-radius: 6px;
  padding: 0 8px;
  cursor: pointer;
}
.phead select.projsel:hover,
.phead select.projsel:focus {
  border-color: var(--ac);
}
/* global multiplier of the 80% items' proposed factor coefficients:
   drag the price (left/right) to change it; the slider underneath stays in sync */
.pricebox { display: flex; flex-direction: column; gap: 8px; width: min(100%, 540px); }
#hdrsum { display: flex; flex-direction: column; gap: 4px; }
#hdrsum .pb-top { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--mut); }
#hdrsum .pb-top b { color: var(--ac); font-size: 12px; font-variant-numeric: tabular-nums; }
#hdrsum .pb-main { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.pbv {
  display: inline-block;
  flex: 0 1 auto;
  min-width: 0;
  padding: 0 8px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ac);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  border: 1px dashed var(--ln);
  border-radius: 8px;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}
.pbv:hover,
#hdrsum.sc .pbv { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 8%, transparent); }
.pbu { font-size: 11px; color: var(--mut); }
#hdrsum.er .pbv { color: #b3261e; }
.mchip {
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 12px;
  line-height: 1.6;
  padding: 0 9px;
  border: 1px solid var(--ln);
  border-radius: 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.multreset {
  width: 24px;
  height: 24px;
  padding: 0;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  color: var(--ink);
  background: var(--pn);
  border: 1px solid var(--ln);
  border-radius: 5px;
  cursor: pointer;
}
.multreset:hover,
.multreset:focus-visible { border-color: var(--ac); color: var(--ac); }
.mult-slider { --f: .5; direction: ltr; }
.mult-slider input[type="range"] {
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  direction: ltr;
  cursor: pointer;
}
.mult-slider input[type="range"]:focus { outline: none; }
.mult-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--ac) calc(9px + (100% - 18px) * var(--f)), var(--ln) calc(9px + (100% - 18px) * var(--f)));
}
.mult-slider input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--ac) calc(9px + (100% - 18px) * var(--f)), var(--ln) calc(9px + (100% - 18px) * var(--f)));
}
.mult-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--pn);
  border: 3px solid var(--ac);
}
.mult-slider input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pn);
  border: 3px solid var(--ac);
}
.mult-slider input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--ln); }
.mult-slider input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--ln); }
.phead h1 {
  font-size: 19px;
  line-height: 1.4;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}
.phead .psub {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--mut);
  line-height: 1.7;
  margin-top:10px;
}
.phead .psub .doc {
  color: var(--ink);
  font-weight: 600;
}
.phead .psub .sep {
  color: var(--ln);
}
.status {
  position: fixed;
  inset-inline: 0;
  bottom: 14px;
  margin: auto;
  z-index: 90;
  max-width: min(720px,92vw);
  display: none;
  gap: 10px;
  align-items: flex-start;
  background: #b3261e;
  color: #fff;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  line-height: 1.8;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  white-space: pre-line;
}
.status.on {
  display: flex;
}
.status button {
  background: none;
  border: 0;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.isr {
  position: fixed;
  z-index: 95;
  background: var(--pn);
  color: var(--ink);
  border: 1px solid var(--ln);
  border-radius: 8px;
  direction: rtl;
  max-width: calc(100vw - 16px);
  max-height: 220px;
  overflow: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  padding: 4px;
}
.isr-i {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: right;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 5px 7px;
  font: inherit;
  font-size: 12px;
  color: inherit;
  cursor: pointer;
}
.isr-i.on {
  background: var(--ac);
  color: #fff;
}
.isr-i b {
  direction: ltr;
  unicode-bidi: isolate;
  font-weight: 700;
  font-size: 12px;
  opacity: .9;
}
.isr-i span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.isr-i em {
  font-style: normal;
  font-size: 11px;
  color: var(--mut);
  white-space: nowrap;
}
.isr-i.on em {
  color: #fff;
  opacity: .9;
}
.isr-e {
  padding: 7px 9px;
  font-size: 12px;
  color: var(--mut);
}
.rp {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rp.hide {
  display: none !important;
}
.rpb {
  background: var(--pn);
  color: var(--ink);
  border: 1px solid var(--ln);
  border-radius: 10px;
  width: min(460px,100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.rph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ln);
  position: sticky;
  top: 0;
  background: var(--pn);
}
.rph b {
  font-size: 14px;
}
.rpc {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rpi {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.rpi input {
  width: auto;
  min-width: 0;
  margin: 0;
}
.rpi.on {
  border-color: var(--ac);
}
.rpi small {
  color: var(--mut);
  font-size: 11px;
  margin-inline-start: auto;
}
.rpf {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 14px;
  border-top: 1px solid var(--ln);
  position: sticky;
  bottom: 0;
  background: var(--pn);
}
.rpsb {
  align-self: flex-start;
}
.rsp {
  border: 1px solid var(--ln);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rsp.hide {
  display: none;
}
.rsh {
  font-size: 12.5px;
  font-weight: 700;
}
.rsh small {
  color: var(--mut);
  font-weight: 400;
}
.rsr {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rsn {
  color: var(--mut);
  font-size: 12px;
  min-width: 14px;
  text-align: center;
}
.rsf {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rsf input {
  width: 100%;
}
@media print {
  .status, .rp {
    display: none !important;
  }
}
.days {
  padding: 5px 8px;
  border: 1px dashed var(--ln);
  border-radius: 6px;
  min-height: 33px;
  font-weight: 700;
  color: var(--ac);
  white-space: nowrap;
}
.days.bad {
  color: #b3261e;
  font-weight: 600;
}
.main {
  flex: 1;
  min-width: 0;
}
@media (max-width:760px) {
  .layout {
    display: block;
  }
  .side {
    position: static;
    height: auto;
    border-inline-start: 0;
    border-bottom: 1px solid var(--ln);
  }
  .brand {
    margin-bottom: 8px;
  }
  .pick {
    max-width: 340px;
    padding: 0;
  }
  .nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .nav a {
    margin: 0;
  }
}
@media print {
  .layout {
    display: block;
  }
  .side {
    display: none;
  }
  .main {
    width: 100%;
  }
}
.num, td.n, td.qc, input[inputmode=decimal], input[inputmode=numeric] {
  direction: ltr;
  text-align: right;
}
.pg td.n {
  direction: ltr;
  text-align: right;
  unicode-bidi: isolate;
}
.rpb.stb {
  width: min(900px,100%);
}
.stb .rpc {
  gap: 10px;
}
.stt {
  width: 100%;
  border-collapse: collapse;
}
.stt th, .stt td {
  border-bottom: 1px solid var(--ln);
  padding: 4px 6px;
  font-size: 12.5px;
  text-align: right;
  vertical-align: middle;
}
.stt th {
  color: var(--mut);
  font-weight: 600;
}
.stt td.n {
  direction: ltr;
  text-align: right;
  white-space: nowrap;
}
.stf {
  display: grid;
  grid-template-columns: repeat(12,1fr);
  gap: 8px 10px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  padding: 10px;
}
.stf label {
  font-size: 12px;
  color: var(--mut);
  display: block;
  margin-bottom: 2px;
}
.stf input, .stb input.stin {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ln);
  border-radius: 6px;
  padding: 5px 8px;
  direction: ltr;
  text-align: right;
}
.stf input.fa {
  direction: rtl;
}
.stf .c3 {
  grid-column: span 3;
}
.stf .c6 {
  grid-column: span 6;
}
.stf .c12 {
  grid-column: span 12;
}
@media (max-width:640px) {
  .stf .c3, .stf .c6 {
    grid-column: span 12;
  }
}
.stg {
  font-weight: 700;
  font-size: 12.5px;
  margin: 6px 0 2px;
}
.sterr {
  color: #b3261e;
  font-size: 12px;
  white-space: pre-line;
}
.stb .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.stb button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--ln);
  background: var(--pn);
  color: var(--ink);
  border-radius: 6px;
  padding: 4px 12px;
}
.stb button.pr {
  background: var(--ac);
  color: var(--acx);
  border-color: var(--ac);
  font-weight: 600;
}
.stb button.sm {
  padding: 1px 8px;
  font-size: 12px;
}
@media print {
  .rp {
    display: none !important;
  }
}
.rpb.bkb {
  width: min(780px,100%);
}
.bkb button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--ln);
  background: var(--pn);
  color: var(--ink);
  border-radius: 6px;
  padding: 4px 12px;
}
.bkb button.pr {
  background: var(--ac);
  color: var(--acx);
  border-color: var(--ac);
  font-weight: 600;
}
.bkb button:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.bkb button.ic {
  padding: 5px 9px;
  line-height: 1;
}
.bkb button:focus-visible, .bkb input:focus-visible, .bkb summary:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 1px;
}
.bkb input[type=checkbox], .bkb input[type=radio] {
  width: auto;
  min-width: 0;
  margin: 0;
  accent-color: var(--ac);
}
.bkb input[type=search], .bkb input[type=text] {
  width: auto;
  flex: 1 1 160px;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ln);
  border-radius: 6px;
  padding: 4px 8px;
  direction: rtl;
  text-align: right;
}
.bkb input[type=text].lt {
  direction: ltr;
}
.bktabs {
  display: flex;
  border-bottom: 1px solid var(--ln);
  padding: 0 10px;
}
.bkb .bktabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  padding: 8px 14px;
  color: var(--mut);
}
.bkb .bktabs button.on {
  color: var(--ac);
  border-bottom-color: var(--ac);
  font-weight: 700;
}
.bkb section[hidden] {
  display: none;
}
.bktools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.bkb .bktools button, .bkb .bkopts button {
  padding: 2px 10px;
  font-size: 12px;
}
.bkt {
  border: 1px solid var(--ln);
  border-radius: 8px;
  max-height: min(44vh,420px);
  overflow: auto;
  background: var(--bg);
}
.bkt summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 13px;
}
.bkt summary::-webkit-details-marker {
  display: none;
}
.bkt summary::before {
  content: '◂';
  color: var(--mut);
  font-size: 11px;
  width: 10px;
  flex: none;
}
.bkt details[open]>summary::before {
  content: '▾';
}
.bkt summary:hover {
  background: var(--pn);
}
.bkt .bkp>summary {
  font-weight: 700;
  border-bottom: 1px solid var(--ln);
}
.bkt .bkp:last-child>summary:not(:hover) {
  border-bottom-color: transparent;
}
.bkt .bkn {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.bkt small {
  color: var(--mut);
  font-size: 11px;
  font-weight: 400;
}
.bkt .bkc {
  padding-inline-start: 22px;
}
.bkb label.bki {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 3px 10px;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
}
.bkb label.bki:hover {
  background: var(--pn);
}
.bkb label.bki span {
  overflow-wrap: anywhere;
}
.bkt em {
  font-style: normal;
  font-size: 10.5px;
  border-radius: 999px;
  padding: 0 7px;
  margin-inline-start: auto;
  white-space: nowrap;
  border: 1px solid var(--ln);
  color: var(--mut);
}
.bkt em.ex {
  color: #8a6d00;
  border-color: #8a6d00;
}
.bkt em.nw {
  color: #1f7a4d;
  border-color: #1f7a4d;
}
.bkempty {
  padding: 14px;
  color: var(--mut);
  font-size: 12.5px;
}
.bkopts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12.5px;
}
.bkopts>label {
  margin: 0;
  color: var(--mut);
  font-size: 12px;
}
.bkdrop {
  border: 2px dashed var(--ln);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--mut);
}
.bkdrop.over {
  border-color: var(--ac);
  background: var(--bg);
}
.bkdrop input[type=file] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  direction: rtl;
}
.bkinfo {
  font-size: 12px;
  color: var(--mut);
}
.bkmodes {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bkb .bkmodes label.bki {
  border: 1px solid var(--ln);
  border-radius: 8px;
  padding: 6px 10px;
  align-items: flex-start;
}
.bkmodes small {
  display: block;
  color: var(--mut);
  font-size: 11.5px;
}
.bkrep>div {
  padding: 6px 10px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.bkrep .ok b {
  color: #1f7a4d;
}
.bkrep .warn b {
  color: #8a6d00;
}
.bkrep .error {
  border-color: #b3261e;
}
.bkrep .error b {
  color: #b3261e;
}
.bkrep .bkm {
  font-size: 12px;
  color: var(--mut);
  white-space: pre-line;
  margin-top: 2px;
}
.bkmsg {
  padding: 0 14px 8px;
  font-size: 12.5px;
  color: #b3261e;
  white-space: pre-line;
}
.bkmsg:empty {
  display: none;
}
.bkmsg.ok {
  color: #1f7a4d;
}
.bksum {
  margin-inline-end: auto;
  font-size: 12px;
  color: var(--mut);
  align-self: center;
}
.rpb.bkb .rpf {
  flex-wrap: wrap;
}
.hsum .vl {
  white-space: nowrap;
}
.hsum .vl small {
  font-size: 10px;
  font-weight: 400;
  color: var(--mut);
}
.hsum.er .vl {
  color: #b3261e;
}
.c8 {
  grid-column: span 8;
}
@media (max-width:760px) {
  .c8, .c6, .c4, .c3 {
    grid-column: span 12;
  }
}
button.pr, button.on {
  background: var(--ac);
  color: var(--acx);
  border-color: var(--ac);
  font-weight: 600;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
/* table 3: disciplines as a compact list; the name is a link */
.dsl-box { padding: 12px 14px; }
.dsl-scroll { max-width: 520px; max-height: 220px; overflow-y: auto; border: 1px solid var(--ln); border-radius: 8px; }
table.dsl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.dsl th { position: sticky; top: 0; z-index: 1; padding: 4px 10px; background: var(--bg); color: var(--mut); font-size: 11.5px; font-weight: 600; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--ln); }
table.dsl td { padding: 3px 10px; line-height: 1.6; border-bottom: 1px solid var(--ln); }
table.dsl tr:last-child td { border-bottom: 0; }
table.dsl tbody tr:hover td { background: var(--bg); }
table.dsl td.n, table.dsl td.x { width: 1%; white-space: nowrap; }
table.dsl tbody tr { cursor: pointer; }
table.dsl td.n { color: var(--mut); font-variant-numeric: tabular-nums; }
table.dsl td.x { text-align: left; }
table.dsl .lk { opacity: .5; }
table.dsl tr:hover .lk, table.dsl .lk:focus-visible { opacity: 1; }
.dsl-link { color: var(--ink); text-decoration: none; }
.dsl-link:hover { color: var(--ac); text-decoration: underline; }
table.dsl tbody tr.on td { background: color-mix(in srgb, var(--ac) 9%, var(--pn)); }
table.dsl tbody tr.on td:first-child { box-shadow: inset -3px 0 0 var(--ac); }
table.dsl tr.on .dsl-link { color: var(--ac); font-weight: 700; }
@media (hover: none) { table.dsl .lk { opacity: 1; } }
.dsl-add { margin-top: 8px; }
.dsl-add select { width: auto; min-width: 200px; max-width: 100%; }
.tabs button {
  padding: 7px 18px;
}
.chk {
  font-size: 12px;
  margin-top: 4px;
}
.chk.er {
  color: #b3261e;
}
.chk.ok {
  color: #1f7a4d;
}
.chk.wa {
  color: #8a6d00;
}
/* small red marker for analysis factors whose unit price is still zero */
.anwarn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #b3261e;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, transform 0.16s ease;
}
.anwarn:hover {
  color: #e14b40;
  animation: anwarnPulse 0.45s ease-in-out;
}
@keyframes anwarnPulse {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .anwarn:hover { animation: none; }
}
.anwarn.hide {
  display: none;
}
/* the 80% table action cell: the warning always reserves the same slot, so the
   delete/analysis icons line up whether or not a row has a warning */
#ib td.rowact {
  white-space: nowrap;
  text-align: center;
}
#ib td.rowact .zslot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  margin-inline-end: 4px;
  vertical-align: middle;
  font-size: 10.5px;
}
input.bad, textarea.bad {
  outline: 2px solid #b3261e;
  outline-offset: 1px;
}
.ro {
  padding: 5px 8px;
  border: 1px dashed var(--ln);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  min-height: 31px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ohsum.er {
  color: #b3261e;
}
input[type=checkbox] {
  width: auto;
}
#ancoef {
  z-index: 60;
}
.an-t {
  border-collapse: collapse;
  width: 100%;
}
.an-t th, .an-t td {
  border: 1px solid var(--ln);
  padding: 2px 4px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}
.an-t th {
  background: var(--pn);
  font-weight: 600;
  color: var(--ink);
}
.an-t td.t {
  text-align: right;
  white-space: normal;
}
.an-t td.n {
  direction: ltr;
  text-align: right;
}
.spec {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  font-size: 13px;
  margin-bottom: 2px;
}
.spec b {
  color: var(--mut);
  font-weight: 600;
}
.an-t td input {
  width: 100%;
  min-width: 70px;
  border-radius: 3px;
  padding: 3px 5px;
}
.an-t tfoot td {
  font-weight: 800;
  background: var(--pn);
}
.an-g {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  padding-top: 8px;
}
.an-res {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 170px;
  overflow: auto;
  border: 1px solid var(--ln);
  border-radius: 6px;
  padding: 4px;
  margin-top: 6px;
}
.an-res:empty {
  display: none;
}
.an-res button {
  text-align: right;
  font-size: 12px;
  padding: 3px 6px;
}
@media print {
  .md {
    display: none !important;
  }
}
select:focus {
  outline: 2px solid var(--ac);
  outline-offset: 1px;
}
.pill {
  display: inline-block;
  font-size: 11px;
  color: var(--mut);
  border: 1px solid var(--ln);
  border-radius: 999px;
  padding: 0 8px;
  margin-inline-start: 6px;
}
:root {
  --lk: #8a5a00;
  --lkb: #fff4d6;
}
@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --lk: #f0c36b;
    --lkb: #3a2f12;
  }
}
:root[data-theme="dark"] {
  --lk: #f0c36b;
  --lkb: #3a2f12;
}
input, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ln);
  border-radius: 6px;
  padding: 5px 8px;
  direction: ltr;
  text-align: right;
}
select {
  direction: rtl;
  width: auto;
}
input[type=checkbox], input[type=radio] {
  width: auto;
}
input:focus, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 1px;
}
.row {
  align-items: center;
}
.ed .tot {
  display: inline;
  min-width: 0;
  font-size: 13px;
  padding: 0;
  text-align: right;
}
.tot {
  text-align: right;
  min-width: 110px;
  padding: 2px 0;
}
.tot.neg {
  color: #b3261e;
}
span.bd.lk {
  background: var(--lkb);
  color: var(--lk);
  border-color: var(--lk);
}
.ib {
  border-top: 1px solid var(--ln);
  margin-top: 10px;
  padding-top: 10px;
}
.tbh {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tbh input {
  max-width: 260px;
}
.err {
  color: #b3261e;
  font-size: 12px;
}
.mt-t {
  border-collapse: collapse;
  width: 100%;
}
.mt-t th, .mt-t td {
  border: 1px solid var(--ln);
  padding: 2px 4px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}
.mt-t th {
  background: var(--pn);
  font-weight: 600;
  color: var(--ink);
}
.mt-t td input {
  width: 100%;
  min-width: 64px;
  border-radius: 3px;
  padding: 3px 5px;
}
.mt-t td.rl {
  color: var(--mut);
  direction: ltr;
}
.mt-t th input.thin {
  min-width: 80px;
  font-weight: 600;
  text-align: center;
  direction: rtl;
  padding: 2px 4px;
}
.mt-t td.qc {
  direction: ltr;
  font-weight: 600;
  min-width: 90px;
  text-align: right;
}
.mt-t td.qc.neg, .tot.neg {
  color: #b3261e;
}
.mt-t tfoot td {
  font-weight: 800;
  background: var(--pn);
}
.sel {
  width: auto;
  margin: 0 2px;
  align-self: center;
}
.mt-t td input[type=checkbox], .mt-t th input[type=checkbox] {
  width: auto;
  min-width: 0;
}
.mt-t [data-col] {
  position: relative;
}
.mt-t th.ch {
  vertical-align: top;
  min-width: 150px;
}
:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top,0px);
  padding-bottom: env(safe-area-inset-bottom,0px);
  --bg: #e9ecea;
  --pn: #fbfcfb;
  --ink: #1d2a26;
  --mut: #5d6c66;
  --ln: #cfd7d3;
  --ac: #0f6b57;
  --acx: #fff;
  color-scheme: light;
}
@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --bg: #111a17;
    --pn: #18231f;
    --ink: #e4ece8;
    --mut: #93a39c;
    --ln: #2d3b36;
    --ac: #4cc3a4;
    --acx: #0d1512;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111a17;
  --pn: #18231f;
  --ink: #e4ece8;
  --mut: #93a39c;
  --ln: #2d3b36;
  --ac: #4cc3a4;
  --acx: #0d1512;
  color-scheme: dark;
}
html {
  scroll-padding-top: env(safe-area-inset-top,0px);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.7 Vazirmatn,Tahoma,sans-serif;
}
.ui {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px;
}
#ui > * {
  animation: ui-in .20s ease-out both;
}
@keyframes ui-in {
  from { opacity: 0; transform: translateY(4px); }
}
.skel-page {
  display: grid;
  gap: 12px;
}
.skel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: linear-gradient(100deg, var(--pn) 30%, var(--bg2, var(--bg)) 50%, var(--pn) 70%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.2s ease-in-out infinite;
}
.skel::before, .skel::after {
  content: "";
  position: absolute;
  inset-inline-start: 14px;
  height: 8px;
  border-radius: 4px;
  background: var(--ln);
  opacity: .55;
}
.skel::before { top: 18px; width: 34%; }
.skel::after { top: 38px; width: 62%; }
.skel-row::before { width: 72%; }
.skel-row::after { width: 48%; }
.skel-head { height: 76px; }
.skel-row { height: 78px; }
@keyframes skel-shimmer {
  to { background-position: -200% 0; }
}
.box {
  background: var(--pn);
  border: 1px solid var(--ln);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.box h3 {
  font-size: 14px;
  margin: 0 0 10px;
  font-weight: 800;
}
.bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}
.hsum {
  display: flex;
  flex: 0 0 100%;
  flex-wrap: wrap;
  gap: 4px 22px;
  align-items: baseline;
  border-top: 1px solid var(--ln);
  padding-top: 8px;
  margin-top: 10px;
}
.hsum .it {
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.hsum .lb {
  font-size: 11px;
  color: var(--mut);
}
.hsum .vl {
  font-size: 14px;
  font-weight: 800;
  color: var(--ac);
  font-variant-numeric: tabular-nums;
}
h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 800;
}
.g {
  display: grid;
  grid-template-columns: repeat(12,1fr);
  gap: 10px 12px;
}
.c12 {
  grid-column: span 12;
}
.c6 {
  grid-column: span 6;
}
.c4 {
  grid-column: span 4;
}
.c3 {
  grid-column: span 3;
}
/* a select directly inside a grid cell fills the cell like the inputs beside it */
.g > div > select {
  width: 100%;
}
@media (max-width:760px) {
  .c6, .c4, .c3 {
    grid-column: span 12;
  }
}
label {
  display: block;
  font-size: 12px;
  color: var(--mut);
  margin-bottom: 2px;
}
.hint {
  font-size: 11px;
  color: var(--mut);
  margin-top: 2px;
}
input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ln);
  border-radius: 6px;
  padding: 5px 8px;
  direction: ltr;
  text-align: right;
}
input.fa {
  direction: rtl;
}
input.cb {
  width: auto;
}
input:focus, button:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 1px;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--ln);
  background: var(--pn);
  color: var(--ink);
  border-radius: 6px;
  padding: 5px 14px;
}
button.pr {
  background: var(--ac);
  color: var(--acx);
  border-color: var(--ac);
  font-weight: 600;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wrap {
  overflow-x: auto;
}
.ed {
  border-collapse: collapse;
  width: 100%;
}
.ed td, .ed th {
  padding: 3px 4px;
  border-bottom: 1px solid var(--ln);
  text-align: right;
  font-size: 12px;
  color: var(--mut);
  font-weight: 400;
  white-space: nowrap;
}
.ed td.k {
  color: var(--ink);
}
.ed td.n {
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.ed input {
  width: auto;
}
.w0 {
  width: 56px !important;
}
.w1 {
  width: 86px !important;
}
.w2 {
  width: 130px !important;
}
.w3 {
  width: 110px !important;
}
.w4 {
  width: 100% !important;
  min-width: 240px;
}
.pj {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.pj b {
  font-weight: 800;
}
.pj .m {
  font-size: 12px;
  color: var(--mut);
}
.hide {
  display: none !important;
}
.st-ok {
  color: #1f7a4d;
}
.st-wa {
  color: #8a6d00;
}
.st-er {
  color: #b3261e;
}
.sheet {
  background: #fff;
  color: #000;
  max-width: 800px;
  margin: 0 auto 16px;
  padding: 18px 22px;
  border: 1px solid var(--ln);
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
}
.sheet h2 {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 8px;
}
.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 24px;
  font-size: 11.5px;
  border-bottom: 1px solid #000;
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.meta .w {
  grid-column: span 2;
}
.sheet table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11.5px;
  margin-bottom: 8px;
}
.sheet th, .sheet td {
  border: 1px solid #000;
  padding: 2px 5px;
  text-align: center;
  line-height: 1.55;
}
.sheet th {
  background: #e6e6e6;
  font-weight: 600;
}
.sheet td.t {
  text-align: right;
}
.sheet td.n {
  direction: ltr;
  text-align: right;
}
.sheet tr {
  break-inside: avoid;
}
.sheet tr.gh td {
  background: #e6e6e6;
  font-weight: 600;
  text-align: right;
}
.sheet tr.tot td {
  font-weight: 800;
  background: #f0f0f0;
}
.note {
  font-size: 11px;
  margin: 4px 0 8px;
}
.sg {
  display: flex;
  justify-content: space-around;
  font-size: 11.5px;
  margin-top: 28px;
  gap: 8px;
}
.sg div {
  text-align: center;
  min-width: 120px;
}
select {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ln);
  border-radius: 6px;
  padding: 5px 8px;
}
button.sm {
  padding: 1px 8px;
  font-size: 12px;
}
/* Toolbar buttons of the row tables (sv/برآورد/صورتجلسه/پیشنهاد قیمت): the primary `.pr` button and
   the plain buttons beside it must be the same size. Colour/weight (the `.pr` emphasis) is the only
   difference. `.sm` and icon buttons keep their own smaller size. */
/* search box at the far left of a row toolbar */
.rowq {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
}
.rowq input {
  width: 220px;
  height: 32px;
  padding: 0 9px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ln);
  border-radius: 6px;
}
/* click-to-sort table headers */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable::after {
  content: '↕';
  margin-inline-start: 4px;
  font-size: 10px;
  color: var(--mut);
}
th.sortable.asc::after {
  content: '▲';
  color: var(--ac);
}
th.sortable.desc::after {
  content: '▼';
  color: var(--ac);
}
.row.tools > button:not(.sm):not(.ic) {
  height: 32px;
  min-width: 120px;
  justify-content: center;
  text-align: center;
  padding: 0 14px;
  font-size: 13px;
  line-height: 1;
  border-width: 1px;
  border-style: solid;
  border-radius: 6px;
}
/* «نوع آیتم» cell: a narrow select, the same height as the row inputs */
select.ty {
  width: 52px;
  padding: 2px 4px;
  font-size: 12px;
  text-align: center;
}
button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
input:disabled {
  opacity: .55;
}
.wn {
  color: #b3261e;
  font-weight: 800;
  cursor: help;
  margin-inline-start: 4px;
}
.wnl {
  color: #b3261e;
  font-size: 12px;
  font-weight: 600;
}
span.bd {
  display: inline-block;
  border: 1px solid var(--ln);
  border-radius: 10px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1.7;
  margin-inline-end: 4px;
  white-space: nowrap;
}
span.bd.wa {
  border-color: #8a6d00;
  color: #8a6d00;
}
span.bd.er {
  border-color: #b3261e;
  color: #b3261e;
}
.chips {
  display: inline-flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: center;
  vertical-align: middle;
}
.chip {
  border: 1px solid var(--ln);
  background: var(--bg);
  border-radius: 10px;
  padding: 0 7px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--ink);
}
.chip.st {
  border-color: #b3261e;
  color: #b3261e;
}
.xp {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin: 0;
}
.tot {
  font-size: 15px;
  font-weight: 800;
  color: var(--ac);
  direction: ltr;
  display: inline-block;
}
.mtb {
  border: 1px solid var(--ln);
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
  background: var(--bg);
}
.mtb h4 {
  margin: 0 0 6px;
  font-size: 13px;
}
.ed td.t {
  white-space: normal;
}
.md {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3vh 2vw;
}
.md.hide {
  display: none !important;
}
.mdb {
  background: var(--pn);
  color: var(--ink);
  border: 1px solid var(--ln);
  border-radius: 10px;
  width: min(1000px,100%);
  max-height: 94vh;
  overflow: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.mdh {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--pn);
  border-bottom: 1px solid var(--ln);
  padding: 10px 14px;
  display: flex;
  gap: 10px 16px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.mdt {
  display: flex;
  gap: 4px 12px;
  align-items: baseline;
  flex-wrap: wrap;
  flex: 1 1 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.mdh > .row {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-self: flex-start;
}
.mdc {
  padding: 12px 14px;
}
.mtb input:not([type=checkbox]):not([type=radio]), .mtb select {
  background: var(--pn);
}
.cm-err {
  color: #b3261e;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}
@property --mdk {
  syntax: '<number>';
  inherits: true;
  initial-value: 1;
}
.md, .rp {
  --mdk: 1;
  opacity: 1;
  transition: opacity .22s ease,--mdk .26s cubic-bezier(.2,.8,.2,1),display .26s allow-discrete;
}
.md.hide, .rp.hide {
  opacity: 0;
  --mdk: 0;
  pointer-events: none;
  transition-duration: .16s;
}
@starting-style {
  .md, .rp {
    opacity: 0;
    --mdk: 0;
  }
}
.mdb, .rpb {
  position: relative;
  top: calc((1 - var(--mdk)) * 16px);
}
.status {
  opacity: 1;
  translate: 0 0;
  transition: opacity .2s ease,translate .24s cubic-bezier(.2,.8,.2,1),display .24s allow-discrete;
}
.status:not(.on) {
  opacity: 0;
  translate: 0 12px;
  transition-duration: .15s;
}
@starting-style {
  .status.on {
    opacity: 0;
    translate: 0 12px;
  }
}
@supports selector(::details-content) {
  .bkt details {
    interpolate-size: allow-keywords;
  }
  .bkt details::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size .22s ease,content-visibility .22s allow-discrete;
  }
  .bkt details[open]::details-content {
    block-size: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .md, .rp, .status, .bkt details::details-content {
    transition: none !important;
  }
  .mdb, .rpb {
    top: 0;
  }
}

/* ---- cross-document navigation: keep the shell still, animate the page ---- */
@media (prefers-reduced-motion: reduce) {
  #ui > * {
    animation: none;
  }
  .skel {
    animation: none;
  }
}

/* ---- تعدیل (tadil.js): the adjustment continuation of one صورت وضعیت ----
   Everything is scoped to .tdpage (set on #ui by tadil.js) except the shared helpers at the end. */
.tdpage {
  --neg: #b3261e;
  --warn: #8a6d00;
  --okc: #1f7a4d;
  --inf: #3556a8;
  --soft: color-mix(in srgb, var(--ac) 7%, var(--pn));
  --wnt: color-mix(in srgb, var(--warn) 10%, var(--pn));
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* a wide table must scroll inside its box, not widen the page */
  gap: 12px;
  align-content: start;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tdpage { --neg: #ff9a90; --warn: #f0c36b; --okc: #5fd39b; --inf: #8fb0ff; }
}
:root[data-theme="dark"] .tdpage { --neg: #ff9a90; --warn: #f0c36b; --okc: #5fd39b; --inf: #8fb0ff; }

.tdpage > .box { margin: 0; padding: 16px; }
.tdpage > #banner:empty { display: none; }
.tdpage .box > h3, .tdpage .bar > h3 { margin: 0 0 12px; font-size: 15px; }
.tdpage .box > .bar { margin-bottom: 12px; }
.tdpage .bar > h3 { margin: 0; }
.tdpage .neg { color: var(--neg) !important; }
.tdpage .wnl { color: var(--neg); }
.tdpage span.bd.er { color: var(--neg); border-color: var(--neg); }
.tdpage span.bd.wa { color: var(--warn); border-color: var(--warn); }
.tdpage .lb { font-size: 12px; color: var(--mut); }

/* buttons share one height; small ones keep their own */
.tdpage button { min-height: 32px; }
.tdpage button.sm { min-height: 24px; }
.tdpage button.on { background: var(--ac); color: var(--acx); border-color: var(--ac); }
.tdpage .g select, .tdpage .tdfl select { width: 100%; }

/* ---- header: title + actions, then three summary tiles ---- */
.tdhead { align-items: flex-start; }
.tdacts { margin-inline-start: auto; align-items: center; flex-wrap: wrap; }
.tdghost { background: transparent; color: var(--mut); }
.tdghost:hover, .tdghost:focus-visible { color: var(--neg); border-color: var(--neg); }
.tdkpi {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.tdk {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: var(--bg);
}
.tdk .vl { display: block; font-size: 17px; font-weight: 800; line-height: 1.5; color: var(--ink); font-variant-numeric: tabular-nums; }
.tdk .hint { margin: 0; }
.tdk.main { border-color: var(--ac); background: var(--soft); }
.tdk.main .vl { font-size: 22px; color: var(--ac); }

/* ---- settings: grouped fields ---- */
.tdgrp + .tdgrp { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ln); }
.tdgt { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--mut); }
.tdpair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tdlink { margin-top: 4px; color: var(--ac); background: none; border-color: transparent; padding-inline: 2px; }
.tdlink:hover { text-decoration: underline; }
.tdpage .chips { gap: 6px; }
.tdpage .chip { padding: 1px 10px; font-size: 12px; border-radius: 999px; }
.tdpage .chip.st { color: var(--neg); border-color: var(--neg); }
.tdpage .box.banner {
  border-color: var(--warn);
  border-inline-start-width: 4px;
  background: var(--wnt);
  font-size: 12.5px;
  line-height: 1.9;
}

/* ---- tables ---- */
.tdpage .tdt { border-collapse: separate; border-spacing: 0; width: 100%; }
.tdpage .tdt th, .tdpage .tdt td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--ln);
  font-size: 12.5px;
  vertical-align: middle;
  white-space: nowrap;
}
.tdpage .tdt thead th {
  background: var(--bg);
  color: var(--mut);
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
}
.tdpage .tdt thead .hint { font-size: 11px; font-weight: 400; margin: 0; }
.tdpage .tdt td.n, .tdpage .tdt td.k { color: var(--ink); }
.tdpage .tdt td.n { font-variant-numeric: tabular-nums; }
.tdpage .tdt td.t { white-space: normal; min-width: 140px; }
.tdpage .tdt tbody tr:last-child > td { border-bottom: 0; }
.tdpage .tdt tbody tr:hover > td { background: var(--soft); }
/* the global `.tot` (inline-block money figure) must not turn a total row into a box */
.tdpage .tdt tr.tot { display: table-row; direction: rtl; min-width: 0; padding: 0; font-size: inherit; color: inherit; text-align: inherit; }
.tdpage .tdt tr.tot > td { border-top: 2px solid var(--ln); font-weight: 800; }
.tdpage .tdt tr.bad > td { background: color-mix(in srgb, var(--neg) 8%, var(--pn)); }
.tdpage .tdt .qs { border-inline-start: 1px solid var(--ln); }
.tdpage .tdt .dl { background: var(--wnt); }
.tdpage .tdt thead th.dl { background: color-mix(in srgb, var(--warn) 14%, var(--bg)); }
.tdpage .tdt td.tdtotal { font-weight: 800; }
.tdempty { padding: 14px 8px !important; text-align: center; color: var(--mut); font-size: 12.5px; white-space: normal !important; }
div.tdempty { padding: 4px 0 !important; text-align: start; }
.tdgap { margin-top: 12px; }
.tdbadges { margin-top: 10px; }
.tdnote { margin-top: 10px; font-size: 12px; color: var(--mut); line-height: 1.8; }

/* main line table: the first column stays in view while scrolling sideways */
.tdpage .wrap { border: 1px solid var(--ln); border-radius: 8px; background: var(--pn); }
.tdt.tadil-lines th.ch, .tdt.tadil-lines td.ch {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--pn);
  border-inline-end: 1px solid var(--ln);
  width: 1%;
  min-width: 0;
  max-width: none;
  white-space: nowrap;
  font-weight: 600;
  line-height: 1.7;
}
.tdt.tadil-lines thead th.ch { background: var(--bg); z-index: 2; }
.tdpage .tdt.tadil-lines tbody tr:hover > td.ch { background: var(--soft); }
.tdnew { margin-top: 6px; display: grid; gap: 2px; font-weight: 400; }
.tdnew label { margin: 0; font-size: 11px; }

/* editable cells + the “back to computed value” button */
.tdt .tdin { width: 92px; padding: 3px 6px; font-size: 12px; border-radius: 5px; }
.tdt.tadil-lines input[data-ovf="AD"], .tdt.tadil-lines input[data-ovf="AG"] { width: 124px; }
.tdt.tadil-lines input[data-ovf="M"], .tdt.tadil-lines input[data-ovf="I"] { width: 84px; }
.tdt.tadil-lines select.tdin { width: 100%; }
.ovc { display: inline-flex; align-items: center; gap: 3px; }
.ovc .ovx { min-width: 24px; padding: 0 5px; line-height: 1; color: var(--lk); background: var(--lkb); border-color: var(--lk); }
.ovc:has(.ovx:not(.hide)) .tdin { color: var(--lk); background: var(--lkb); border-color: var(--lk); }

/* section header: title on one side, section total as a pill on the other */
.tdsectot {
  align-items: baseline;
  gap: 8px;
  padding: 3px 14px;
  border: 1px solid var(--ln);
  border-radius: 999px;
  background: var(--bg);
}
.tdsectot b { font-size: 14px; font-weight: 800; color: var(--ac); font-variant-numeric: tabular-nums; }
.tdsum { max-width: 760px; }
.tdsum td.k { width: 70%; white-space: normal; }
.tdsum td.n { font-weight: 700; }
.tdsum tr.tot > td { background: var(--soft); }

/* ---- indices panel ---- */
.tdind { margin-top: 16px; padding: 14px; display: grid; gap: 12px; }
.tdind h4 { margin: 0; font-size: 13.5px; }
.tdindf { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.tdfl { display: grid; gap: 2px; min-width: 170px; }
.tdfl label { margin: 0; }
.tdindt { max-height: 340px; overflow: auto; }
.tdind .tdt thead th { position: sticky; top: 0; z-index: 1; }
.tdind .tdt td { padding: 4px 8px; }
.tdind .tdt td.c { text-align: center; }
.tdind .tdt tr.del > td { opacity: .5; text-decoration: line-through; }
.tdind .tdt input:not([type=checkbox]) { width: 130px; }
.tdind .tdt select.tdin { width: 120px; }
.tdind .tdt input[type=checkbox] { width: auto; accent-color: var(--ac); }
.tdindadd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--ln); }
.tdindadd input { width: 150px; }
.tdindfoot { justify-content: flex-start; }
.tdok { color: var(--okc); font-size: 12.5px; }

/* ---- checks list ---- */
/* «کنترل با بخشنامه‌ها» in تعدیل: one check per line (a separate class, because .chk is also the inline permission checkbox label) */
.tdchk { display: block; list-style: none; margin: 0; padding: 0; }
.tdchk li { padding: 7px 12px; margin: 0 0 6px; border-inline-start: 4px solid var(--mut); background: var(--bg); border-radius: 6px; font-size: 12.5px; line-height: 1.8; }
.tdchk li:last-child { margin-bottom: 0; }
.tdchk li b { margin-inline-end: 8px; }
.tdchk li.ok { border-color: var(--okc, #15803d); }
.tdchk li.ok b { color: var(--okc, #15803d); }
.tdchk li.warn { border-color: var(--warn, #b45309); }
.tdchk li.warn b { color: var(--warn, #b45309); }
.tdchk li.err { border-color: var(--neg, #b3261e); }
.tdchk li.err b { color: var(--neg, #b3261e); }
.tdchk li.info { border-color: var(--inf, #3556a8); }
.tdchk li.info b { color: var(--inf, #3556a8); }
.cbline { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 12.5px; }

/* a negative adjustment is never hidden: it stays visible, in red, with a minus sign */
.neg { color: #b3261e !important; }

@media (max-width: 760px) {
  .tdkpi { grid-template-columns: 1fr; }
  .tdacts { margin-inline-start: 0; }
  .tdpage > .box { padding: 12px; }
  .tdt.tadil-lines th.ch, .tdt.tadil-lines td.ch { position: static; width: 1%; min-width: 0; max-width: none; }
  .tdt .tdin { width: 80px; }
  .tdind .tdt input:not([type=checkbox]) { width: 100px; }
}

/* ==== user system: login, profile, users & roles admin ==== */
.authbody {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.authwrap {
  width: 100%;
  max-width: 380px;
}
.authcard {
  background: var(--pn);
  border: 1px solid var(--ln);
  border-radius: 12px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .10);
}
.authcard h1 {
  font-size: 18px;
  margin: 2px 0 12px;
}
.authcard label {
  margin-top: 10px;
}
.authcard input {
  margin-bottom: 2px;
}
.authcard button.pr {
  margin-top: 16px;
  padding: 9px 14px;
  font-size: 14px;
}
.abrand {
  color: var(--ac);
  font-weight: 800;
  font-size: 15px;
}
.flashes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 0;
}
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--ln);
  border-inline-start-width: 4px;
  background: var(--pn);
  font-size: 13px;
  margin: 0 0 4px;
}
.flash.danger {
  border-inline-start-color: #c0392b;
}
.flash.success {
  border-inline-start-color: #1f7a4d;
}
.flash.warning {
  border-inline-start-color: #b58900;
}
.flash.info {
  border-inline-start-color: var(--ac);
}
.flash .fx {
  background: none;
  border: 0;
  padding: 0 4px;
  font-size: 17px;
  line-height: 1;
  color: var(--mut);
  cursor: pointer;
}
.who {
  border-top: 1px solid var(--ln);
  margin-top: 10px;
  padding: 10px 6px 2px;
}
.wname {
  font-size: 13px;
  font-weight: 700;
}
.wrole {
  font-size: 11px;
  color: var(--mut);
  margin-top: 2px;
}
.wact {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
}
.wact a {
  color: var(--ac);
  text-decoration: none;
}
.wact a:hover {
  text-decoration: underline;
}
.wact form {
  margin: 0;
}
.lk {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--mut);
  cursor: pointer;
  text-decoration: underline;
}
.lk.danger {
  color: #c0392b;
}
.lk:disabled {
  opacity: .45;
  cursor: not-allowed;
  text-decoration: none;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
}
.card {
  background: var(--pn);
  border: 1px solid var(--ln);
  border-radius: 10px;
  padding: 16px;
}
.card h2 {
  font-size: 14px;
  margin: 0 0 10px;
  font-weight: 800;
}
.card p {
  margin: 0 0 8px;
}
.card label {
  margin-top: 8px;
}
.form .g {
  margin-bottom: 4px;
}
.formfoot {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}
a.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--ln);
  background: var(--pn);
  color: var(--ink);
  border-radius: 6px;
  padding: 5px 14px;
  text-decoration: none;
  font-size: 13px;
}
a.btn.pr {
  background: var(--ac);
  border-color: var(--ac);
  color: var(--acx);
  font-weight: 600;
}
.search {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search input {
  width: 240px;
  max-width: 60vw;
}
.admin-t {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin-top: 12px;
  background: var(--pn);
  border: 1px solid var(--ln);
  border-radius: 10px;
  overflow: hidden;
}
.admin-t th, .admin-t td {
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ln);
  font-size: 12.5px;
  vertical-align: middle;
}
.admin-t th {
  background: var(--bg);
  color: var(--mut);
  font-weight: 600;
  font-size: 11.5px;
  white-space: nowrap;
}
.admin-t tr:last-child td {
  border-bottom: 0;
}
.admin-t tbody tr:hover td {
  background: var(--bg);
}
.admin-t tr.off td {
  opacity: .55;
}
.admin-t td.acts {
  white-space: nowrap;
}
.admin-t td.acts form {
  display: inline-block;
  margin-inline-start: 10px;
}
.tag {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--ln);
  border-radius: 20px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--mut);
  margin-inline-end: 4px;
}
.tag.sys {
  border-color: var(--ac);
  color: var(--ac);
}
.ok {
  color: #1f7a4d;
}
.mut {
  color: var(--mut);
}
.mono {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: right;
  color: var(--mut);
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 6px 0 10px;
}
.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.chk input {
  width: auto;
  margin: 0;
}
.permgroup {
  border: 1px solid var(--ln);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 12px 0 0;
}
.permgroup legend {
  font-size: 12px;
  color: var(--mut);
  font-weight: 700;
  padding: 0 6px;
}
.permgroup .checks {
  margin: 0;
}
.permgroup code {
  font-size: 10.5px;
  color: var(--mut);
}

/* ==== user activity modal (user management) ==== */
.modal[hidden] {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-back {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 15, .45);
}
.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--pn);
  border: 1px solid var(--ln);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ln);
}
.modal-head h2 {
  font-size: 14px;
  margin: 0;
}
.modal-head .lk {
  font-size: 18px;
  text-decoration: none;
}
.modal-body {
  padding: 8px 16px 16px;
  overflow: auto;
}
.loglist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.logrow {
  display: grid;
  grid-template-columns: 118px 70px 90px 1fr;
  gap: 4px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ln);
  font-size: 12.5px;
  align-items: baseline;
}
.logrow:last-child {
  border-bottom: 0;
}
.lgt {
  color: var(--mut);
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
}
.lgtag {
  justify-self: start;
  border: 1px solid var(--ln);
  border-radius: 20px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--mut);
  white-space: nowrap;
}
.lgtag.ok {
  border-color: #1f7a4d;
  color: #1f7a4d;
}
.lgtag.bad {
  border-color: #c0392b;
  color: #c0392b;
}
.lgtag.upd {
  border-color: #b58900;
  color: #8a6d00;
}
.lgtag.in {
  border-color: var(--ac);
  color: var(--ac);
}
.lgent {
  color: var(--mut);
  font-size: 12px;
}
.lglabel {
  color: var(--ink);
  font-weight: 600;
}
.lgdetail {
  grid-column: 4;
  color: var(--mut);
  font-size: 11.5px;
}
@media (max-width: 560px) {
  .logrow {
    grid-template-columns: 1fr 1fr;
  }
  .lgdetail {
    grid-column: 1 / -1;
  }
}

/* ===== admin: database backup page ===== */
.bk-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 14px; }
.bk-stat { flex: 1 1 130px; display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 11px 14px; background: var(--pn); border: 1px solid var(--ln); border-radius: 10px; }
.bk-stat .k { font-size: 11.5px; color: var(--mut); }
.bk-stat .v { font-size: 19px; font-weight: 800; line-height: 1.5; color: var(--ink); font-variant-numeric: tabular-nums; }
.bk-stat .s { font-size: 11px; color: var(--mut); }

.bk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; margin-bottom: 14px; }
@media (max-width: 860px) { .bk-grid { grid-template-columns: 1fr; } }
.bk-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bk-restore { margin-bottom: 14px; }
.bk-head h2 { margin: 0; }
.bk-sub { margin-top: 3px; font-size: 12px; color: var(--mut); line-height: 1.7; }
.bk-sub code { font-size: 11px; }
.bk-card .hint { line-height: 1.7; margin-top: 10px; }

/* create */
.bk-full { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--ac) 40%, var(--ln)); background: color-mix(in srgb, var(--ac) 7%, var(--pn)); border-radius: 8px; }
.bk-opts { border: 1px solid var(--ln); border-radius: 8px; overflow: hidden; }
.bk-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.bk-opt + .bk-opt { border-top: 1px solid var(--ln); }
.bk-full b, .bk-opt b { display: block; font-size: 13px; color: var(--ink); }
.bk-full span, .bk-opt span { display: block; margin-top: 1px; font-size: 11.5px; color: var(--mut); }
.bk-full > div { flex: 1 1 200px; min-width: 0; }
.bk-full button, .bk-opt button { flex: none; }

/* restore forms */
.bk-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.bk-fields .wide, .bk-fields .bk-t { grid-column: 1 / -1; }
.bk-form:has(select[name="target"] option[value="workspace"]:checked) .bk-fields .bk-t { grid-column: auto; }
.bk-fields label, .bk-row label { margin: 0 0 3px; }
.bk-fields select, .bk-row select { width: 100%; }
.bk-fields input[type=file] { padding: 9px; background: var(--bg); border: 1px dashed var(--ln); border-radius: 8px; }
.bk-fields input[type=file]::file-selector-button { margin-inline-end: 10px; padding: 4px 12px; font: inherit; color: var(--ink); background: var(--pn); border: 1px solid var(--ln); border-radius: 6px; cursor: pointer; }
.bk-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.bk-row .f2 { flex: 2 1 260px; min-width: 0; }
.bk-row .f1 { flex: 1 1 180px; min-width: 0; }
.bk-row > button { flex: none; }
/* the target user only matters when the destination is a workspace */
.bk-user { display: none; }
.bk-form:has(select[name="target"] option[value="workspace"]:checked) .bk-user { display: block; }
@supports not selector(:has(*)) { .bk-user { display: block; } }

/* backup files */
.bk-files { padding: 0; gap: 0; overflow: hidden; }
.bk-files .bk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; }
.bk-count { display: inline-block; margin-inline-start: 6px; padding: 0 8px; font-size: 11px; font-weight: 600; color: var(--mut); background: var(--bg); border: 1px solid var(--ln); border-radius: 999px; font-variant-numeric: tabular-nums; }
.bk-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.bk-bulk:not(:disabled) { color: #b3261e; border-color: #b3261e; }
.bk-bulk:not(:disabled):hover { background: color-mix(in srgb, #b3261e 8%, var(--pn)); }
.bk-files .admin-t { margin: 0; border: 0; border-top: 1px solid var(--ln); border-radius: 0; min-width: 680px; }
.bk-files td.mono { white-space: nowrap; }
.bk-files .admin-t th:first-child, .bk-files .admin-t td:first-child { width: 34px; padding-inline-end: 0; }
.bk-files tbody tr:has([data-bk]:checked) td { background: color-mix(in srgb, var(--ac) 8%, var(--pn)); }
.bk-name b { display: block; font-weight: 600; color: var(--ink); }
.bk-name .mono { margin-top: 1px; font-size: 11px; }
.bk-files td.acts { text-align: left; }
.bk-files td.acts form { margin-inline-start: 6px; }
.bk-files .bk-act { display: inline-block; padding: 2px 10px; font: inherit; font-size: 12px; line-height: 1.6; color: var(--ink); text-decoration: none; background: var(--pn); border: 1px solid var(--ln); border-radius: 6px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.bk-files .bk-act:hover { color: var(--ac); border-color: var(--ac); text-decoration: none; }
.bk-files .bk-act.danger { color: #c0392b; }
.bk-files .bk-act.danger:hover { color: #c0392b; border-color: #c0392b; background: color-mix(in srgb, #c0392b 8%, var(--pn)); }
.admin-t td.bk-empty { padding: 28px 10px; text-align: center; color: var(--mut); }

/* ==== page help: the «؟» button and the wiki panel ==== */
.phead {
  position: relative;
}
/* server-rendered headers put the button directly in .phead: absolute, top-left */
.phead:has(> .helpbtn) {
  padding-inline-end: 34px;
}
/* JS headers put it inside .ptitle so it sits on the project/title row */
.ptitle .helpbtn {
  position: static;
  top: auto;
  inset-inline-end: auto;
  flex: 0 0 auto;
}
.helpbtn {
  position: absolute;
  top: 2px;
  inset-inline-end: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--ln);
  border-radius: 50%;
  background: var(--pn);
  color: var(--mut);
  font: 700 13px/1 Vazirmatn, inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.helpbtn:hover,
.helpbtn:focus-visible {
  color: var(--ac);
  border-color: var(--ac);
}
.helpbox {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(8, 16, 13, .55);
}
.helpbox[hidden] {
  display: none;
}
.helpwin {
  display: flex;
  flex-direction: column;
  width: min(1080px, 100%);
  height: min(90vh, 920px);
  background: var(--pn);
  border: 1px solid var(--ln);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
.helpbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--ln);
  font-size: 13px;
}
.helpbar .row {
  gap: 10px;
  align-items: center;
}
.helptab {
  color: var(--ac);
  text-decoration: none;
  font-size: 12.5px;
}
.helptab:hover {
  text-decoration: underline;
}
.helpclose {
  width: 28px;
  height: 28px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.helpclose:hover,
.helpclose:focus-visible {
  border-color: var(--ac);
  color: var(--ac);
}
.helpframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}
.authhelp {
  position: fixed;
  top: 16px;
  inset-inline-start: 16px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ln);
  border-radius: 50%;
  background: var(--pn);
  color: var(--mut);
  font: 700 14px/1 Vazirmatn, inherit;
  text-decoration: none;
  z-index: 5;
}
.authhelp:hover,
.authhelp:focus-visible {
  color: var(--ac);
  border-color: var(--ac);
}
/* ---- loading overlay: static/js/loader.js (system interface) ---- */
.ld {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(120, 140, 255, calc(var(--en, 0) * .005)), #06080c);
  color: #9fb6ff;
  font-family: Vazirmatn, Tahoma, sans-serif;
  animation: ld-in .18s ease-out;
}
.ld[hidden] { display: none; }
@keyframes ld-in { from { opacity: 0; } }
/* drifting grid + pointer parallax (the wrapper carries the offset, the layer keeps drifting) */
.ld-gw {
  position: absolute;
  inset: -60px;
  transition: transform .25s ease-out;
  pointer-events: none;
}
.ld-g {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(120, 140, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 140, 255, .04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: ld-drift 20s linear infinite;
}
@keyframes ld-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 400px 400px, 400px 400px; }
}
.ld-hud {
  position: relative;
  display: grid;
  place-items: center;
  gap: 24px;
  padding: 18px;
  text-align: center;
}
.ld-core {
  position: relative;
  width: 160px;
  height: 160px;
  border: 2px solid rgba(160, 180, 255, .4);
  animation: ld-rot 12s linear infinite;
  transition: border-color .35s, box-shadow .35s;
}
.ld-core::before,
.ld-core::after {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(160, 180, 255, .3);
}
.ld-core::after { inset: 40px; }
@keyframes ld-rot { to { transform: rotate(360deg); } }
.ld.granted .ld-core {
  border-color: rgba(200, 215, 255, .85);
  box-shadow: 0 0 40px rgba(120, 140, 255, .4);
}
.ld.granted .ld-core::before,
.ld.granted .ld-core::after { border-color: rgba(200, 215, 255, .6); }
.ld-status {
  direction: ltr;
  font-size: 12px;
  letter-spacing: 1px;
  opacity: .6;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: opacity .25s;
}
.ld.granted .ld-status { opacity: .95; }
.ld-lb {
  max-width: min(78vw, 420px);
  margin-top: -4px;
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  color: #aebff0;
}
@media (prefers-reduced-motion: reduce) {
  .ld { animation: none; }
  .ld-gw { transition: none; }
  .ld-g { animation: none; }
  .ld-core { animation: none; }
  .ld-status { transition: none; }
}
@media print { .ld { display: none !important; } }

/* ---- مودال عوامل موثر (جدول ۲) ---- */
.fac-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.fac-tools input { max-width: 340px; }
.fac-tbl td.t { text-align: right; }
.fac-tbl input.facchg { border-color: var(--lk); background: var(--lkb); }
.fac-old { font-size: 11px; color: var(--mu, inherit); opacity: .75; white-space: nowrap; }
