/* DX診断 – scoped styles (.dxs wrapper prevents conflicts with site CSS) */

.dxs {
  --dxp:   #1e40af;
  --dxp-l: #3b82f6;
  --dxw:   #d97706;
  --dxg:   #059669;
  --dxt:   #1e293b;
  --dxt-l: #64748b;
  --dxb:   #e2e8f0;
  background: #f1f5f9;
}

/* ── Layout ── */
.dxs .container {
  max-width: 760px;
  width: 92%;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

/* ── Typography overrides ── */
.dxs h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dxp);
  margin: 0 0 12px;
  line-height: 1.3;
}
.dxs h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--dxb);
}
.dxs h3 { font-size: 1.1rem; margin: 0 0 8px; }

/* ── Sub-header (prescription pages) ── */
.dxs-subheader {
  background: var(--dxp);
  color: white;
  padding: 14px 24px;
}
.dxs-subheader-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dxs-subheader .site-title { font-size: 1rem; font-weight: 700; }
.dxs-subheader .back-link {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: .85rem;
  white-space: nowrap;
}
.dxs-subheader .back-link:hover { color: white; }

/* ── Hero (prescription pages) ── */
.dxs .hero {
  background: white;
  border-radius: 16px;
  padding: 36px 32px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-top: 6px solid var(--dxp);
  border-bottom: none;
  border-left: none;
  border-right: none;
}
.dxs .hero h1 { font-size: 2rem; color: var(--dxp); }
.dxs .disease-badge {
  display: inline-block;
  background: #dbeafe;
  color: var(--dxp);
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--dxp-l);
  margin-bottom: 14px;
  letter-spacing: .05em;
}
.dxs .hero-lead { font-size: .95rem; color: var(--dxt-l); line-height: 1.8; }

/* ── Section cards ── */
.dxs .section {
  background: white;
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border: none;
}
.dxs .section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--dxb);
}
.dxs .section p { font-size: .93rem; line-height: 1.85; margin-bottom: 12px; }
.dxs .section p:last-child { margin-bottom: 0; }

.dxs .quote {
  color: var(--dxt-l);
  padding-left: 14px;
  border-left: 3px solid var(--dxb);
  margin-bottom: 8px !important;
}

