@font-face {
  font-family: Manrope;
  src: url("/Manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --frame: #1b1b1b;
  --shell: #f3f3f2;
  --bg: #fff;
  --fg: #171717;
  --mut: #5e5e65;
  --bd: #e5e5e7;
  --hv: #f4f4f6;
  --ac: #225aeb;
  --ach: #1744be;
  --violet: #a54df1;
  --lime: #b1ff0a;
  --red: #b32c4a;
  --display: Manrope, "Century Gothic", "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-padding-block: 20px 24px; }
body { margin: 0; background: var(--frame); color: var(--fg); font: 16px/1.5 var(--display); }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; }
button:disabled { opacity: .66; cursor: wait; }

.w { max-width: 1512px; margin: clamp(18px, 4vw, 58px) auto; padding-inline: clamp(14px, 4vw, 54px); }
.portal { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 14px; background: var(--shell); border: 1px solid #ffffff42; border-radius: 26px; padding: 13px; min-height: 78vh; }
.sidebar { padding: 13px 5px; }
.sidebar-inner { position: sticky; top: 24px; }
.brand { display: flex; align-items: center; gap: 9px; margin: 0 3px; font: 700 17px/1 var(--display); white-space: nowrap; letter-spacing: -.035em; }
.brand-mark { width: 33px; height: 33px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--fg); color: white; flex: none; }
.brand-mark::before { content: ""; width: 13px; height: 16px; border: 1.5px solid white; border-radius: 2px; background: linear-gradient(var(--lime),var(--lime)) 3px 5px / 5px 1.5px no-repeat, linear-gradient(white,white) 3px 9px / 6px 1px no-repeat; }
.tabs { display: grid; gap: 5px; margin-top: 26px; }
.tabs button { border: 0; background: transparent; color: #414145; text-align: left; min-height: 43px; padding: 8px 11px; font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.tabs button:hover { background: #e8e8e9; }
.tabs button.on, .tabs button.on:hover { background: var(--fg); color: white; }
.tab-icon { display: inline-grid; place-items: center; width: 18px; flex: none; font-size: 16px; line-height: 1; }
.tabs .on .tab-icon { color: var(--lime); }
.workspace { min-width: 0; }
.hero, .panel { background: var(--bg); border: 1px solid #ededee; border-radius: 21px; min-width: 0; }
.hero { padding: 21px 24px 23px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.hero h1 { margin: 0; font: 700 clamp(26px, 3.4vw, 44px)/1.08 var(--display); letter-spacing: -.055em; }
.hero p { margin: 7px 0 0; color: var(--mut); font-size: 14px; }
.hero-mark { display: flex; align-items: center; gap: 5px; flex: none; }
.hero-mark i { width: 11px; height: 34px; border-radius: 9px; background: var(--violet); transform: rotate(24deg); }
.hero-mark i:nth-child(2) { height: 28px; background: var(--ac); }
.hero-mark i:nth-child(3) { height: 22px; background: var(--lime); }
.workflow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, .34fr); gap: 10px; align-items: start; }
.editor-stack { display: grid; gap: 12px; min-width: 0; }
.workflow-tools { display: grid; gap: 8px; position: sticky; top: 12px; min-width: 0; }
.step-links h2 { font-size: 15px; margin-bottom: 6px; }
.step-links a { display: flex; align-items: center; gap: 8px; padding: 8px 0; color: var(--fg); text-decoration: none; font-size: 13px; font-weight: 700; }
.step-links a + a { border-top: 1px solid var(--bd); }
.step-links a:hover { color: var(--ac); }
.step-links a span { display: grid; place-items: center; min-width: 26px; height: 22px; border-radius: 999px; background: #efecfc; color: #5e2f99; font-size: 11px; }
.step-links a:nth-of-type(2) span { background: #ebefff; color: #1744be; }
.step-links a:nth-of-type(3) span { background: #eaffbf; color: #3a540c; }
.step-links a:nth-of-type(4) span { background: #eee; color: #28282b; }
.panel { padding: 18px 19px; }
.panel h2 { margin: 0 0 13px; font: 700 18px/1.25 var(--display); letter-spacing: -.025em; }
.panel h2:not(:first-child) { margin-top: 23px; }
.panel-title { display: flex; align-items: center; gap: 8px; }
.step-title { display: flex; align-items: center; gap: 9px; }
.step-number { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--fg); color: white; font-size: 11px; letter-spacing: 0; }
#step-details .step-number { background: var(--lime); color: #253202; }
#step-text .step-number { background: #efe2fb; color: #632b93; }
#step-goods .step-number { background: #e7edff; color: #1b48c1; }
.step-panel:target { border-color: #777cbe; }
.details-grid { display: grid; grid-template-columns: minmax(0,.58fr) minmax(0,.77fr) minmax(0,1.65fr); gap: 8px; }
.condition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 5px; font-size: 14px; font-weight: 800; }
.condition-grid fieldset, .presentation-options { padding: 10px 12px 12px; border: 1px solid #e9e9eb; border-radius: 12px; }
.condition-grid legend, .presentation-options legend { padding: 0 5px; }
.presentation-options #imgs { color: var(--mut); }
.stamp-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 14px; padding: 8px 0 5px; }
.stamp-controls[hidden], .stamp-unavailable[hidden] { display: none !important; }
.stamp-controls label { margin: 0 0 3px; }
.stamp-controls input[type="range"] { min-height: 26px; padding: 0; background: transparent; border: 0; accent-color: var(--ac); }
.stamp-controls output { display: block; min-height: 20px; font-size: 13px; color: var(--mut); }
.stamp-unavailable { margin: 3px 0 7px; color: var(--mut); font-size: 13px; }
@media (max-width: 450px) { .stamp-controls { grid-template-columns: minmax(0,1fr); } }
.goods-options { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.goods-options > div:first-child { width: 132px; }
.goods-options .ck label { white-space: nowrap; }
.goods-options #vatPct, #validityDays { width: 69px; }
.goods-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.goods-footer #sum { margin: 0; }
.panel-title::before { content: ""; width: 9px; height: 9px; background: var(--violet); border-radius: 50%; flex: none; }
.company-panel .panel-title::before { background: var(--lime); box-shadow: 0 0 0 1px #4052173b; }
.goods-panel .panel-title::before, .document-panel .panel-title::before { background: var(--ac); }
.co { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.co button { display: flex; align-items: center; gap: 7px; min-height: 49px; padding: 8px; border-radius: 11px; font-size: 12px; line-height: 1.22; text-align: left; overflow-wrap: anywhere; }
.co i { width: 12px; height: 12px; flex: none; border-radius: 50%; border: 1px solid #8a8a8a55; }
.co button.on { color: #1b2407; border-color: #719a2a; background: #e9ffbf; font-weight: 700; }
label { display: block; margin: 11px 0 5px; color: var(--mut); font-size: 13px; font-weight: 600; }
input:not([type="checkbox"]), select, textarea { display: block; min-width: 0; width: 100%; min-height: 38px; padding: 7px 9px; color: var(--fg); background: #fafafa; border: 1px solid var(--bd); border-radius: 9px; font-size: 14px; }
input:not([type="checkbox"]):focus, select:focus, textarea:focus { border-color: var(--ac); outline: 2px solid #225aeb26; }
input[type="file"] { font-size: 13px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ac); margin: 0; flex: none; }
textarea { min-height: 92px; resize: vertical; }
button { min-height: 35px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--bd); color: var(--fg); background: #fff; font-size: 14px; line-height: 1.25; }
button:hover { background: var(--hv); border-color: #d5d5da; }
button.p { background: var(--ac); border-color: var(--ac); color: #fff; font-weight: 650; }
button.p:hover { background: var(--ach); }
button.g { color: var(--mut); border-color: transparent; }
.r { display: flex; gap: 7px; align-items: flex-end; flex-wrap: wrap; }
.r > * { flex: 1; min-width: 105px; }
.r > button { flex: 0 0 auto; min-width: 0; }
.recipient-actions { align-items: center; }
.recipient-actions > * { min-width: 0; }
.recipient-actions select { flex: 1 0 100%; }
.recipient-actions button { font-size: 13px; }
.ck { display: flex; gap: 8px; align-items: center; padding: 5px 0; font-size: 14px; }
.ck label, label.ck { margin: 0; font-size: inherit; font-weight: 600; }
.it { border: 1px solid var(--bd); background: #fafafa; border-radius: 12px; padding: 8px 11px; margin: 8px 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(72px,.49fr); gap: 0 10px; }
.it .nm, .it .sm, .it .item-price { grid-column: 1/-1; }
.it label { margin-top: 4px; }
.it input:not([type="checkbox"]) { background: white; }
.it .sm { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; color: var(--mut); font-size: 14px; }
.callout { background: var(--hv); border-radius: 11px; padding: 9px 12px; color: var(--mut); font-size: 14px; margin: 10px 0 0; }
#sum { background: #efffcf; color: #334811; }
#sum b { color: #1a2507; font-variant-numeric: tabular-nums; }
.bar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 8px; gap: 6px; background: white; border: 1px solid var(--bd); border-radius: 17px; }
.bar button { flex: 1; min-height: 40px; }
.bar .preview-button { color: #fff; background: var(--fg); border-color: var(--fg); }
.bar .preview-button:hover { background: #36363a; }
.hi { padding: 11px 10px; border: 1px solid var(--bd); border-radius: 12px; margin-bottom: 7px; overflow-wrap: anywhere; }
.hi:hover { background: #fafafa; }
.hi small { display: block; color: var(--mut); font-size: 13px; }
.hi .r { margin-top: 8px; }
.hi .r > button { padding: 4px 9px; font-size: 13px; }
.history-filters { margin-bottom: 13px; }
.history-filters select { max-width: 245px; }
#gate { position: fixed; inset: 0; background: var(--frame); display: flex; align-items: center; justify-content: center; z-index: 99; padding: 20px; }
.sign-in { width: min(100%, 390px); background: white; border: 1px solid #ffffff50; border-radius: 23px; padding: 23px; box-shadow: 0 20px 60px #0003; }
.sign-in .brand { margin: 0 0 24px; }
.sign-in h2 { font: 700 24px/1.15 var(--display); margin: 0 0 14px; letter-spacing: -.03em; }
.sign-in button { width: 100%; margin-top: 11px; min-height: 40px; }
#ge { display: block; margin-top: 7px; color: var(--red); }
#ge:empty { display: none; }
.pvw { overflow: hidden; background: #e8e8e9; border: 1px solid #dedee2; border-radius: 17px; padding: 9px 0; margin-top: 12px; }

@media (min-width: 1050px) {
  .it { grid-template-columns: minmax(0,2fr) minmax(0,.64fr) minmax(0,.8fr) minmax(0,1fr); }
  .it .nm, .it .item-price { grid-column: auto; }
}

@media (max-width: 1130px) {
  .portal { grid-template-columns: 139px minmax(0,1fr); gap: 10px; }
  .workflow { grid-template-columns: minmax(0,1fr) minmax(186px,.29fr); }
  .details-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .details-grid .recipient { grid-column: 1/-1; }
  .co { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .panel { padding: 15px; }
}
@media (max-width: 840px) {
  .portal { grid-template-columns: minmax(0,1fr); padding: 10px; }
  .sidebar { padding: 4px; }
  .sidebar-inner { position: static; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .tabs { display: flex; margin: 0; gap: 3px; }
  .tabs button { min-height: 35px; padding: 6px 9px; }
  .hero { padding: 16px; }
}
@media (max-width: 620px) {
  .w { padding-inline: 8px; margin-block: 8px; }
  .portal { border-radius: 18px; }
  .workflow { display: flex; flex-direction: column; }
  .editor-stack, .workflow-tools { width: 100%; }
  .workflow-tools { position: static; order: -1; }
  .step-links { display: none; }
  .bar { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .condition-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
  .hero-mark { display: none; }
  .tabs { width: 100%; overflow: auto; }
  .tabs button { gap: 5px; font-size: 13px; white-space: nowrap; }
  .bar button { padding-inline: 6px; font-size: 12px; }
}
@media print {
  html { scroll-padding: 0; }
  body { background: white; }
  body > :not(#app), .sidebar, .workspace > :not(#t-new), #t-new > :not(#pv) { display: none !important; }
  .w, .portal, .workspace, #t-new { display: block !important; width: auto; max-width: none; min-height: 0; margin: 0; padding: 0; border: 0; background: white; }
}

#gate[hidden],#app[hidden]{display:none!important} #pdf-ready a{margin-right:1em}
