/* ════════════════════════════════════════════════════════════════
   blueprint.css — additive on top of dimensions.css
   ════════════════════════════════════════════════════════════════ */

.bp-page #app { max-width: 800px; }

/* ─── TOC ─────────────────────────────────────────────────────── */
.bp-toc {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #f0fdf4;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 8px 0;
  margin: -16px -16px 16px;
  padding-left: 16px;
  padding-right: 16px;
  border-bottom: 1px solid #bbf7d0;
}
.bp-toc a {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: .82rem;
  color: #166534;
  text-decoration: none;
  border-radius: 99px;
  background: #fff;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
}
.bp-toc a:hover { background: #dcfce7; }

/* ─── SECTION HEADERS ────────────────────────────────────────── */
.bp-section-block {
  margin-bottom: 30px;
}
.bp-sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #bbf7d0;
}
.bp-sec-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.bp-sec-head h2 {
  font-size: 1.2rem;
  color: #166534;
  margin: 0;
  text-align: left;
  border: none;
  padding: 0;
}
.bp-sec-lead {
  font-size: .9rem;
  color: #6b7280;
  margin-bottom: 14px;
  line-height: 1.6;
}

.bp-empty {
  color: #6b7280;
  font-style: italic;
  padding: 14px;
  text-align: center;
}