/* ── Warning section ── */
.dxs .section.warning { background: #fff7ed; border: 1px solid #fed7aa; }
.dxs .section.warning h2 { color: #92400e; border-color: #fed7aa; }
.dxs .section.warning p  { color: #78350f; }
.dxs .section.warning strong { color: #7c2d12; }

/* ── Prescription section ── */
.dxs .section.rx { background: #f0fdf4; border: 1px solid #bbf7d0; }
.dxs .section.rx h2 { color: #065f46; border-color: #bbf7d0; }
.dxs .section.rx p  { color: #065f46; }

/* ── Point section (togo / ai-otameshi) ── */
.dxs .section.point { background: #faf5ff; border: 1px solid #d8b4fe; }
.dxs .section.point h2 { color: #6b21a8; border-color: #d8b4fe; }
.dxs .section.point p  { color: #581c87; }
.dxs .section.point strong { color: #4c1d95; }

/* ── Summary section ── */
.dxs .section.summary { background: var(--dxp); }
.dxs .section.summary h2 { color: white; border-color: rgba(255,255,255,.25); }
.dxs .section.summary p  { color: rgba(255,255,255,.9); }

/* ── Lists ── */
.dxs .check-list,
.dxs .arrow-list,
.dxs .bullet-list,
.dxs .flow-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  margin: 0;
}
.dxs .arrow-list { gap: 8px; }
.dxs .bullet-list { gap: 8px; margin: 12px 0; }
.dxs .flow-list { gap: 8px; margin: 12px 0; }

.dxs .check-list li,
.dxs .arrow-list li,
.dxs .bullet-list li,
.dxs .flow-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .93rem;
  line-height: 1.6;
  margin: 0;
}
.dxs .check-list li::before  { content: '✓'; color: var(--dxp); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.dxs .arrow-list li::before  { content: '→'; color: #065f46; font-weight: 700; flex-shrink: 0; }
.dxs .bullet-list li         { color: white; font-size: .95rem; font-weight: 700; }
.dxs .bullet-list li::before { content: '▶'; font-size: .65rem; opacity: .7; flex-shrink: 0; }
.dxs .flow-list li           { color: #581c87; }
.dxs .flow-list li::before   { content: '▸'; color: #7c3aed; font-weight: 700; flex-shrink: 0; }

/* ── Steps ── */
.dxs .steps { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.dxs .step  { display: flex; gap: 14px; align-items: flex-start; }
.dxs .step-num {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 50%;
  background: var(--dxp);
  color: white;
  font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}
.dxs .step-body { padding-top: 5px; font-size: .93rem; line-height: 1.65; }

/* ── Example box ── */
.dxs .example-box {
  background: #eff6ff;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}
.dxs .example-label {
  font-size: .78rem; font-weight: 700;
  color: var(--dxp-l); letter-spacing: .08em;
  margin-bottom: 6px;
}
.dxs .example-box p { color: var(--dxp) !important; font-size: .88rem !important; margin-bottom: 6px !important; }
.dxs .example-box p:last-child { margin-bottom: 0 !important; }

/* ── Point box ── */
.dxs .point-box {
  background: #ede9fe;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 14px;
  font-size: .9rem;
  color: #4c1d95;
  line-height: 1.75;
}

/* ── Code-like (tansu) ── */
.dxs .code-like {
  display: inline-block;
  background: #dbeafe;
  color: var(--dxp);
  font-family: monospace;
  font-size: .88rem;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── CTA card (prescription pages) ── */
.dxs .cta-card {
  background: white;
  border-radius: 16px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  margin-top: 24px;
}
.dxs .cta-card p {
  color: var(--dxt-l);
  font-size: .88rem;
  line-height: 1.75;
  margin-bottom: 20px;
}

/* ── Buttons ── */
.dxs .btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  text-align: center;
  transition: all .15s;
  box-shadow: none;
  background: var(--dxp);
  color: white;
}
.dxs .btn-primary       { background: var(--dxp); color: white; }
.dxs .btn-primary:hover { background: #1e3a8a; transform: translateY(-1px); }
.dxs .btn-cta           { background: #ea580c; color: white; }
.dxs .btn-cta:hover     { background: #c2410c; transform: translateY(-1px); }
.dxs .btn-large  { padding: 16px 48px; font-size: 1.05rem; }
.dxs .btn-block  { display: block; width: 100%; }
.dxs .btn:disabled,
.dxs .btn.disabled {
  background: #94a3b8 !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ══════════════════════════
   Quiz-specific styles
   ══════════════════════════ */

.dxs .screen        { display: none; }
.dxs .screen.active { display: block; }

/* Intro */
.dxs .intro-card {
  background: white;
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.dxs .intro-icon     { font-size: 3.5rem; margin-bottom: 16px; }
.dxs .intro-title    { font-size: 1.7rem; font-weight: 700; color: var(--dxp); margin-bottom: 12px; line-height: 1.4; }
.dxs .intro-subtitle { font-size: .95rem; color: var(--dxt-l); line-height: 1.8; margin-bottom: 24px; }
.dxs .intro-legend   {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
  background: #eff6ff; border-radius: 10px; padding: 16px; margin-bottom: 28px;
}
.dxs .legend-item  { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; }
.dxs .legend-mark  { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; }
.dxs .mark-maru    { background: #dbeafe; color: var(--dxp); }
.dxs .mark-sankaku { background: #fef3c7; color: var(--dxw); }
.dxs .mark-batsu   { background: #dcfce7; color: var(--dxg); }

/* Progress */
.dxs .progress-wrap    { margin-bottom: 24px; }
.dxs .progress-meta    { display: flex; justify-content: space-between; font-size: .8rem; color: var(--dxt-l); margin-bottom: 6px; }
.dxs .progress-bar-bg  { background: var(--dxb); border-radius: 999px; height: 8px; overflow: hidden; }
.dxs .progress-bar     { background: var(--dxp-l); height: 100%; border-radius: 999px; transition: width .3s ease; }

/* Question cards */
.dxs .question-card {
  background: white;
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border: 2px solid transparent;
  transition: border-color .2s;
}
.dxs .question-card.answered { border-color: var(--dxp-l); }
.dxs .q-label { font-size: .72rem; font-weight: 700; color: var(--dxp-l); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.dxs .q-text  { font-size: .97rem; line-height: 1.75; margin-bottom: 16px; font-weight: 500; color: var(--dxt); }

.dxs .answer-buttons { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.dxs .answer-btn {
  padding: 10px 4px;
  border: 2px solid var(--dxb);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  text-align: center;
}
.dxs .answer-btn:hover { border-color: #93c5fd; }
.dxs .answer-mark  { font-size: 1.3rem; font-weight: 700; display: block; line-height: 1.2; }
.dxs .answer-label { font-size: .7rem; color: var(--dxt-l); display: block; margin-top: 2px; }

.dxs .answer-btn.sel-maru    { background: #dbeafe; border-color: var(--dxp); }
.dxs .answer-btn.sel-maru .answer-mark,
.dxs .answer-btn.sel-maru .answer-label  { color: var(--dxp); font-weight: 600; }
.dxs .answer-btn.sel-sankaku { background: #fef3c7; border-color: var(--dxw); }
.dxs .answer-btn.sel-sankaku .answer-mark,
.dxs .answer-btn.sel-sankaku .answer-label { color: var(--dxw); font-weight: 600; }
.dxs .answer-btn.sel-batsu   { background: #dcfce7; border-color: var(--dxg); }
.dxs .answer-btn.sel-batsu .answer-mark,
.dxs .answer-btn.sel-batsu .answer-label  { color: var(--dxg); font-weight: 600; }

.dxs .submit-area { margin-top: 8px; }
.dxs .submit-hint { text-align: center; color: var(--dxt-l); font-size: .8rem; margin-top: 8px; }

/* Results */
.dxs .result-banner {
  border-radius: 16px; padding: 32px 28px;
  text-align: center; margin-bottom: 20px; color: white;
}
.dxs .result-banner.critical    { background: linear-gradient(135deg,#7f1d1d,#dc2626); }
.dxs .result-banner.warning     { background: linear-gradient(135deg,#78350f,#d97706); }
.dxs .result-banner.pre-critical{ background: linear-gradient(135deg,#1e3a5f,#2563eb); }
.dxs .result-banner.pre-warning { background: linear-gradient(135deg,#1e3a5f,#60a5fa); }
.dxs .result-banner.healthy     { background: linear-gradient(135deg,#064e3b,#059669); }

.dxs .banner-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .15em; opacity: .85; margin-bottom: 6px; }
.dxs .banner-name  { font-size: clamp(1.4rem,4vw,2rem); font-weight: 700; line-height: 1.3; margin-bottom: 8px; word-break: keep-all; }
.dxs .banner-sub   { font-size: .9rem; opacity: .9; }

.dxs .section-card  { background: white; border-radius: 12px; padding: 24px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.dxs .section-title { font-size: .85rem; font-weight: 700; color: var(--dxt-l); border-bottom: 1px solid var(--dxb); padding-bottom: 8px; margin-bottom: 16px; }

.dxs .disease-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--dxb); }
.dxs .disease-row:last-child { border-bottom: none; padding-bottom: 0; }
.dxs .d-badge    { flex-shrink: 0; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1.5px solid; }
.dxs .d-badge.positive  { background: #dbeafe; color: var(--dxp);  border-color: var(--dxp-l); }
.dxs .d-badge.pre-badge { background: #fef3c7; color: var(--dxw);  border-color: var(--dxw); }
.dxs .d-name { font-weight: 700; font-size: .97rem; margin-bottom: 3px; }
.dxs .d-desc { font-size: .82rem; color: var(--dxt-l); line-height: 1.6; }

.dxs .rx-link {
  flex-shrink: 0; align-self: center;
  font-size: .78rem; font-weight: 600; color: var(--dxp-l);
  text-decoration: none; white-space: nowrap;
  padding: 4px 10px; border: 1.5px solid var(--dxp-l); border-radius: 6px; transition: all .15s;
}
.dxs .rx-link:hover { background: #eff6ff; }

.dxs .rx-card  { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 22px 24px; margin-bottom: 16px; }
.dxs .rx-title { color: #065f46; font-size: .95rem; font-weight: 700; margin-bottom: 10px; }
.dxs .rx-body  { color: #047857; font-size: .88rem; line-height: 1.75; }

.dxs .retry-area { text-align: center; }
.dxs .retry-btn  { background: none; border: none; color: var(--dxt-l); cursor: pointer; font-size: .82rem; text-decoration: underline; font-family: inherit; }

/* ── togo page overrides ── */
.dxs.dxs-togo .hero                   { border-top-color: #dc2626; }
.dxs.dxs-togo .disease-badge          { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.dxs.dxs-togo h1                      { color: #dc2626; }
.dxs.dxs-togo .check-list li::before  { color: #dc2626; }
.dxs.dxs-togo .section.rx             { background: #fef2f2; border-color: #fecaca; }
.dxs.dxs-togo .section.rx h2          { color: #991b1b; border-color: #fecaca; }
.dxs.dxs-togo .section.rx p           { color: #7f1d1d; }
.dxs.dxs-togo .section.rx strong      { color: #7f1d1d; }
.dxs.dxs-togo .arrow-list li          { color: #7f1d1d; }
.dxs.dxs-togo .arrow-list li::before  { color: #7f1d1d; }
.dxs.dxs-togo .step-num               { background: #dc2626; }
.dxs.dxs-togo .example-box            { background: #fff1f2; }
.dxs.dxs-togo .example-label          { color: #f87171; }
.dxs.dxs-togo .example-box p          { color: #991b1b !important; }
.dxs.dxs-togo .section.summary        { background: #7f1d1d; }

/* ── Media queries ── */
@media (max-width: 480px) {
  .dxs .intro-card     { padding: 28px 18px; }
  .dxs .intro-legend   { gap: 12px; }
  .dxs .question-card  { padding: 18px 16px; }
  .dxs .answer-mark    { font-size: 1.1rem; }
  .dxs .hero           { padding: 24px 18px; }
  .dxs h1              { font-size: 1.6rem; }
  .dxs .section        { padding: 20px 16px; }
  .dxs .btn-large      { padding: 14px 28px; font-size: .95rem; }
  .dxs .cta-card       { padding: 28px 18px; }
}
