:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --ink: #1b1e1c;
  --muted: #6b7268;
  --line: #dee1d8;
  --accent: #1f7a5c;
  --accent-soft: #e5f2ec;
  --warn: #b5720f;
  --warn-soft: #faf1de;
  --danger: #b23b3b;
  --danger-soft: #fbeaea;
  --mono: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 3px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
}

.brand {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.brand span { color: var(--accent); }

.top small { color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* ---------- Карточка / документ ---------- */
.doc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
}

.doc-head {
  padding: 22px 26px;
  border-bottom: 1px dashed var(--line);
}

.doc-head h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.doc-head .sub {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.doc-body { padding: 26px; }

/* ---------- Загрузка ---------- */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .big { font-size: 16px; margin-bottom: 6px; }
.dropzone .hint { color: var(--muted); font-size: 13px; }
.dropzone input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.opts {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}
.opts label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 22px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.actions { margin-top: 22px; }

.error-box {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
}

/* ---------- Ledger / spec sheet ---------- */
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger tr { border-bottom: 1px dotted var(--line); }
.ledger tr:last-child { border-bottom: none; }
.ledger td { padding: 9px 4px; vertical-align: top; }
.ledger td.k {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
  width: 220px;
  white-space: nowrap;
}
.ledger td.v { font-family: var(--mono); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.pill.ok { color: var(--accent); background: var(--accent-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--danger); background: var(--danger-soft); }

.links-list { margin: 0; padding-left: 18px; font-family: var(--mono); font-size: 13px; }
.links-list li { margin-bottom: 4px; word-break: break-all; }
.none-note { color: var(--muted); font-style: italic; }

/* ---------- Превью баннера ---------- */
.preview-frame-holder {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  padding: 0;
  margin-bottom: 8px;
}
.preview-frame-holder iframe { display: block; border: none; }

/* ---------- Штампы соответствия площадкам ---------- */
.stamps { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.stamp {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 190px;
  transform: rotate(-0.4deg);
}
.stamp:nth-child(even) { transform: rotate(0.5deg); }
.stamp .name { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.stamp .verdict {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 0;
}
.stamp.pass { border-color: var(--accent); }
.stamp.pass .verdict { color: var(--accent); }
.stamp.issue { border-color: var(--warn); }
.stamp.issue .verdict { color: var(--warn); }
.stamp ul { margin: 6px 0 0; padding-left: 16px; font-size: 12px; color: var(--muted); }

.section-title {
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 12.5px;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 30px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after { content: ''; flex: 1; border-bottom: 1px dashed var(--line); }

.share-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.share-row input {
  flex: 1;
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbf9;
}

.ttl-form { font-size: 13px; color: var(--muted); margin-top: 10px; }
.ttl-form select, .ttl-form button {
  font-family: var(--sans);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

footer.note {
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
