.paper-builder-page {
  padding: 28px 0 56px;
  background: linear-gradient(180deg, #f6f8ff 0%, #f8fafc 330px, #f3f4f6 100%);
}

.paper-builder-page .builder-hero {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dbeafe;
  border-radius: 28px;
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 26px;
  box-shadow: 0 24px 60px rgba(37, 99, 235, 0.08);
  position: relative;
  overflow: hidden;
}

.paper-builder-page .builder-hero::after {
  content: "";
  position: absolute;
  right: -140px;
  top: -160px;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.16), transparent 70%);
  pointer-events: none;
}

.paper-builder-page .eyebrow {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 14px;
}

.paper-builder-page .builder-hero h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.22;
  color: #111827;
}

.paper-builder-page .builder-hero h1 span {
  color: #2563eb;
}

.paper-builder-page .builder-hero p {
  margin: 15px 0 0;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.8;
  max-width: 720px;
}

.paper-builder-page .flow {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.paper-builder-page .flow-step {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.paper-builder-page .flow-step.active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.paper-builder-page .flow-step.done {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.paper-builder-page .flow-num {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 12px;
  color: #2563eb;
  background: #dbeafe;
  margin-bottom: 9px;
}

.paper-builder-page .flow-step.done .flow-num {
  color: #15803d;
  background: #bbf7d0;
}

.paper-builder-page .flow-title {
  font-size: 14px;
  font-weight: 900;
  color: #111827;
  margin-bottom: 5px;
}

.paper-builder-page .flow-desc {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}

.paper-builder-page .hero-side {
  position: relative;
  z-index: 1;
  background: #0f172a;
  color: #fff;
  border-radius: 22px;
  padding: 22px;
}

.paper-builder-page .hero-side h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.paper-builder-page .hero-side p {
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.7;
}

.paper-builder-page .mini-paper {
  margin-top: 16px;
  background: #fff;
  color: #111827;
  border-radius: 16px;
  padding: 16px;
}

.paper-builder-page .mini-title {
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 12px;
}

.paper-builder-page .mini-badge {
  height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.paper-builder-page .mini-line {
  height: 10px;
  background: #e5e7eb;
  border-radius: 99px;
  margin-bottom: 10px;
}

.paper-builder-page .mini-line.short {
  width: 70%;
}

.paper-builder-page .builder-layout {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.paper-builder-page .builder-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.paper-builder-page .panel-head {
  padding: 20px 22px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.paper-builder-page .panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #111827;
}

.paper-builder-page .panel-desc {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.paper-builder-page .panel-body {
  padding: 20px 22px 22px;
}

.paper-builder-page .source-card {
  margin-bottom: 18px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #f8fbff);
  border-radius: 22px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.paper-builder-page .source-kicker {
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
}

.paper-builder-page .source-title {
  color: #111827;
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 6px;
}

.paper-builder-page .source-desc {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.7;
}

.paper-builder-page .source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.paper-builder-page .tag {
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.paper-builder-page .tag.green {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.paper-builder-page .tag.orange {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.paper-builder-page .source-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paper-builder-page .btn-soft {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.paper-builder-page .btn-soft:hover {
  background: #dbeafe;
}

.paper-builder-page .btn-green {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.paper-builder-page .notice {
  margin-bottom: 18px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 800;
}

.paper-builder-page .notice-loading {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.paper-builder-page .notice-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.paper-builder-page .builder-card {
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #fff;
  padding: 18px;
}

.paper-builder-page .builder-card + .builder-card {
  margin-top: 16px;
}

.paper-builder-page .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 900;
  color: #111827;
  margin-bottom: 6px;
}

.paper-builder-page .section-num {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: #eff6ff;
  color: #2563eb;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
}

.paper-builder-page .help {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.paper-builder-page .form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.paper-builder-page .field label {
  display: block;
  color: #374151;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 7px;
}

.paper-builder-page .input,
.paper-builder-page select,
.paper-builder-page textarea {
  width: 100%;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size:14px;
  padding: 0 12px;
  color: #111827;
  background: #fff;
  outline: none;
  transition: 0.16s ease;
}

.paper-builder-page .input:focus,
.paper-builder-page select:focus,
.paper-builder-page textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
}

.paper-builder-page .title-row {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.paper-builder-page .rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.paper-builder-page .rule-card {
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 16px;
  padding: 13px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}

.paper-builder-page .rule-card input {
  margin-top: 2px;
  accent-color: #2563eb;
}

.paper-builder-page .rule-card b {
  display: block;
  font-size: 13px;
  color: #111827;
}

.paper-builder-page .rule-card small {
  display: block;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
}

.paper-builder-page .types-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.paper-builder-page .type-bank {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f8fafc;
  padding: 14px;
}

.paper-builder-page .type-bank h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #111827;
}

.paper-builder-page .type-chip {
  width: 100%;
  height: 36px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  margin-bottom: 9px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 800;
}

.paper-builder-page .type-chip.active,
.paper-builder-page .type-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #2563eb;
}

.paper-builder-page .structure-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.paper-builder-page .selected-types {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.paper-builder-page .type-item {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.paper-builder-page .type-head {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.paper-builder-page .drag {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #9ca3af;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.paper-builder-page .type-title-input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  font-weight: 900;
  color: #111827;
}

.paper-builder-page .type-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.paper-builder-page .tiny-btn {
  height: 28px;
  border-radius: 9px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  padding: 0 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.paper-builder-page .tiny-btn:hover {
  color: #2563eb;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.paper-builder-page .type-body {
  padding: 14px;
}

.paper-builder-page .inline-grid {
  display: grid;
  grid-template-columns: 120px 120px 140px;
  gap: 12px;
  align-items: end;
}

.paper-builder-page .empty-structure {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 28px;
  color: #64748b;
  text-align: center;
  background: #f8fafc;
}

.paper-builder-page .source-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.paper-builder-page .compare-card {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f8fafc;
  padding: 16px;
}

.paper-builder-page .compare-card h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #111827;
}

.paper-builder-page .compare-card ul {
  margin: 0;
  padding-left: 18px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.9;
}

.paper-builder-page .sidebar {
  position: sticky;
  top: 92px;
}

.paper-builder-page .summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px dashed #e5e7eb;
  color: #6b7280;
  font-size: 14px;
}

.paper-builder-page .summary-row strong {
  color: #111827;
  text-align: right;
}

.paper-builder-page .progress-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
}

.paper-builder-page .progress-title {
  display: flex;
  justify-content: space-between;
  color: #374151;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 10px;
}

.paper-builder-page .progress {
  height: 9px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
}

.paper-builder-page .progress span {
  display: block;
  width: 82%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #2563eb);
}

.paper-builder-page .side-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paper-builder-page .side-actions .base-btn {
  width: 100%;
  height: 42px;
}

.paper-builder-page .tip {
  margin-top: 16px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 16px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .paper-builder-page .builder-hero,
  .paper-builder-page .builder-layout {
    grid-template-columns: 1fr;
  }

  .paper-builder-page .sidebar {
    position: static;
  }

  .paper-builder-page .flow,
  .paper-builder-page .source-compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .paper-builder-page {
    padding: 18px 0 40px;
  }

  .paper-builder-page .builder-hero {
    padding: 22px;
  }

  .paper-builder-page .builder-hero h1 {
    font-size: 28px;
  }

  .paper-builder-page .flow,
  .paper-builder-page .source-card,
  .paper-builder-page .form-grid,
  .paper-builder-page .rule-grid,
  .paper-builder-page .types-layout,
  .paper-builder-page .inline-grid,
  .paper-builder-page .source-compare,
  .paper-builder-page .title-row {
    grid-template-columns: 1fr;
  }

  .paper-builder-page .source-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .paper-builder-page .type-head {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .paper-builder-page .type-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
