/* ===== PREVIEW PAGE ===== */

/* Lock the page so only #form_section scrolls, not the whole page */
html, body {
  height: 100%;
  overflow: hidden;
}

body {
  overflow-x: clip;
}

/* スクロール可能なプレビューエリア */
#form_section {
  max-height: calc(100dvh - 320px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  margin: 0 20px 16px 20px;
  min-width: 0;
}


/* セクションタイトル: 中央揃え・太字 */
.page-title {
  text-align: center;
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 16px;
  margin-top: 60px;
}

/* ==============================================
   STATIC PREVIEW MOCKUP (pv-*)
   ============================================== */

/* Section 1: 説明先整理 consolidated table */
.pv-s1-legend-row {
  font-size: 13px;
  margin: 2px 0;
  line-height: 1.6;
}

.pv-s1-legend-key {
  font-weight: bold;
}

.pv-s1-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.pv-s1-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  table-layout: fixed;
}

.pv-s1-table th,
.pv-s1-table td {
  border-top: 2px solid #555;
  border-bottom: 2px solid #555;
  border-left: 1px solid #555;
  border-right: 1px solid #555;
  padding: 12px 6px;
  text-align: center;
  vertical-align: middle;
  width: calc(100% / 7);
}

.pv-s1-th {
  background-color: #f0f0f0;
  font-size: 12px;
}

.pv-s1-th-topic {
  background-color: #f0f0f0;
}

.pv-s1-table td.pv-s1-td-topic {
  font-size: 11px;
  font-weight: bold;
  background-color: #fafafa;
  text-align: left;
  vertical-align: top;
  padding-top: 16px;
  padding-bottom: 16px;
  line-height: 1.4;
}

.pv-s1-row-symbol td:not(.pv-s1-td-topic) {
  font-weight: bold;
  font-size: 10px;
}

.pv-s1-row-who td:not(.pv-s1-td-topic),
.pv-s1-row-when td:not(.pv-s1-td-topic) {
  font-size: 11px;
  color: #333;
}

.pv-s1-row-when td {
  padding-bottom: 8px;
}

.pv-section {
  margin-bottom: 28px;
  margin-left: 15px;
  margin-right: 15px;
}

/* セクションタイトル: 中央揃え・太字 */
.pv-section-title {
  text-align: center;
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 16px;
  margin-top: 30px;
}

/* 質問グループ */
.pv-question-group {
  margin-bottom: 20px;
}

/* 質問タイトル: 左揃え・太字 */
.pv-question-title {
  text-align: left;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 12px;
}

/* サブテキスト: 左揃え */
.pv-sub-text {
  text-align: left;
  font-size: 15px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* 選択肢凡例 */
.pv-legend {
  margin-bottom: 16px;
}

.pv-legend-label {
  font-weight: bold;
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
}

.pv-legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  flex-direction: column;
}

.pv-legend-list li {
  font-size: 13px;
}

/* マトリクス質問 */
.pv-matrix {
  margin-bottom: 16px;
}

.pv-matrix-title {
  text-align: left;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 10px;
}

/* 回答テーブル */
.pv-table {
  border-collapse: collapse;
  max-width: 400px;
}

.pv-table-recipient {
  font-size: 15px;
  padding: 6px 16px 6px 0;
  vertical-align: middle;

}

.pv-table-answer {
  font-size: 14px;
  font-weight: bold;
  text-align: left;
  padding: 6px 16px;
  vertical-align: middle;
}

/* Plain text replacement for dropdown answers */
.pv-answer-text {
  font-size: 14px;
  margin-top: 8px;
  flex: 0 0 100%;
}

/* Section 9: text note input sitting below the answer symbol in a table cell */
.pv-note-input {
  text-align: left;
  display: block;
  width: 240px;
  height: 22px;
  font-size: 12px;
  margin-top: 4px;
  border: 1px solid #aaa;
  /* border-bottom: 1px solid #aaa; */
  outline: none;
  background: transparent;
  /* round the border corners */
  border-radius: 4px;
}

/* ===== ボタンエリア ===== */
.btn_confirm {
  display: inline-block;
  min-width: 100px;
  text-align: center;
  padding: 5px 20px;
  border: 2px solid #888;
  border-radius: 7px;
  background-color: #888;
  color: #fff;
  cursor: pointer;
}

