@font-face {
  font-family: Golos;
  src: url("/assets/brand/GolosText.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f1f1ee;
  color: #202223;
  font:
    15px/1.5 Golos,
    Arial,
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
summary,
input,
textarea,
select {
  outline-offset: 3px;
}
:focus-visible {
  outline: 3px solid #a96500;
}
button,
summary,
select {
  cursor: pointer;
}
a {
  color: inherit;
}
button {
  border: 1px solid #c7c9c3;
  border-radius: 6px;
  background: #fff;
  color: #202223;
  padding: 9px 14px;
  min-height: 42px;
}
button:hover {
  background: #edece4;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 5px;
  background: white;
  z-index: 3;
}
header {
  background: #212324;
  color: #ecece6;
}
.bar,
main {
  max-width: 1480px;
  margin: auto;
  padding-inline: clamp(16px, 4vw, 72px);
}
.bar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
}
.bar img {
  display: block;
}
.bar-line {
  border-left: 1px solid #5a5b56;
  height: 23px;
}
.services {
  margin-left: auto;
  text-decoration: none;
}
.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 38px 0 27px;
}
.hero p,
.bottom p {
  margin: 6px 0;
  color: #525650;
}
.hero .eyebrow,
.eyebrow {
  font: 700 11px/1.5 monospace;
  letter-spacing: 1.4px;
  color: #323632;
}
.eyebrow i {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #f5c935;
  margin-right: 5px;
}
.hero h1 {
  font-size: clamp(29px, 3.55vw, 56px);
  letter-spacing: -0.052em;
  line-height: 1.08;
  margin: 10px 0;
}
.private,
#saved {
  font-size: 12px;
  color: #4b524b;
}
nav {
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid #cacbc5;
  padding-bottom: 10px;
}
nav button {
  border: 0;
  background: transparent;
}
nav button[aria-pressed="true"] {
  background: #262829;
  color: white;
}
#saved {
  margin-left: auto;
  text-align: right;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 22px;
}
.workspace.single {
  grid-template-columns: minmax(0, 850px);
  justify-content: center;
}
body.full #editor {
  display: none;
}
details {
  background: #fff;
  border: 1px solid #d2d3cd;
  border-radius: 9px;
  margin-bottom: 10px;
  overflow: hidden;
}
summary {
  font-weight: 640;
  padding: 16px 19px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: "+";
  margin-left: auto;
  font-size: 22px;
  font-weight: 400;
}
details[open] > summary::after {
  content: "−";
}
details[open] > summary {
  border-bottom: 1px solid #e0e1da;
}
.fields,
.rowfields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 17px;
}
.wide {
  grid-column: 1/-1;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 550;
}
label input,
label textarea,
label select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 5px;
  background: #fbfbf9;
  color: #202223;
  border: 1px solid #bfc3ba;
  border-radius: 5px;
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 400;
}
textarea {
  resize: vertical;
  min-height: 70px;
}
input[aria-invalid="true"] {
  border-color: #ae3025;
}
.row {
  margin: 14px;
  border: 1px solid #d6d7d0;
  border-radius: 6px;
}
.rowhead {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: #f2f3ef;
  font-size: 13px;
}
.rowhead b {
  margin-right: auto;
}
.rowhead button {
  min-height: 32px;
  padding: 3px 8px;
}
.rowfields {
  gap: 10px;
  padding: 12px;
}
.rowfoot {
  padding: 0 12px 10px;
  font-size: 13px;
  text-align: right;
}
.add {
  margin: 0 14px 15px;
}
.hint,
.logo-status {
  font-size: 12px;
  color: #5d625a;
  margin: 0;
}
.logo-status img {
  max-width: 110px;
  max-height: 48px;
  vertical-align: middle;
}
aside {
  padding: 15px;
  background: #303332;
  border: 1px solid #303332;
  border-radius: 10px;
  min-width: 0;
}
.previewbar,
.actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.previewbar {
  color: #f2f3ec;
  font-size: 13px;
  margin: 0 2px 12px;
}
.previewbar b {
  font: 11px monospace;
  border: 1px solid #767a75;
  border-radius: 3px;
  padding: 2px 5px;
}
#paper {
  background: #fff;
  padding: clamp(15px, 2.5vw, 40px);
  min-height: 390px;
  overflow-wrap: anywhere;
  color: #242827;
  font-size: 12px;
}
#paper p {
  margin: 4px 0;
  white-space: pre-wrap;
}
#paper .mark {
  border-top: 5px solid #ebc73e;
  padding-top: 16px;
  color: #575d56;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 1.4px;
}
#paper h2 {
  font-size: clamp(20px, 2vw, 32px);
  line-height: 1.15;
  margin: 8px 0;
  letter-spacing: -0.04em;
}
.parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}
.cap {
  color: #62675e;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sheetlogo {
  display: block;
  max-width: 120px;
  max-height: 44px;
  margin-bottom: 10px;
}
.sheettable {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  margin: 14px 0;
}
.sheettable th,
.sheettable td {
  text-align: right;
  padding: 6px 2px;
  border-bottom: 1px solid #dedfd8;
}
.sheettable th {
  background: #eceee8;
  font-size: 10px;
}
.sheettable td:first-child,
.sheettable th:first-child {
  text-align: left;
  width: 43%;
}
.cost {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0;
}
.grand {
  background: #f5e7a1;
  padding: 9px;
  font-weight: 700;
}
.actions,
.actionbar {
  margin-top: 14px;
}
.actionbar button {
  flex: 1;
}
.primary {
  background: #f6cd3d;
  border-color: #f6cd3d;
  font-weight: 700;
}
.primary:hover {
  background: #ffdd61;
}
#feedback {
  color: #fff1ad;
  margin: 8px 0 0;
  font-size: 13px;
}
#feedback:empty {
  display: none;
}
.bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #cacbc5;
  margin: 28px 0;
  padding: 24px 0;
}
.bottom p {
  font-size: 13px;
}
.bottom a {
  font-size: 14px;
}
.bottom button {
  flex: none;
}
dialog {
  max-width: min(400px, 90vw);
  border: 0;
  border-radius: 9px;
  padding: 24px;
}
dialog::backdrop {
  background: #171b1988;
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  .workspace {
    display: block;
  }
  .hero {
    display: block;
    padding: 24px 0 18px;
  }
  .private {
    display: block;
    margin-top: 10px;
  }
  .workspace aside {
    margin-top: 12px;
  }
  .bottom {
    align-items: start;
    flex-direction: column;
  }
  .services {
    font-size: 12px;
  }
  .bar {
    gap: 9px;
    height: 52px;
  }
  .bar img {
    width: 85px;
  }
  .bar-line {
    height: 16px;
  }
}
@media (max-width: 440px) {
  main,
  .bar {
    padding-inline: 12px;
  }
  .fields,
  .rowfields {
    padding: 12px;
    gap: 9px;
  }
  #saved {
    font-size: 10px;
    max-width: 100px;
  }
  .actionbar {
    flex-wrap: wrap;
  }
  .actionbar button {
    font-size: 13px;
  }
  .bar {
    font-size: 11px;
  }
  .hero h1 {
    max-width: 340px;
  }
  aside {
    padding: 10px;
  }
  .sheettable {
    font-size: 10px;
  }
  .bottom {
    margin-top: 16px;
  }
  .sheettable th {
    font-size: 9px;
  }
}
.secondary {
  margin: 0;
  border: 0;
  border-top: 1px solid #dedfd7;
  border-radius: 0;
}
.secondary summary {
  font-size: 13px;
  padding: 12px 0 2px;
  color: #4c524c;
}
.secondary summary::after {
  font-size: 17px;
}
.secondary .fields {
  padding: 14px 0 0;
}
@media (min-width: 801px) {
  .hero {
    padding-top: 40px;
  }
  .workspace {
    gap: 22px;
  }
  .hero .private {
    white-space: nowrap;
  }
}
.draft-info {
  max-width: 280px;
}
.draft-info p {
  margin: 0 0 8px;
  font-size: 12px;
}
@page {
  size: A4;
  margin: 16mm;
  @bottom-right {
    content: counter(page) " / " counter(pages);
    font-size: 9pt;
  }
}
@media print {
  body,
  main,
  .workspace,
  .workspace.single,
  aside {
    display: block;
    margin: 0;
    padding: 0;
    background: white;
    border: 0;
    max-width: none;
  }
  header,
  .hero,
  nav,
  #editor,
  .previewbar,
  .actionbar,
  .bottom,
  #feedback,
  .skip,
  dialog {
    display: none !important;
  }
  #paper {
    padding: 0;
    font-size: 10pt;
    min-height: 0;
  }
  #paper::after {
    content: "Создано с помощью DALVIK · dalvikpro.ru";
    display: block;
    margin-top: 8mm;
    font-size: 8pt;
  }
  .sheettable tr,
  .cost {
    break-inside: avoid;
  }
  .sheettable thead {
    display: table-header-group;
  }
}
.catalog{margin:12px 14px;background:#fafbf8}
.catalog summary{padding:8px 12px;font-size:14px}
.catalog-controls{display:flex;flex-wrap:wrap;gap:8px;padding:12px}
.catalog-controls label{flex-basis:100%;min-width:0}
.catalog-controls select{max-width:100%}
.rowactions{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 12px 12px}
.rowactions button{font-size:13px;min-height:36px;padding:5px 10px}
.rowactions .rowfoot{padding:0}
.catalog-status:not(:empty){margin:8px 14px;font-size:13px;overflow-wrap:anywhere}
.catalog-status:empty{display:none}
.clear-catalog{display:flex;align-items:center;gap:8px;margin:12px 0}
.clear-catalog input{width:auto;margin:0}
.entry-feedback:not(:empty){display:block;margin:0 12px 10px;font-size:13px;color:#354d3f}
#excel-import{width:min(92vw,880px);max-width:100%;max-height:90dvh;overflow:auto}
#excel-import h2{margin:0 0 8px}#excel-import label{min-width:0}#excel-import .hint{margin:8px 0 14px}
.xl-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.xl-actions,.xl-check{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0}
.xl-check input{width:auto;margin:0}.xl-scroll{max-height:34vh;overflow:auto;border:1px solid #d5d8d2}
.xl-table{width:100%;border-collapse:collapse;font-size:13px;text-align:left}.xl-table td,.xl-table th{padding:6px;border-bottom:1px solid #dedfd8;overflow-wrap:anywhere}
.xl-table th{background:#e9ece6;position:sticky;top:0}.xl-table td:nth-child(3){min-width:110px}.xl-table td:last-child{min-width:100px}
@media(max-width:540px){#excel-import{width:96vw;padding:14px}.xl-fields{gap:6px}.xl-table td,.xl-table th{padding:4px}.xl-scroll{max-height:36vh}}
@media(max-width:540px){
  .xl-table,.xl-table tbody{display:block}
  .xl-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .xl-table tbody tr{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:baseline;gap:3px 8px;padding:8px 10px;border-bottom:1px solid #d5d8d2}
  .xl-table tbody td{min-width:0!important;padding:0;border:0}
  .xl-table td:first-child{grid-column:1;grid-row:1 / span 3;align-self:start}
  .xl-table td:nth-child(2){grid-column:3;grid-row:1;color:#545a54;font-size:11px}
  .xl-table td:nth-child(2)::before{content:"Стр. "}
  .xl-table td:nth-child(3){grid-column:2;grid-row:1;font-weight:650}
  .xl-table td:nth-child(4){grid-column:3;grid-row:2}
  .xl-table td:nth-child(5){grid-column:2;grid-row:2}
  .xl-table td:nth-child(5):not(:empty)::after{content:" ₽"}
  .xl-table td:last-child{grid-column:2 / -1;grid-row:3;color:#4e544d;font-size:12px}
}

.start{display:grid;gap:6px;justify-items:start}.start button{font-weight:600}
.backup summary{font-size:14px;padding:8px 10px}.backup p,.backup label,.backup button{margin:8px}
#editor:empty{min-height:100vh}.backup label{display:block}
@media(max-width:800px){.start{margin-top:12px}.start .private{margin:0}}
