@charset "utf-8";

/* ==================================================================
   トイレのいっぽ v1 - スタイル
   ライトテーマ固定（OSのダークモードには追従しない）
   外部フォント・外部リソースは一切読み込まない
   ================================================================== */

:root {
  color-scheme: light;

  --paper: #fffdf7;
  --cream: #fff6dc;
  --card: #ffffff;
  --ink: #3b3129;
  --ink-soft: #5c5046;
  --muted: #7b6f63;

  --brand: #c96f4a;          /* コーラル系アクセント */
  --brand-dark: #a9542f;
  --brand-soft: #fdeee6;

  --green: #2f7d5c;
  --green-soft: #e7f4ec;
  --green-line: #b9dcc8;

  --amber: #b4801e;
  --amber-soft: #fdf2d8;
  --amber-line: #ecd396;

  --gray-soft: #f1efe9;
  --gray-line: #ddd6cb;

  --line: #e6ded1;
  --focus: #2f6ea5;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(90, 70, 50, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", Meiryo, system-ui,
    sans-serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: break-word;
  word-break: normal;
}

h1, h2, h3, h4, p, ul, ol, dl, figure {
  margin: 0;
}

ul, ol {
  padding-left: 1.4em;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- ヘッダー / フッター ---------- */

.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.site-header__logo {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand-dark);
}

