/* DiagnosisWidget — 受付窓口（公式サイト寄せ） */

.diagnosis-widget-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(120, 140, 160, 0.28);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.diagnosis-widget-backdrop.hidden {
  display: none;
}

body.diagnosis-widget-open {
  overflow: hidden;
}

.diagnosis-widget {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: min(90dvh, 820px);
  background: var(--paper, #fff);
  box-shadow: var(--shadow-modal, 0 2px 14px rgba(61, 64, 96, 0.12));
  border: 1px solid var(--line, #dde3ea);
}

.diagnosis-widget-header {
  flex-shrink: 0;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #d4e8f2;
  background: var(--bg-soft, #f1fbff);
}

.diagnosis-widget-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.diagnosis-widget-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #006fb9);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.diagnosis-widget-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent, #006fb9);
  line-height: 1.45;
}

.diagnosis-widget-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid #c5d9e8;
  border-radius: 3px;
  background: #fff;
  color: var(--ink-muted, #707070);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.diagnosis-widget-close:hover {
  border-color: var(--accent-light, #459dca);
  color: var(--accent, #006fb9);
  background: #fff;
}

.diagnosis-widget-lead {
  margin-top: 10px;
  padding: 10px 12px 10px 14px;
  font-size: 13px;
  color: var(--ink, #3d4060);
  line-height: 1.65;
  background: #fff;
  border: 1px solid #d4e8f2;
  border-left: 4px solid var(--accent, #006fb9);
  border-radius: 3px;
}

.diagnosis-widget-lead.hidden {
  display: none;
}

.diagnosis-widget-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 18px 24px;
  scroll-behavior: auto;
  background: var(--paper, #fff);
}

.diagnosis-widget-body .panel {
  margin-top: 12px;
  padding-bottom: 16px;
}

.diagnosis-widget-body .panel > .actions {
  position: static;
  margin: 16px 0 0;
  padding: 16px 0 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: none;
  border-top: 1px solid var(--line, #dde3ea);
}

.diagnosis-widget-body .actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
}

.diagnosis-widget-body .actions [data-logical-back],
.diagnosis-widget-body .actions .btn-back {
  flex: 0 0 auto;
  min-width: 84px;
  max-width: 34%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}

.diagnosis-widget-body .actions .btn-primary {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  padding: 14px 18px;
  font-size: 16px;
}

.diagnosis-widget-body .actions.actions-single .btn-primary {
  flex: 1 1 100%;
  width: 100%;
}

/* 保険案内 — diagnosis-ui.css でフラットゲージ定義 */

/* LP CTA */
.lp-cta-section {
  text-align: center;
  padding: 8px 0 24px;
}

.lp-cta-section .field-note {
  max-width: 520px;
  margin: 0 auto 16px;
}

.lp-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.lp-cta-sub {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-muted, #707070);
}

.lp-cta-phone {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-muted, #707070);
}

.lp-cta-phone a {
  font-weight: 700;
  text-decoration: none;
}

/* 作業範囲確認 */
.scope-confirm-box {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 6px;
  background: var(--bg-soft, #f1fbff);
  border: 1px solid var(--line, #dde3ea);
}

.no-web-slots-box {
  margin: 16px 0;
  padding: 16px;
  border-radius: 6px;
  background: #fff8f0;
  border: 1px solid #fed7aa;
}

.no-web-slots-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.no-web-slots-actions .btn {
  min-height: 48px;
}

.special-stain-primary .field-note {
  font-weight: 600;
  color: var(--ink, #3d4060);
}

.diagnosis-widget-body .choice-btn,
.diagnosis-widget-body .radio-pill,
.diagnosis-widget-body .btn,
.diagnosis-widget-body input[type="text"],
.diagnosis-widget-body input[type="email"],
.diagnosis-widget-body textarea,
.diagnosis-widget-body select {
  min-height: 44px;
}

.diagnosis-widget-body .btn-primary,
.diagnosis-widget-body .btn-ghost {
  min-height: 48px;
}

.diagnosis-widget-body .postal-entry-body .postal-field input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  height: 48px;
  font-size: 17px;
  font-weight: 600;
  padding: 0 14px;
  letter-spacing: 0.08em;
  box-sizing: border-box;
}

.diagnosis-widget-body .postal-entry-body .postal-mark {
  font-size: 16px;
  font-weight: 600;
}

.diagnosis-widget-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.live-pricing-summary,
.live-pricing-summary.is-hidden {
  display: none !important;
}

/* 結果画面 — 料金内訳表（公式シミュレーション寄せ） */
.result-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 4px;
}

.result-breakdown-table td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.5;
}

.result-breakdown-table td.amt {
  text-align: right;
  white-space: nowrap;
  width: 38%;
  font-weight: 700;
  background: #fafcfd;
}

.result-breakdown-table tr.result-breakdown-total td {
  font-weight: 900;
  color: var(--accent);
  background: var(--bg-soft);
}

.result-breakdown-notes {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--warn-text);
}

.result-breakdown-notes p {
  margin: 0;
}

.result-breakdown-notes p + p {
  margin-top: 4px;
}

@media (min-width: 900px) {
  .diagnosis-widget-layout {
    flex-direction: column;
  }

  .diagnosis-widget-body {
    border-right: none;
  }
}

.live-pricing-summary {
  flex-shrink: 0;
  background: var(--paper, #fff);
}

.live-pricing-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--line, #dde3ea);
  background: var(--bg-soft, #f1fbff);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.live-pricing-toggle--desktop {
  cursor: default;
  border-top: none;
  border-bottom: 1px solid var(--line, #dde3ea);
  background: var(--paper, #fff);
}

.live-pricing-toggle-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent, #006fb9);
}

.live-pricing-toggle-total {
  font-size: 18px;
  color: var(--ink, #3d4060);
}

.live-pricing-detail {
  padding: 0 16px 16px;
}

.live-pricing-detail.is-collapsed {
  display: none;
}

.live-pricing-total-row {
  display: none;
}

.live-pricing-total {
  font-size: 22px;
  color: var(--accent, #006fb9);
}

.live-pricing-section {
  margin-top: 12px;
}

.live-pricing-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent, #006fb9);
  margin-bottom: 6px;
}

.live-pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.live-pricing-table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--line, #dde3ea);
  vertical-align: top;
  line-height: 1.5;
}

.live-pricing-table td.amt {
  text-align: right;
  white-space: nowrap;
  padding-left: 8px;
  font-weight: 700;
}

.live-pricing-table td.muted {
  color: var(--ink-muted, #707070);
  font-size: 12px;
}

.live-pricing-work {
  margin: 0;
  padding-left: 1.1em;
  font-size: 12px;
  color: var(--ink-muted, #707070);
  line-height: 1.6;
}

.live-pricing-notes {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--warn-bg, #fffbeb);
  border: 1px solid var(--warn-border, #fcd34d);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--warn-text, #92400e);
}

.live-pricing-notes p {
  margin: 0;
}

.live-pricing-notes p + p {
  margin-top: 4px;
}

.live-pricing-summary.is-hidden {
  display: none;
}

@media (min-width: 900px) {
  .live-pricing-summary {
    width: 280px;
    overflow-y: auto;
  }

  .live-pricing-toggle {
    display: none;
  }

  .live-pricing-detail {
    display: block !important;
    padding: 16px;
  }

  .live-pricing-detail.is-collapsed {
    display: block !important;
  }

  .live-pricing-total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent, #006fb9);
  }
}

@media (max-width: 899px) {
  .live-pricing-summary {
    order: 2;
  }
}

@media (min-width: 641px) {
  .diagnosis-widget-backdrop {
    align-items: center;
    padding: 20px;
  }

  .diagnosis-widget {
    border-radius: 4px;
    max-height: min(88dvh, 800px);
    box-shadow: var(--shadow-modal, 0 2px 14px rgba(61, 64, 96, 0.12));
  }
}

@media (max-width: 640px) {
  .diagnosis-widget-header {
    padding: 12px 14px 8px;
  }

  .diagnosis-widget-body {
    padding: 0 12px 16px;
  }
}

/* スマホ — 診断フォーム全画面（単独ページ・埋め込み共通） */
@media (max-width: 899px) {
  body.diagnosis-widget-open .diagnosis-widget-backdrop:not(.hidden) {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    margin: 0;
    background: #fff;
  }

  body.diagnosis-widget-open .diagnosis-widget {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  body.diagnosis-widget-open .diagnosis-widget-layout {
    flex: 1;
    min-height: 0;
  }

  body.diagnosis-widget-open .diagnosis-widget-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
