/* ============================================================
   RTF TO PDF — RTF doc → PDF doc transformation
   ============================================================ */
.r2p {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
}
.r2p-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  color: #0a2540;
  overflow: hidden;
  font-family: var(--font-mono);
  box-shadow:
    0 1px 0 rgba(10, 37, 64, 0.04),
    0 18px 36px -22px rgba(10, 37, 64, 0.3);
}
[data-theme="dark"] .r2p-card { background: #f4f7fb; }
.r2p-head, .r2p-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: rgba(10, 37, 64, 0.6);
}
.r2p-head { border-bottom: 1px dashed rgba(10, 37, 64, 0.18); }
.r2p-foot { border-top: 1px dashed rgba(10, 37, 64, 0.18); }
.r2p-tag {
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
}
.r2p-tag.rtf { background: rgba(180, 83, 9, 0.12); color: #b45309; }
.r2p-tag.pdf { background: var(--accent); color: white; }
.r2p-file { font-size: 10px; color: rgba(10, 37, 64, 0.6); }
.r2p-body {
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 220px;
  font-family: "Times New Roman", "Times", serif;
}
.r2p-h {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 2px;
  color: #0a2540;
}
.r2p-line {
  display: block;
  height: 3px;
  background: rgba(10, 37, 64, 0.2);
  border-radius: 1px;
}
.r2p-line.w90 { width: 90%; }
.r2p-line.w82 { width: 82%; }
.r2p-line.w76 { width: 76%; }
.r2p-line.w64 { width: 64%; }
.r2p-line.w55 { width: 55%; }
.r2p-line.bold { background: rgba(10, 37, 64, 0.45); height: 4px; }
.r2p-line.italic { background: rgba(11, 102, 194, 0.4); transform: skewX(-12deg); transform-origin: left; }
.r2p-tbl {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: rgba(10, 37, 64, 0.15);
  border: 1px solid rgba(10, 37, 64, 0.15);
  margin-top: 4px;
}
.r2p-tbl span {
  background: #fff;
  height: 14px;
  display: block;
}
[data-theme="dark"] .r2p-tbl span { background: #f4f7fb; }
.r2p-tbl span.h { background: rgba(11, 102, 194, 0.12); }
.r2p-flow {
  width: 44px;
  height: 100px;
  color: var(--accent);
  flex-shrink: 0;
}
.r2p-flow svg { width: 100%; height: 100%; display: block; }
.r2p-card.pdf-out {
  position: relative;
}
.r2p-card.pdf-out::before {
  content: "";
  position: absolute;
  inset: 0 0 0 0;
  background:
    linear-gradient(180deg, rgba(11, 102, 194, 0.03), transparent);
  pointer-events: none;
}
.r2p-ok {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 1000px) {
  .r2p { max-width: 380px; }
}
@media (max-width: 760px) {
  .r2p { grid-template-columns: 1fr; gap: 12px; }
  .r2p-flow { transform: rotate(90deg); height: 36px; width: 60px; margin: 0 auto; }
}