.site-header__sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer {
  max-width: 760px;
  margin: 8px auto 0;
  padding: 20px 18px 40px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer p + p {
  margin-top: 4px;
}

/* ---------- 画面 ---------- */

main {
  display: block;
}

.screen {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 18px 8px;
}

.screen[hidden] {
  display: none;
}

/*
 * display を持つブロックは UA の [hidden]{display:none} に勝ってしまうため、
 * hidden 属性で出し分けるものは必ずここで打ち消す。
 */
.tabs[hidden],
.actions[hidden] {
  display: none;
}

.screen__title {
  font-size: 1.35rem;
  line-height: 1.5;
  margin: 4px 0 12px;
  color: var(--ink);
}

.screen__title:focus {
  outline: none;
}

.section-title {
  font-size: 1.08rem;
  margin: 26px 0 10px;
  padding-left: 12px;
  border-left: 5px solid var(--brand);
  line-height: 1.5;
}

.lead {
  margin-bottom: 12px;
  color: var(--ink-soft);
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.notice {
  background: var(--brand-soft);
  border: 1px solid #f2d6c7;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--brand-dark);
  margin-bottom: 16px;
}

/* ---------- カード ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 14px;
}

.card--plain {
  box-shadow: none;
  background: var(--cream);
  border-color: #f0e2bf;
}

.card--accent {
  background: var(--green-soft);
  border-color: var(--green-line);
  box-shadow: none;
}

.card__title {
  font-size: 1rem;
  margin-bottom: 8px;
}

.steplist {
  margin: 0 0 10px;
  color: var(--ink-soft);
}

/* ---------- ボタン ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 8px;
}

.actions--end {
  justify-content: flex-end;
}

.btn {
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--gray-soft);
  cursor: pointer;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  flex: 1 1 auto;
}

.btn--primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn--primary:disabled {
  background: #e7dbd2;
  border-color: #e7dbd2;
  color: #9a8d83;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  border-color: var(--gray-line);
  color: var(--ink-soft);
}

.btn--ghost:hover {
  background: var(--gray-soft);
}

.btn--link {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  text-decoration: underline;
  padding: 12px 8px;
  font-weight: 500;
}

/* ---------- 環境タブへのバナー（トップ画面） ---------- */

.envbanner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  margin-top: 14px;
  padding: 12px 14px;
  text-align: left;
  background: var(--amber-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.envbanner:hover {
  background: var(--cream);
  border-color: var(--amber-line);
}

.envbanner:active {
  background: var(--cream);
  border-color: var(--brand);
}

.envbanner__thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--cream);
  border: 1px solid var(--line);
}

.envbanner__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.envbanner__title {
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1.5;
}

.envbanner__sub {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}

.envbanner__arrow {
  flex: 0 0 auto;
  color: var(--brand);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
}

/* ---------- 進捗 ---------- */

.progress {
  margin-bottom: 14px;
}

.progress__text {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress__text strong {
  color: var(--brand-dark);
  font-size: 1rem;
}

.progress__bar {
  height: 8px;
  background: var(--gray-soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress__fill {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}

/* ---------- 選択肢 ---------- */

.fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fieldset__q {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  line-height: 1.6;
  color: var(--ink-soft);
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.option:hover {
  border-color: #ecd3c4;
}

.option input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.option__text {
  flex: 1 1 auto;
}

.option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.option:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- 発達の準備チェック ---------- */

.rgroup {
  margin-bottom: 18px;
}

.rgroup--sub {
  margin-top: 22px;
  margin-bottom: 0;
}

.rgroup__title {
  font-size: 0.95rem;
  color: var(--brand-dark);
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  margin-bottom: 10px;
}

.ritem {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 12px 14px;
  margin: 0 0 10px;
  min-inline-size: 0;
}

.ritem__label {
  display: block;
  margin-bottom: 10px;
  line-height: 1.6;
}

.ritem__no {
  display: inline-block;
  min-width: 1.8em;
  color: var(--muted);
  font-size: 0.85rem;
}

.choices {
  display: flex;
  gap: 8px;
}

.choice {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 8px 6px;
  border: 2px solid var(--gray-line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 0.92rem;
  text-align: center;
}

.choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- タブ ---------- */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--line);
}

.tabs__btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-weight: 600;
}

.tabs__btn.is-current {
  color: var(--brand-dark);
  border-bottom-color: var(--brand);
}

/* ---------- タイプ表示 ---------- */

.typecard {
  border: 1px solid var(--line);
  border-left: 6px solid var(--brand);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.typecard + .typecard {
  margin-top: 12px;
}

.typecard__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.typecard__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
}

.typecard__name {
  font-size: 1.05rem;
  font-weight: 700;
}

.typecard__desc {
  color: var(--ink-soft);
}

.subhead {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 14px 0 6px;
}

.bullets {
  margin: 0;
  color: var(--ink-soft);
}

.bullets li + li {
  margin-top: 6px;
}

/* ---------- 準備マップ ---------- */

.map {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 6px 16px 14px;
  box-shadow: var(--shadow);
}

.map__cat {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 14px 0 6px;
}

.map__item {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.map__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.map__label {
  flex: 1 1 auto;
  line-height: 1.6;
}

.badge {
  flex: 0 0 auto;
  display: inline-block;
  min-width: 6.4em;
  text-align: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge--yes {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green);
}

.badge--no {
  background: var(--amber-soft);
  border-color: var(--amber-line);
  color: var(--amber);
}

.badge--unknown {
  background: var(--gray-soft);
  border-color: var(--gray-line);
  color: var(--muted);
}

/* 補足アドバイスの箱（準備マップの一言／環境カードのひとこと） */
.map__advice,
.envcard__tip {
  padding: 10px 12px;
  background: var(--amber-soft);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: #6c5322;
  line-height: 1.7;
}

.map__advice {
  margin-top: 8px;
}

.map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- 乖離メッセージ ---------- */

.gap__label {
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 4px;
}

/* ---------- アコーディオン（ヒント） ---------- */

.acc {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.acc + .acc {
  margin-top: 12px;
}

.acc__summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  background: var(--cream);
}

.acc__summary::-webkit-details-marker {
  display: none;
}

.acc__summary::after {
  content: "＋";
  margin-left: auto;
  color: var(--brand-dark);
  font-weight: 700;
}

.acc[open] .acc__summary::after {
  content: "−";
}

.acc__body {
  padding: 4px 18px 18px;
}

/* ---------- ステップ ---------- */

.week {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.week__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--brand-soft);
  border: 1px solid #f2d6c7;
  border-radius: var(--radius-md);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.6;
}

.stepno {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.steps__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  background: #fff;
  line-height: 1.6;
}

.steps__item + .steps__item {
  border-top: 1px solid var(--line);
}

.steps__item .stepno {
  background: var(--gray-soft);
  color: var(--ink-soft);
  width: 26px;
  height: 26px;
}

.steps__item.is-week .stepno {
  background: var(--brand);
  color: #fff;
}

/* ---------- おすすめのトイレ環境（v1.2） ---------- */

.actions--start {
  justify-content: flex-start;
  margin-top: 0;
}

/* .card との合成。ここには .card との差分だけを置く */
.envcard {
  padding: 14px;
}

.envcard + .envcard {
  margin-top: 16px;
}

/*
 * 画像は本体が assets/env/ に配置する。
 * 未配置でも枠が潰れないよう、比率固定＋生成り背景の箱にして
 * その中に alt テキストが出るようにしている。
 */
.envcard__figure {
  margin: 0 0 12px;
  aspect-ratio: 3 / 2;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.envcard__img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  display: block;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.envcard__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  padding: 0 4px;
}

.envcard__text {
  color: var(--ink-soft);
  padding: 0 4px;
}

.envcard__tip {
  margin: 12px 4px 0;
}

.envcard__tiplabel {
  font-weight: 700;
  margin-right: 6px;
}

.env-cta {
  margin-top: 24px;
}

/* ---------- 相談の目安 ---------- */

.consult {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.consult__heading {
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.6;
}

.consult__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.consult__row {
  border-top: 1px dashed var(--line);
  padding: 9px 0;
  line-height: 1.6;
}

.consult__where {
  color: var(--brand-dark);
  font-weight: 700;
}

.consult__note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- プラン ---------- */

.plan-meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.planblock {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 14px 18px 18px;
  box-shadow: var(--shadow);
}

.planblock + .planblock {
  margin-top: 16px;
}

.planblock__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.plan-footer {
  margin-top: 18px;
  font-weight: 600;
}

/* ---------- レスポンシブ ---------- */

@media (max-width: 420px) {
  body {
    font-size: 15.5px;
  }

  .screen {
    padding: 16px 14px 8px;
  }

  .screen__title {
    font-size: 1.2rem;
  }

  .choices {
    gap: 6px;
  }

  .choice {
    font-size: 0.86rem;
    padding: 8px 2px;
  }

  .badge {
    min-width: 5.8em;
    font-size: 0.75rem;
  }

  .btn {
    padding: 12px 16px;
  }
}

@media (min-width: 900px) {
  .screen {
    padding: 28px 24px 12px;
  }

  .screen__title {
    font-size: 1.5rem;
  }
}

/* ---------- 印刷（A4縦・プラン画面のみ） ---------- */

@page {
  size: A4 portrait;
  margin: 14mm;
}

@media print {
  body {
    background: #fff;
    font-size: 10.5pt;
    line-height: 1.6;
  }

  .site-header,
  .site-footer,
  .no-print,
  .actions {
    display: none !important;
  }

  .screen {
    max-width: none;
    padding: 0;
  }

  .card,
  .planblock,
  .consult,
  .map,
  .typecard,
  .acc {
    box-shadow: none;
    border-color: #bbb;
  }

  .planblock,
  .week__item,
  .steps,
  .consult,
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .section-title {
    break-after: avoid;
    page-break-after: avoid;
  }

  .stepno {
    background: #eee !important;
    color: #222 !important;
    border: 1px solid #999;
  }

  .week__item {
    background: #fff;
    border-color: #999;
  }

  .plan-footer {
    background: #fff;
    border-color: #999;
  }
}