.btn_return {
  display: inline-block;
  min-width: 100px;
  text-align: center;
  padding: 5px 20px;
  border: 2px solid #333;
  border-radius: 7px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
}

.page_stack_contents {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
}

/* ===== 印刷時: スクロールを解除して全内容を表示 ===== */
@media print {
  #form_section {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 480px) {
  .page_stack_contents {
    gap: 0.5rem;
  }

  .btn_return {
    margin-top: 2.5px;
  }

  #form_section {
    margin-left: 0;
    margin-right: 0;
    padding-right: 0;
  }

  .pv-section {
    margin-left: 8px;
    margin-right: 8px;
  }

  .pv-med-card {
    padding-left: 10px;
    padding-right: 10px;
  }

  .pv-med-label {
    min-width: 80px;
  }

  .pv-double-ul {
    padding-right: 0;
  }
}

@media (max-height: 600px) {
  #form_section {
    max-height: calc(100vh - 80px);
  }
}


/* Section 2: center the image card */
.item_img_group {
  margin-left: auto;
  margin-right: auto;
}

/* Section 6: 業務・人間関係・環境 */
.pv-s6-subtitle {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 20px;
}

.pv-s6-text-answers {
  flex: 0 0 100%;
  margin: 4px 0 8px 0;
}

.pv-s6-text-answers p {
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
}

.pv-s6-select-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 8px 0;
  flex: 0 0 100%;
}

.pv-s6-select-list li {
  font-size: 14px;
  line-height: 1.8;
}

/*STEP4 css*/
.pv-item_input_contents {
  margin-top: 30px;
}

.pv-item_input_ttl p {
  font-family: "UDDigiKyokasho", sans-serif;
  padding: 10px;
  border-radius: 8px;
  text-align: left;
  margin-left: -5px;
}

.pv-item_input_group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}

.pv-item_input_group .pv-check_group {
  flex: 0 0 33.33%;
  box-sizing: border-box;
  padding: 3px 4px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.pv-check_group .visually-hidden {
  position: absolute;
  white-space: nowrap;
  width: 20px;
  height: 20px;
  overflow: hidden;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  margin-left: 5px;
}

.pv-check_group label {
  display: inline-block;
  cursor: default;
  line-height: normal;
  padding-left: 30px;
  position: relative;
  font-size: 14px;
  color: #000;
}

.pv-check_group label::before,
.pv-check_group label::after {
  content: "";
  display: block;
  position: absolute;
}

.pv-check_group label::before {
  background-color: #fff;
  border-radius: 0;
  border: 1px solid #ddd;
  width: 20px;
  height: 20px;
  top: 2px;
  left: 5px;
}

.pv-check_group label::after {
  border-bottom: 3px solid #292929;
  border-left: 3px solid #292929;
  opacity: 0;
  height: 8px;
  width: 14px;
  transform: rotate(-45deg);
  top: 7px;
  left: 8px;
}

.pv-check_group input:checked+label::after {
  opacity: 1;
}

.pv-free_input {
  flex: 0 0 100%;
  margin-top: 8px;
}

.pv-free_input input {
  font-family: "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro W3", sans-serif;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 15px;
  width: 100%;
  padding: 5px 10px;
  text-align: left;
  line-height: normal;
}

/* Section 8: bordered box around section title */
.box-title {
  width: fit-content;
  margin: 30px auto 16px;
  border: 1px solid #000;
  padding: 6px 60px;
}

.box-title .pv-section-title {
  margin: 0;
}

/* Section 8: medication card */
.pv-med-intro {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.pv-med-card {
  border: 1px solid #000;
  padding-top: 10px;
  padding-right: 20px;
  padding-left: 20px;
  padding-bottom: 30px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.pv-med-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 14px;
}

.pv-med-row:last-child {
  margin-bottom: 0;
}

.pv-med-row.pv-med-gap {
  margin-top: 2em;
}

.pv-med-label {
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
  min-width: 160px;
}

.pv-med-value {
  font-size: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.pv-double-ul {
  display: inline-block;
  border-bottom: 3px double #000;
  padding-bottom: 4px;
  padding-right: 125px;
  max-width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
}