/* 外枠 .price-sim の紙に直接並べる。配色・書体は料金ページから継承する。 */
.psim,
.psim::before,
.psim::after,
.psim *,
.psim *::before,
.psim *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.psim {
  container: psim / inline-size;
  padding: 14px 6px 8px;
  font-family: var(--font-ja);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: normal;
  text-align: start;
  color: var(--pp-ink);
}

.psim .psim-nobr { display: inline-block; white-space: nowrap; }
.psim .psim__header { text-align: center; }
.psim .psim__header h3 {
  font-family: var(--pp-mincho);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.8;
  letter-spacing: .04em;
  color: var(--pp-ink);
}
.psim .psim__header h3::after {
  content: "";
  display: block;
  width: 150px;
  height: 12px;
  margin: 2px auto 0;
  background: url("../../images/hero-paper/underline-brush.webp") center / 100% 100% no-repeat;
}
.psim .subtitle { margin: 10px 0 26px; font-size: 13px; color: var(--ink-soft); }

/* 非表示の回数欄はカウントされないので、プレミアムでも連番になる。 */
.psim .psim__inputs { counter-reset: psim-step; }
.psim .form-group { margin-top: 26px; counter-increment: psim-step; }
.psim .form-group[hidden] { display: none; }
.psim .form-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--pp-mincho);
  font-size: 17px;
  font-weight: 700;
}
.psim .form-label::before {
  content: counter(psim-step);
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--pp-accent);
  border-radius: 50%;
  color: var(--pp-accent-text);
  font-size: 13px;
  line-height: 1;
  transform: translateY(-2px);
}
.psim .form-label small { font-family: var(--font-ja); font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.psim :is(.radio-group, .checkbox-group) { border-top: 1px solid var(--price-line); }
.psim :is(.radio-option, .checkbox-option) {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  padding: 13px 10px;
  border-bottom: 1px solid var(--price-line);
  cursor: pointer;
}
.psim :is(.radio-option, .checkbox-option).checked {
  background: var(--price-wash);
  box-shadow: inset 3px 0 0 var(--pp-accent);
}
/* 入力はキーボード操作と読み上げに残し、丸・チェックだけ描き直す。 */
.psim :is(.radio-option, .checkbox-option) input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.psim :is(.radio-dot, .checkbox-box) {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid #9b8d7e;
  background: #fffdf8;
}
.psim .radio-dot { border-radius: 50%; }
.psim .checkbox-box { border-radius: 2px; }
.psim .checked :is(.radio-dot, .checkbox-box) { border-color: var(--pp-accent); }
.psim .checked .radio-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--pp-accent);
}
.psim .checked .checkbox-box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 6px;
  height: 11px;
  border: solid var(--pp-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.psim :is(.radio-option, .checkbox-option):has(input:focus-visible) {
  outline: 2px solid var(--pp-accent);
  outline-offset: 2px;
}
.psim :is(.radio-label, .checkbox-label) { min-width: 0; font-weight: 500; }
.psim .radio-label:last-child { grid-column: 2 / -1; }
.psim .option-desc { display: block; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.psim .option-price { text-align: right; white-space: nowrap; font-size: 14px; font-variant-numeric: tabular-nums; }
.psim .option-price b { font-family: var(--pp-mincho); font-size: 16px; }
.psim .option-price :is(.unit, small) { font-size: 11px; color: var(--ink-soft); }
.psim .checked .option-price b { color: var(--pp-accent-text); }

.psim select {
  width: 100%;
  padding: 11px 32px 11px 12px;
  border: 1px solid #b9ab9b;
  border-radius: 2px;
  background: #fffdf8;
  font: inherit;
  color: var(--pp-ink);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--pp-accent) 50%), linear-gradient(135deg, var(--pp-accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.psim select:focus-visible { outline: 2px solid var(--pp-accent); outline-offset: 2px; }
.psim .help-text { margin-top: 8px; font-size: 12.5px; line-height: 1.75; color: var(--ink-soft); }
.psim .checkbox-group .help-text { margin: 8px 0 12px; }
.psim .checkbox-group .help-text:last-child { margin-bottom: 0; }
.psim .enrollment-summary { margin-top: 10px; padding: 10px 12px; background: rgb(239 230 214 / 70%); font-size: 13px; line-height: 1.7; }
.psim .error-msg { display: none; margin-top: 6px; font-size: 12.5px; color: var(--pp-accent-text); }
.psim .error-msg.show { display: block; }

/* 「初期費用」と同じ罫線の表。金額は右揃え。 */
.psim .result-section { margin-top: 34px; padding-top: 6px; border-top: 1px dashed rgb(59 51 44 / 28%); }
.psim .result-heading { margin: 22px 0 6px; font-family: var(--pp-mincho); font-size: 18px; font-weight: 700; }
.psim .result-condition { display: inline-block; margin-bottom: 4px; padding-bottom: 3px; border-bottom: 1px solid var(--pp-accent); color: var(--pp-accent-text); font-size: 12.5px; }
.psim table { width: 100%; border-collapse: collapse; }
.psim :is(th, td) { padding: 13px 4px; border-bottom: 1px solid var(--price-line); font-size: 14.5px; line-height: 1.6; }
.psim th { text-align: left; font-weight: 500; }
.psim td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.psim td b { font-size: 17px; }
.psim .summary-total > * { border-top: 2px solid var(--pp-accent); border-bottom: 0; padding-block: 18px; }
.psim .summary-total th { font-family: var(--pp-mincho); font-size: 17px; font-weight: 700; }
.psim .summary-total th small { display: block; font-family: var(--font-ja); font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.psim .summary-total .amount { font-size: 32px; font-weight: 700; color: var(--pp-accent-text); }
.psim .summary-total .unit { margin-left: 2px; font-size: 14px; }
.psim .referral-note { display: block; font-size: 11.5px; color: var(--pp-accent-text); }

.psim .breakdown-section { margin-top: 14px; border: 1px solid var(--price-line); background: rgb(255 253 248 / 55%); }
.psim .breakdown-section summary { display: flex; justify-content: space-between; gap: 1em; padding: 12px 14px; font-size: 14px; font-weight: 500; list-style: none; cursor: pointer; }
.psim .breakdown-section summary::-webkit-details-marker { display: none; }
.psim .breakdown-section summary::after { content: "＋"; color: var(--pp-accent); }
.psim .breakdown-section[open] summary::after { content: "－"; }
.psim .table-scroll { max-width: 100%; overflow-x: auto; }
.psim .breakdown-table { min-width: 560px; }
.psim .breakdown-table :is(th, td) { padding: 12px 10px; font-size: 13px; white-space: nowrap; }
.psim .breakdown-table th { text-align: right; color: var(--ink-soft); }
.psim .breakdown-table :is(th, td):first-child { text-align: left; }
.psim .breakdown-table .zero { color: var(--ink-soft); }

.psim .notice-box { margin-top: 22px; padding: 14px 14px 12px; background: rgb(239 230 214 / 58%); font-size: 12.5px; line-height: 1.85; color: var(--ink-soft); list-style: none; }
.psim .notice-box li { position: relative; padding-left: 1em; }
.psim .notice-box li + li { margin-top: 4px; }
.psim .notice-box li::before { content: "・"; position: absolute; left: 0; }

/* 狭い幅でも文節と金額を分断しない。紹介の適用月だけ金額の上へ送る。 */
@container psim (max-width: 290px) {
  .psim :is(.radio-option, .checkbox-option) { gap: 8px; padding-inline: 8px; }
  .psim .referral-price small { display: block; }
  .psim .summary-total .amount { font-size: 28px; }
  .psim .notice-box { padding-inline: 10px; }
}
