.solution-export-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

@media (max-width: 960px) {
  .solution-export-grid {
    grid-template-columns: 1fr;
  }
}

.solution-export-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.solution-export-meta label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 11rem;
  flex: 1 1 15rem;
}

.solution-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.solution-export-actions button {
  cursor: pointer;
}

.solution-export-actions .primary {
  background: #0b57d0;
  border: 1px solid #0b57d0;
  color: #ffffff;
}

.solution-export-textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  min-height: 8rem;
}

#docHost {
  border: 1px dashed #d0d7de;
  min-height: 360px;
  background: #fafbfc;
  padding: 1rem;
  overflow: auto;
}

.solution-export-status {
  margin-top: 0.5rem;
}

#err {
  color: #b00020;
}

#ok {
  color: #0b8043;
}

#share {
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}

#stepsInfo {
  padding-left: 1.25rem;
}

/* Printable document */
.doc {
  --margin: 15mm;
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  color: #000000;
  margin: 0 auto;
  box-shadow: 0 0 0.5mm rgba(0, 0, 0, 0.1);
  padding: var(--margin);
  font-family: 'Noto Sans', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.doc.letter {
  width: 216mm;
  min-height: 279mm;
}

.doc.landscape {
  width: 297mm;
  min-height: 210mm;
}

.doc .header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0b57d0;
  padding-bottom: 4mm;
  margin-bottom: 4mm;
}

.doc .title {
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
  font-weight: 700;
}

.doc .meta {
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.doc .problem {
  padding: 0.6rem 0.8rem;
  border-left: 3px solid #0b57d0;
  background: #f6f8fa;
  margin: 0.75rem 0 1.25rem;
}

.doc .step {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0;
  padding: 0.4rem 0.6rem;
  border-left: 2px solid #0b57d0;
  break-inside: avoid-page;
  page-break-inside: avoid;
}

.doc .step .n {
  font-weight: 700;
  font-size: 14px;
}

.doc .step .txt {
  font-size: 14px;
  line-height: 1.5;
}

.doc .step .hint {
  padding: 0.35rem 0.5rem;
  border: 1px solid #f3d19c;
  background: #fff6e6;
  border-radius: 6px;
  font-size: 13px;
}

.doc .attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.doc .attachments img {
  max-width: 100%;
  border: 1px solid #d0d7de;
  padding: 0.2rem;
  background: #ffffff;
}

.doc .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #d0d7de;
  margin-top: 1rem;
  padding-top: 0.5rem;
  font-size: 12px;
  color: #555555;
}

.docid-mini {
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}

@media print {
  body {
    background: #ffffff;
  }

  header,
  footer,
  .lang-switch,
  .solution-export-actions,
  .solution-export-meta,
  .solution-export-status,
  .related-links,
  .ad-slot,
  #comments,
  .card:not(.solution-export-preview) {
    display: none !important;
  }

  #docHost {
    border: none;
    padding: 0;
    box-shadow: none;
  }

  .doc {
    box-shadow: none;
    margin: 0;
  }
}