/* ─── ELEMENT PROFILE (sec 1) ─────────────────────────────────── */
#bp-element-section {
  border: 2px solid;
  text-align: center;
}
.bp-element-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.bp-element-head .el-badge {
  display: inline-block;
  background: rgba(255,255,255,0.7);
  padding: 4px 14px;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 10px;
}
.bp-element-emoji { font-size: 3rem; line-height: 1; margin-bottom: 6px; }
.bp-element-name { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; }
.bp-element-tagline { font-size: .92rem; color: #4b5563; font-style: italic; }
.bp-pct-bars {
  background: rgba(255,255,255,0.6);
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.bp-element-insight {
  background: rgba(255,255,255,0.65);
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  text-align: left;
}
.bp-element-insight h4 { text-align: left; color: #166534; margin-bottom: 6px; }
.bp-element-insight p { color: #374151; line-height: 1.7; margin: 0; }
#bp-element-section .traits-row { margin-bottom: 0; }
#bp-element-section .trait-card { background: rgba(255,255,255,0.7); }

/* ─── SYMPTOMS (sec 2) ────────────────────────────────────────── */
.bp-symptoms-lead {
  margin-bottom: 14px !important;
  color: #374151 !important;
  font-size: .92rem;
}
.bp-sym-group {
  background: #fff;
  border-radius: 10px;
  border-left: 4px solid #ca8a04;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.bp-sym-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}
.bp-sym-icon { font-size: 1.3rem; }
.bp-sym-name { font-weight: 700; color: #1f2937; flex: 1; }
.bp-sym-zone { font-size: .82rem; font-weight: 600; }
.bp-sym-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bp-sym-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: .9rem;
  color: #374151;
  border-top: 1px solid #f9fafb;
}
.bp-sym-list li:first-child { border: none; }
.bp-sym-text { flex: 1; line-height: 1.5; }
.bp-sym-score {
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
}
.sym-2 { background: #fef9c3; color: #854d0e; }
.sym-3 { background: #fee2e2; color: #991b1b; }

/* ─── DIM OVERVIEW (sec 3) ────────────────────────────────────── */
#bp-dim-overview { margin-top: 12px; }

/* ─── CAUSES (sec 4) ──────────────────────────────────────────── */
.bp-cause-dim {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
.bp-cause-dim summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  color: #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9fafb;
}
.bp-cause-dim[open] summary {
  border-bottom: 1px solid #e5e7eb;
  background: #f0fdf4;
  color: #166534;
}
.bp-cause-count {
  font-size: .82rem;
  color: #6b7280;
  background: #fff;
  padding: 2px 10px;
  border-radius: 99px;
  font-weight: 600;
}
.bp-cause-cat {
  padding: 12px 16px;
}
.bp-cause-cat h5 {
  font-size: .9rem;
  color: #374151;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e5e7eb;
  text-align: left;
}
.bp-cause-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bp-cause-list li { padding: 5px 0; }
.bp-cause-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .9rem;
  color: #374151;
  line-height: 1.5;
}
.bp-cause-list input[type="checkbox"] {
  margin-top: 4px;
  accent-color: #16a34a;
  cursor: pointer;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* ─── SOLUTIONS (sec 5) ──────────────────────────────────────── */
.bp-sol-dim {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid #e5e7eb;
  border-left-width: 4px;
  overflow: hidden;
}
.bp-sol-dim summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  color: #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fffbeb;
}
.bp-sol-dim[open] summary {
  border-bottom: 1px solid #fde68a;
}
.bp-sol-count {
  font-size: .82rem;
  color: #92400e;
  background: #fff;
  padding: 2px 10px;
  border-radius: 99px;
  font-weight: 700;
}
.bp-sol-cat {
  padding: 12px 16px;
  border-bottom: 1px dashed #f3f4f6;
}
.bp-sol-cat:last-child { border-bottom: none; }
.bp-sol-cat h5 {
  font-size: .9rem;
  color: #92400e;
  margin-bottom: 8px;
  text-align: left;
}
.bp-sol-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bp-sol-list li { padding: 6px 0; }
.bp-sol-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .9rem;
  color: #374151;
  line-height: 1.55;
  flex-wrap: wrap;
}
.bp-sol-list input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #ca8a04;
  cursor: pointer;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.bp-sol-text {
  flex: 1;
  min-width: 200px;
}
.bp-sol-meta {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}
.bp-sol-cad {
  font-size: 1rem;
  cursor: help;
}
.bp-sol-elem-tag {
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  background: #f3f4f6;
  color: #4b5563;
}
.bp-sol-elem-tag[data-el="ลม"] { background: #f0f9ff; color: #0369a1; }
.bp-sol-elem-tag[data-el="ไฟ"] { background: #fffbeb; color: #92400e; }
.bp-sol-elem-tag[data-el="น้ำ"] { background: #f0fdf4; color: #065f46; }
.bp-sol-elem-tag.general { background: #f3f4f6; color: #6b7280; }

/* ─── SUMMARY (sec 6) ─────────────────────────────────────────── */
.bp-summary-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 2px solid #16a34a;
}
.bp-sum-header {
  text-align: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #bbf7d0;
}
.bp-sum-meta {
  font-size: .82rem;
  color: #6b7280;
  margin-bottom: 8px;
}
.bp-sum-element {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
}
.bp-sum-emoji { font-size: 2.5rem; }
.bp-sum-elname {
  font-size: 1.3rem;
  font-weight: 800;
  color: #166534;
}
.bp-sum-tagline {
  font-size: .82rem;
  color: #4b5563;
  font-style: italic;
}
.bp-sum-balance {
  margin-left: auto;
  text-align: right;
}
.bp-sum-bal-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: #16a34a;
  line-height: 1;
}
.bp-sum-bal-lbl {
  font-size: .75rem;
  color: #6b7280;
  margin-top: 2px;
}

.bp-sum-block {
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.65);
  border-radius: 10px;
}
.bp-sum-block:last-child { margin-bottom: 0; }
.bp-sum-block h4 {
  text-align: left;
  color: #166534;
  font-size: 1rem;
  margin-bottom: 10px;
}
.bp-sum-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bp-sum-list li {
  padding: 6px 0;
  font-size: .9rem;
  color: #374151;
  line-height: 1.6;
  border-top: 1px solid #f0fdf4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.bp-sum-list li:first-child { border: none; }
.bp-sum-tag {
  display: inline-block;
  font-size: .72rem;
  padding: 2px 8px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 99px;
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.bp-sum-empty {
  text-align: center;
  color: #6b7280;
  font-style: italic;
}
.bp-sum-empty p { margin: 0; color: #6b7280; }

.bp-routine-section {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 8px;
}
.bp-routine-section:last-child { margin-bottom: 0; }
.bp-routine-section h5 {
  text-align: left;
  font-size: .92rem;
  color: #166534;
  margin-bottom: 8px;
  font-weight: 700;
}

.bp-download-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}
.bp-download-bar .btn {
  width: auto;
  flex: 1;
  min-width: 180px;
  margin-bottom: 0;
}
.bp-download-bar .line-button {
  flex: 1;
  min-width: 180px;
  text-align: center;
}

.bp-footer-note {
  text-align: center;
  color: #9ca3af;
  font-size: .82rem;
  margin: 24px 0 16px;
  line-height: 1.7;
}

/* ─── ONBOARDING (kept) ──────────────────────────────────────── */
.bp-onboard-card { padding: 28px 24px; }
.bp-onboard-card h2 {
  text-align: center;
  color: #166534;
  margin-bottom: 14px;
  font-size: 1.35rem;
}
.bp-onboard-lead {
  text-align: center;
  line-height: 1.85;
  color: #374151;
  margin-bottom: 24px;
  font-size: .95rem;
}
.bp-onboard-lead strong { color: #166534; }
.bp-onboard-flow h3 {
  text-align: center;
  color: #166534;
  font-size: 1.05rem;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid #bbf7d0;
}
.bp-step {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 2px solid #e5e7eb;
  transition: all .2s;
}
.bp-step.done { background: #f0fdf4; border-color: #86efac; }
.bp-step.pending { background: #fffbeb; border-color: #fcd34d; }
.bp-step.locked { background: #f9fafb; border-color: #e5e7eb; opacity: 0.65; }
.bp-step-num {
  flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: #16a34a; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.bp-step.pending .bp-step-num { background: #ca8a04; }
.bp-step.locked .bp-step-num { background: #9ca3af; }
.bp-step-body { flex: 1; }
.bp-step-title { font-weight: 700; color: #1f2937; font-size: 1rem; margin-bottom: 4px; }
.bp-step-desc { font-size: .88rem; color: #4b5563; line-height: 1.6; margin-bottom: 10px; }
.bp-step-time {
  display: inline-block;
  background: #f3f4f6;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: .78rem;
  color: #6b7280;
  margin-left: 4px;
}
.bp-step-status {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bp-step-cta {
  width: auto !important;
  padding: 10px 20px !important;
  margin: 0 !important;
  font-size: .9rem !important;
}
.bp-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 700;
}
.bp-status-badge.done { background: #16a34a; color: #fff; }
.bp-status-badge.locked { background: #d1d5db; color: #4b5563; }
.bp-status-detail { font-size: .88rem; color: #374151; }
.bp-status-detail strong { color: #166534; }
.bp-status-redo {
  font-size: .82rem;
  color: #6b7280;
  text-decoration: underline;
  margin-left: auto;
}

/* ─── PRINT-FRIENDLY ──────────────────────────────────────────── */
@media print {
  body { background: white; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #app { max-width: 100%; padding: 0; }
  .no-print { display: none !important; }
  .bp-toc, .bp-download-bar { display: none !important; }
  .card, .blueprint-card, .dim-result-card, .bp-summary-card,
  .bp-cause-dim, .bp-sol-dim, .bp-sym-group {
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  details { display: block; }
  details > summary { display: none; }
  details > *:not(summary) { display: block !important; }
}

/* ─── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .bp-toc { font-size: .76rem; }
  .bp-toc a { padding: 5px 10px; }
  .bp-sum-element { flex-wrap: wrap; }
  .bp-sum-balance { margin-left: 0; width: 100%; text-align: center; }
  .bp-download-bar { flex-direction: column; }
  .bp-download-bar .btn, .bp-download-bar .line-button { width: 100%; min-width: 0; }
  .bp-element-name { font-size: 1.4rem; }
  .bp-element-emoji { font-size: 2.4rem; }
}
