.wrapper { background-color: #F0F3F5; }

/* ===============================
   System Diagnosis Contact Container (for contact.php)
   =============================== */
.sd-contact-container {
  margin: 130px auto 50px auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 1.5px 6px rgba(0,0,0,0.06);
  padding: 50px 0 50px 0;
}
.sd-contact-title {
  font-size: 32px;
  font-weight: bold;
  text-align: center;
  color: #000;
  margin-bottom: 40px;
  margin-top: 0;
  font-family: "Noto Sans JP", sans-serif !important;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.sd-contact-form {
  width: 100%;
}
.sd-contact-form .input-inquiry,
.sd-contact-form .inquiry-confirm-box,
.sd-contact-form .inquiry-recaptcha-box,
.sd-contact-form .inquiry-submit {
  margin-left: 200px;
  margin-right: 200px;
}
@media (max-width: 1200px) {
  .sd-contact-container {
    width: 90%;
    padding: 40px 0;
  }
  .sd-contact-form .input-inquiry,
  .sd-contact-form .inquiry-confirm-box,
  .sd-contact-form .inquiry-recaptcha-box,
  .sd-contact-form .inquiry-submit {
    margin-left: 40px;
    margin-right: 40px;
  }
}
@media (max-width: 600px) {
  .sd-contact-container {
    width: 100%;
    padding: 20px 0;
    border-radius: 0;
    box-shadow: none;
  }
  .sd-contact-form .input-inquiry,
  .sd-contact-form .inquiry-confirm-box,
  .sd-contact-form .inquiry-recaptcha-box,
  .sd-contact-form .inquiry-submit {
    margin-left: 0;
    margin-right: 0;
    padding-left: 10px;
    padding-right: 10px;
  }
  .sd-contact-title {
    font-size: 22px;
    margin-bottom: 24px;
  }
}


/* ===============================
   System Diagnosis Send OK (Success) Page
   =============================== */
.sd-sendok-container {
  max-width: 90%;
  margin: 180px auto 150px auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 1.5px 6px rgba(0,0,0,0.06);
  padding: 50px 0 50px 0;
}

.sysd-sendok-card {
  padding: 0 0 10px 0;
  text-align: center;
  margin: 0 auto;
  max-width: 580px;
}
.sysd-sendok-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 32px;
  color: #22223B;
  letter-spacing: 1.2px;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
}
.sysd-lead {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  line-height: 0.9;
  text-align: left;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.sysd-lead + .sysd-lead {
  margin-top: 0;
  margin-bottom: 24px;
}
.sysd-note {
  color: #b91c1c;
  font-weight: 600;
  font-size: 12px;
  margin: 40px 0 38px 0;
  line-height: 1.7;
  text-align: left;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.sysd-sendok-actions {
  margin-bottom: 0;
}
.sysd-button {
  display: inline-block;
  padding: 14px 48px;
  background-color: #fff;
  color: #22223B;
  border: 2px solid #22223B;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, border 0.18s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-top: 8px;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.sysd-button:hover {
  background-color: #22223B;
  color: #fff;
  border-color: #22223B;
}


@media (max-width: 600px) {
  .sysd-sendok-card {
    padding: 24px 8px;
    max-width: 98vw;
  }
  .sysd-sendok-title {
    font-size: 1.2rem;
    margin-bottom: 18px;
  }
  .sysd-lead, .sysd-note {
    font-size: 0.98rem;
    margin-bottom: 12px;
  }
  .sysd-button {
    padding: 12px 18px;
    font-size: 1rem;
  }
}


/* ==========================================================
   DX問診票 (System Diagnosis Form) — scoped styles
   ========================================================== */
.dx-shindan * { box-sizing: border-box; }

/* Question table */
.dx-shindan .radio-container input:checked + span {
  background-color: #1959b3;
  color: white;
  border-color: #1959b3;
}
.dx-shindan table { width: 100%; text-align: left; border-collapse: collapse; }
.dx-shindan .dx-question-table { background-color: #F8F8FA; }
.dx-shindan th { padding: 16px; font-weight: 700; }
.dx-shindan td { vertical-align: middle; }
.dx-shindan thead { background-color: #e2e8f0; color: #334155; }

/* General layout */
.dx-shindan .dx-form-wrap { background: #fff; box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1); border-radius: 8px; overflow: hidden; }
.dx-shindan .dx-header { background-color: #181463; color: #fff; padding: 5px 24px; text-align: center; }
.dx-shindan .dx-header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin:0;
  margin-top: 10px;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .dx-header p {
  font-size: 12px;
  color: #e2e8f0;
  margin: 0px 0 5px;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .dx-company-row { padding: 24px; border-bottom: 1px solid #e2e8f0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; background: #f8fafc; }
.dx-shindan .dx-company-row .field { display: flex; align-items: center; gap: 16px; }
.dx-shindan .dx-company-row label { font-weight: 700; font-size: 14px; color: #334155; white-space: nowrap; }
.dx-shindan .dx-company-row input { width: 100%; border: 1px solid #cbd5e1; padding: 10px; border-radius: 4px; font-size: 14px; }
.dx-shindan .dx-company-row input:focus { outline: none; box-shadow: 0 0 0 1px #3b82f6; }

/* Group header rows */
.dx-shindan .group-header td {
  padding: 10px 16px;
  font-weight: 700;
  font-size: 16px;
  color: #2F2F6F;
  background: #e6e5ee;
  border-bottom: 1px solid #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}

/* Column header per group */
.dx-shindan .group-col-header { background-color: #F8F8FA; }
.dx-shindan .dx-question-table > tbody > tr.group-col-header {
  border-bottom: 0 !important;
}
.dx-shindan .group-col-header th,
.dx-shindan .group-col-header .th-title {
  background-color: #ebebeb;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: #2F2F6F;
  border-bottom: 0;
  border-bottom-right-radius: 10px;
  text-align: center;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .group-col-header .th-title,
.dx-shindan .group-col-header .th-note {
  display: block;
}
.dx-shindan .group-col-header .th-title,
.dx-shindan .group-col-header .th-note {
  padding-top: 10px;
  line-height: 1.4;
}
.dx-shindan .group-col-header .th-note {
  padding:0;
  font-size: 10px;
  letter-spacing: 0;
  color: #000;
  font-weight: 400;
}

/* Question cells */
.dx-shindan .q-label {
  background: #fff;
  padding: 0 0 12px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #2F2F6F;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .q-required {
  display: block;
  width: fit-content;
  margin-bottom: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  background: #181463;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}
.dx-shindan .q-label .axis-tag { font-size: 13px; color: #64748b; margin-top: 4px; display: block; }
.dx-shindan .q-options {
  padding: 0 0 0 15px;
  background: #F8F8FA;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .q-options .opts-wrap { display: flex; flex-wrap: wrap; align-items: center; }
.dx-shindan .q-error {
  display: none;
  margin-bottom: 4px;
  color: #b1181f;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}
.dx-shindan .question-row.is-unanswered .q-error {
  display: block;
}
.dx-shindan .q-detail {
  background: #fff;
  padding: 12px 20px;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .q-detail-note {
  display: none;
}
.dx-shindan .q-detail textarea {
  width: 100%;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px;
  padding: 8px;
  font-size: 14px;
  resize: vertical;
  min-height: 55px;
  background: #f7f8f8 !important;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .q-detail textarea:focus { outline: none; box-shadow: 0 0 0 1px #1959b3; background: #f7f8f8 !important; border-color: #3b82f6 !important; }

/* Radio pill */
.dx-shindan .radio-container { 
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  margin-bottom: 4px;
  cursor: pointer;
}

.dx-shindan .radio-container input { display: none; }
.dx-shindan .radio-container span {
  padding: 5px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  color: #2F2F6F;
  font-weight: 600;
  background: #fff;
  transition: all .15s;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .radio-container:hover span { background: #eff3fa; }

/* Badges */
.dx-shindan .badge { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 4px; margin-left: 8px; }
.dx-shindan .badge-maturity { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.dx-shindan .badge-risk { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }

/* Buttons area */
.dx-shindan .dx-actions { padding: 32px; background: #f8fafc; text-align: center; display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.dx-shindan .btn-diagnose {
  background: #03145e; color: #fff; font-weight: 700; padding: 20px 0;
  border-radius: 6px; border: none; cursor: pointer; font-size: 16px;
  width: 260px; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.1); transition: background .15s;
}
.dx-shindan .btn-diagnose:hover { background: #494383; }
.dx-shindan .btn-reset {
  background: #f9fbff; color: #1e293b; font-weight: 700; padding: 20px 0;
  border-radius: 6px; border: 1px solid #cdd6dd; cursor: pointer; font-size: 16px;
  width: 220px; text-align: center;
  transition: background .15s;
}
.dx-shindan .btn-reset:hover { background: #eff3fa; }

/* Submit link button (to contact form) */
.dx-shindan .btn-submit-contact {
  display: inline-block; background: #c00; color: #fff; font-weight: 700;
  padding: 15px 40px; border-radius: 4px; border: none; cursor: pointer;
  font-size: 1rem; text-decoration: none; transition: background .15s;
}
.dx-shindan .btn-submit-contact:hover { background: #a00; color: #fff; text-decoration: none; }

/* Result section */
.dx-shindan .dx-result { border-top: 1px solid #e2e8f0; background: #fff; }
.dx-shindan .dx-result-grid { padding: 24px 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.dx-shindan .dx-result-panel { background: #f8fafc; border-radius: 8px; padding: 16px 24px; border: 1px solid #e2e8f0; }
.dx-shindan .dx-result-panel h3 { font-size: 1.125rem; font-weight: 700; color: #1e293b; }
.dx-shindan .dx-result-panel .sub { font-size: .875rem; color: #475569; margin-top: 4px; }

/* Score display */
.dx-shindan .score-box { margin-top: 24px; padding: 16px; background: #fff; border-radius: 4px; border: 1px solid #e2e8f0; }
.dx-shindan .score-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dx-shindan .score-number { font-size: 1.875rem; font-weight: 700; color: #0f172a; }
.dx-shindan .score-level { font-size: 1.25rem; font-weight: 700; }

/* Summary */
.dx-shindan .summary-box { margin-top: 16px; padding: 16px; border-radius: 4px; border: 1px solid #e2e8f0; background: #f8fafc; }
.dx-shindan .summary-box h4 { font-weight: 700; color: #1e293b; }
.dx-shindan .summary-text { margin-top: 8px; font-size: 1rem; color: #334155; line-height: 1.625; white-space: pre-wrap; }

/* Diagnosis cards */
.dx-shindan .diag-card { padding: 16px; background: #fff; border-radius: 4px; border: 1px solid #e2e8f0; margin-top: 12px; }
.dx-shindan .diag-card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dx-shindan .diag-card-header .axis-name {
  font-weight: 700;
  color: #1e293b;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .diag-card-header .score-badge {
  font-size: 1rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .diag-card p {
  font-size: 1rem;
  color: #334155;
  margin-top: 8px;
  line-height: 1.625;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}

/* Menu recommendations */
.dx-shindan .menu-card { padding: 16px; border-radius: 4px; border: 1px solid #e2e8f0; background: #fff; margin-top: 12px; }
.dx-shindan .menu-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dx-shindan .menu-card .menu-title {
  font-weight: 700;
  color: #0f172a;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .menu-card .menu-scope {
  font-size: .875rem;
  color: #64748b;
  margin-top: 4px;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .menu-card .menu-summary {
  font-size: .875rem;
  color: #64748b;
  margin-top: 4px;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .menu-card .menu-reason {
  font-size: 1rem;
  color: #334155;
  margin-top: 8px;
  font-family: "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 1.2px;
}
.dx-shindan .priority-badge { flex-shrink: 0; font-size: .75rem; font-weight: 700; padding: 4px 8px; border-radius: 4px; border: 1px solid; }
.dx-shindan .priority-1 { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.dx-shindan .priority-2 { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.dx-shindan .priority-3 { background: #f8fafc; color: #334155; border-color: #e2e8f0; }

@media (max-width: 991.98px) {
  .top-page .container { width: 95%; }
}

/* Responsive */
@media (max-width: 768px) {
  .top-page .container { width: 90%; }
  .dx-shindan .dx-company-row { grid-template-columns: 1fr; }
  .dx-shindan .dx-result-grid { grid-template-columns: 1fr; padding: 16px; }

  /* Stack table rows vertically */
  .dx-shindan table,
  .dx-shindan tbody,
  .dx-shindan tr,
  .dx-shindan td,
  .dx-shindan th {
    display: block;
    width: 100%;
  }

  /* Each question row becomes stacked blocks */
  .dx-shindan .question-row {
    border-bottom: 0;
    padding: 0;
  }

  /* Base cell reset */
  .dx-shindan .question-row td {
    padding: 0 !important;
    position: relative;
  }

  /* Question / options / note blocks */
  .dx-shindan .question-row .q-label,
  .dx-shindan .question-row .q-options,
  .dx-shindan .question-row .q-detail {
    padding: 45px 25px 20px 25px !important;
  }

  .dx-shindan .question-row .q-label {
    font-weight: 600;
  }
  .dx-shindan .question-row + .question-row .q-label {
    border-top: 1px solid #e2e8f0;
  }

  .dx-shindan .q-required {
    font-size: 12px;
  }

  /* Add separator between blocks */
  .dx-shindan .question-row .q-options,
  .dx-shindan .question-row .q-detail {
    border-top: 0;
  }

  .dx-shindan .question-row .q-detail.form-group {
  margin-bottom: 0 !important;
  }

  /* Mobile cell labels */
  .dx-shindan .question-row td::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: #1b1464;
    background: #ebebeb;
    padding: 4px 16px;
    border-radius: 0 0 6px 0;
    margin: 0;
    width: 80px;
    white-space: nowrap;
    z-index: 1;
  }

  .dx-shindan .question-row .q-label::before { content: '問診項目'; }
  .dx-shindan .question-row .q-options::before { content: '選択肢'; }
  .dx-shindan .question-row .q-detail::before { content: '補足'; }
  .dx-shindan .question-row .q-detail .q-detail-note {
    display: block;
    position: absolute;
    top: 5px;
    left: 90px;
    right: 16px;
    color: #000;
    font-size: 11px;
    font-weight: 600;
  }

  /* Hide column headers on mobile */
  .dx-shindan .group-col-header th { display: block; }
  .dx-shindan .group-col-header { display: none; }

  /* Group header full width */
  .dx-shindan .group-header td {
    display: block;
    border-bottom: 0;
  }

  /* Radio options wrap */
  .dx-shindan .q-options .opts-wrap {
    gap: 6px;
  }

  .dx-shindan .radio-container {
    margin-right: 0;
    margin-bottom: 6px;
  }

  /* Textarea bigger on mobile */
  .dx-shindan .q-detail textarea {
    min-height: 100px !important;
  }

  /* Buttons stack */
  .dx-shindan .dx-actions {
    flex-direction: column;
    align-items: center;
  }

  .dx-shindan .btn-diagnose,
  .dx-shindan .btn-reset {
    width: 100%;
    max-width: 300px;
  }

  /* Result panels stack */
  .dx-shindan .dx-result-grid { gap: 16px; }
  .dx-shindan .score-row {
    flex-direction: column;
    text-align: center;
  }

  /* Header smaller */
  .dx-shindan .dx-header h2 { font-size: 1.5rem; }
  .dx-shindan .dx-header { padding: 16px; }

  /* Hero header */
  .dx-hero { padding: 70px 0 !important; }
  .dx-hero h1 { font-size: 45px !important; }
}
