/* マットレス6社（taste で作り直した画面・inc/taste-page.php）。クラスはすべて tm- から始め、テーマの部品とぶつけない。
   見本：docs/design-mock/taste-mattress/m3-mix/（本人OK 2026-10-19）。白地＋紺＋緑1色・Dela Gothic One＋BIZ UDPゴシック。 */
.tm {
  --bg: #f7f8fa;
  --surface: #e6e9ee;
  --white: #ffffff;
  --ink: #14213d;
  --muted: #4a5468;
  --accent: #1f7a4d;
  --accent-deep: #17603c;
  --font-display: "Dela Gothic One", "BIZ UDPGothic", sans-serif;
  --font-text: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", sans-serif;
  /* 文字は5段だけ */
  --s-small: 16px;
  --s-body: 18px;
  --s-lead: clamp(20px, 1.1rem + .6vw, 24px);
  --s-head: clamp(28px, 1.2rem + 1.8vw, 40px);
  --s-display: clamp(40px, 1rem + 5.4vw, 88px);
  --margin: clamp(1rem, 3vw, 3rem);
  --r-l: 32px;
  --r-m: 24px;
  --r-s: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
.tm, .tm *, .tm *::before, .tm *::after { box-sizing: border-box; }
.tm { background: var(--bg); color: var(--ink); font-family: var(--font-text); font-size: var(--s-body); line-height: 1.7; }
.tm h1, .tm h2, .tm h3 { font-family: var(--font-display); font-weight: 400; margin: 0; padding: 0; border: 0; background: none; letter-spacing: 0; color: inherit; word-break: auto-phrase; text-wrap: balance; }
.tm h1::before, .tm h1::after, .tm h2::before, .tm h2::after { content: none; }
.tm h1 { font-size: var(--s-display); line-height: 1.2; }
.tm h2 { font-size: var(--s-head); line-height: 1.3; }
.tm p, .tm figure, .tm ul, .tm ol, .tm dl { margin: 0; }
.tm img { display: block; max-width: 100%; height: auto; }
.tm a { color: inherit; }
.tm :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.tm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tm-nm { font-family: var(--font-display); font-size: var(--s-lead); line-height: 1.2; }
.tm-src { font-size: var(--s-small); }

/* ボタン（自前の案内）と、広告のボタン（A8のテキスト素材をそのまま・見た目は外側に付ける） */
.tm-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--accent); color: #fff !important; font-family: var(--font-text); font-size: var(--s-body); font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color .18s, transform .14s var(--ease); }
.tm-btn:hover { background: var(--accent-deep); }
.tm-btn:active { transform: scale(.97); }
.tm .tm-cta { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tm .tm-cta a { display: inline-flex; align-items: center; min-height: 56px; padding: 0 28px; border-radius: 999px; background: var(--accent); color: #fff; font-size: var(--s-body); font-weight: 700; text-decoration: none; transition: background-color .18s, transform .14s var(--ease); }
.tm .tm-cta a:hover { background: var(--accent-deep); }
.tm .tm-cta a:active { transform: scale(.97); }
.tm .tm-cta img { width: 1px; height: 1px; }
.tm .tm-cta .ad-mark { color: var(--muted); font-size: var(--s-small); background: none; border: 0; padding: 0; }

/* 入力 */
.tm-q { border: 0; margin: 0; padding: 0; min-width: 0; }
.tm-q legend, .tm-lb { display: block; font-weight: 700; margin-bottom: 8px; padding: 0; }
.tm-daynum { font-family: var(--font-display); font-size: var(--s-head); line-height: 1; }
.tm input[type=range] { width: 100%; height: 48px; accent-color: var(--accent); }
.tm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-chips input { position: absolute; opacity: 0; }
.tm-chips span { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; background: var(--white); border-radius: 999px; font-weight: 700; cursor: pointer; transition: background-color .18s, color .18s, transform .14s var(--ease); }
.tm-chips input:checked + span { background: var(--ink); color: var(--bg); }
.tm-chips input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.tm-chips span:active { transform: scale(.96); }

/* 1画面目：左に文字と計算、右に写真 */
.tm-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding: clamp(16px, 3vw, 32px) var(--margin) clamp(32px, 5vw, 56px); }
@media (min-width: 60em) { .tm-hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: center; } }
.tm-hero__body { display: grid; gap: 20px; }
.tm-hero__num { display: flex; align-items: flex-end; gap: 16px; }
.tm-huge { font-family: var(--font-display); font-size: var(--s-display); line-height: .9; color: var(--accent); }
.tm-hero__num p { font-weight: 700; font-size: var(--s-lead); line-height: 1.4; padding-bottom: 8px; }
.tm-hero__why b { background: var(--surface); padding: 0 .25em; }
.tm-hero__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-l); }
@media (max-width: 59.99em) { .tm-hero__photo { order: -1; } .tm-hero__photo img { aspect-ratio: 4 / 3; } }
.tm-mini { display: grid; gap: 16px; background: var(--surface); padding: 24px; border-radius: var(--r-m); }
.tm-mini .tm-btn { justify-self: start; }
.tm-answer { font-size: var(--s-lead); font-weight: 700; line-height: 1.5; }
.tm-answer b { color: var(--accent); }

/* 目次 */
.tm-toc { padding: 0 var(--margin) 40px; }
.tm-toc ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 60em) { .tm-toc ol { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.tm-toc a { display: grid; gap: 4px; height: 100%; padding: 16px; border-radius: var(--r-s); background: var(--white); text-decoration: none; transition: background-color .18s, transform .14s var(--ease); }
.tm-toc a:hover { background: var(--surface); }
.tm-toc a:active { transform: scale(.97); }
.tm-toc b { font-family: var(--font-display); font-weight: 400; font-size: var(--s-body); line-height: 1.3; }
.tm-toc span { color: var(--muted); font-size: var(--s-small); }

/* なぜこの6社か */
.tm-why6 { padding: clamp(40px, 6vw, 80px) var(--margin) 0; }
.tm-why6 h2 { margin-bottom: 24px; }
.tm-why6__body { display: grid; gap: 24px; }
@media (min-width: 60em) { .tm-why6__body { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: center; } }
.tm-why6__list { margin: 0; padding-left: 1.5em; display: grid; gap: 16px; }
.tm-why6__list b { display: block; font-size: var(--s-lead); line-height: 1.4; }
.tm-why6__list span { color: var(--muted); }
.tm-why6__sum { font-weight: 700; font-size: var(--s-lead); line-height: 1.6; background: var(--surface); border-radius: var(--r-m); padding: 24px; }

/* 2問で1社 */
.tm-pick { padding: clamp(64px, 8vw, 112px) var(--margin); display: grid; gap: 32px; }
@media (min-width: 60em) { .tm-pick { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; } }
.tm-pick form { display: grid; gap: 24px; }
.tm-pick__res { background: var(--accent); color: #fff; border-radius: var(--r-l); padding: clamp(24px, 3vw, 40px); display: grid; gap: 16px; }
.tm-pick__lb { font-weight: 700; font-size: var(--s-lead); }
.tm-pick__name { font-family: var(--font-display); font-size: var(--s-head); line-height: 1.1; }
.tm-pick__why { font-size: var(--s-lead); line-height: 1.5; }
.tm-pick__warn { background: rgba(255, 255, 255, .14); border-radius: var(--r-s); padding: 12px 16px; }
.tm .tm-pick__res .tm-cta a { background: #fff; color: var(--ink); }
.tm .tm-pick__res .tm-cta a:hover { background: var(--surface); }
.tm .tm-pick__res .tm-cta .ad-mark { color: #fff; }
.tm-pick__cta[hidden] { display: none; }

/* こんな人は */
.tm-who { padding: 0 var(--margin) clamp(64px, 8vw, 112px); }
.tm-who h2 { margin-bottom: 24px; }
.tm-who__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 60em) { .tm-who__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tm-who__list li { background: var(--white); border-radius: var(--r-m); padding: 24px; display: grid; gap: 8px; align-content: start; }
.tm-who__yes { font-weight: 700; font-size: var(--s-lead); line-height: 1.5; }
.tm-who__no { color: var(--muted); }
.tm-who__no b { color: var(--ink); }

/* 1日あたり（紺の面） */
.tm-day { background: var(--ink); color: var(--bg); padding: clamp(64px, 8vw, 112px) var(--margin); }
.tm-day__head { display: grid; gap: 24px; margin-bottom: 40px; }
@media (min-width: 60em) { .tm-day__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 48px; } }
.tm-day .tm-chips span { background: #26345a; color: var(--bg); }
.tm-day .tm-chips input:checked + span { background: var(--bg); color: var(--ink); }
.tm-day input[type=range] { accent-color: #7fd1a6; }
.tm-yr-own[hidden] { display: none; }
.tm-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.tm-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 32px; background: var(--bg); color: var(--ink); border-radius: var(--r-m); padding: 24px; }
@media (min-width: 60em) { .tm-item { grid-template-columns: 12rem minmax(0, 1fr) 19rem; align-items: center; } }
.tm-yen { font-family: var(--font-display); font-size: var(--s-head); line-height: 1; color: var(--accent); }
.tm-yen small { font-family: var(--font-text); font-weight: 700; font-size: var(--s-body); color: var(--ink); }
.tm-price { color: var(--muted); margin-top: 8px; }
.tm-feats { margin-top: 12px !important; padding-left: 1.25em; }
.tm-feats li + li { margin-top: 4px; }
.tm-warranty { font-weight: 700; margin-top: 8px; }
.tm-buy { display: grid; gap: 12px; justify-items: start; }
.tm-buy .tool-banner, .tm-buy figure { margin: 0; }
.tm-day__note { margin-top: 24px; color: #c9cfdb; max-width: 60ch; font-size: var(--s-small); }

/* たたむ節（古いマットレス・お手入れ） */
.tm-fold { margin: 0 var(--margin); border-radius: var(--r-m); background: var(--white); }
.tm-fold + .tm-fold { margin-top: 16px; }
#old { margin-top: clamp(64px, 8vw, 112px); }
.tm-fold summary { list-style: none; cursor: pointer; display: grid; gap: 4px; padding: 24px 64px 24px 24px; position: relative; border-radius: var(--r-m); transition: background-color .18s; }
.tm-fold summary::-webkit-details-marker { display: none; }
.tm-fold summary::after { content: "＋"; position: absolute; right: 24px; top: 50%; transform: translateY(-50%); font-family: var(--font-display); font-size: var(--s-head); line-height: 1; color: var(--accent); transition: transform .24s var(--ease); }
.tm-fold[open] summary::after { content: "－"; }
.tm-fold summary:hover { background: var(--surface); }
.tm-fold__q { font-family: var(--font-display); font-size: var(--s-head); line-height: 1.3; }
.tm-fold__hint { color: var(--muted); }
.tm-fold__body { padding: 0 24px 32px; display: grid; gap: 24px; }
.tm-old, .tm-care { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 60em) { .tm-old { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tm-care { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tm-old li, .tm-care li { background: var(--bg); border-radius: var(--r-s); padding: 24px; display: grid; gap: 8px; align-content: start; }
.tm-fee { font-family: var(--font-display); font-size: var(--s-lead); line-height: 1.2; color: var(--accent); }
.tm-old a { font-weight: 700; }
.tm-city { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tm-city input, .tm-total input { min-height: 48px; font-size: var(--s-body); padding: 0 12px; border: 2px solid var(--ink); border-radius: var(--r-s); background: #fff; color: var(--ink); }
.tm-city input { width: 12rem; }
.tm-total input { width: 9rem; }
.tm-total { display: grid; gap: 16px; background: var(--surface); border-radius: var(--r-s); padding: 24px; }
@media (min-width: 60em) { .tm-total { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; align-items: center; } }
.tm-total__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tm-total__list li { display: flex; justify-content: space-between; gap: 16px; font-weight: 700; }
.tm-total__list b { font-family: var(--font-display); font-weight: 400; color: var(--accent); }
.tm-care__who { color: var(--muted); }
.tm-care__q { font-family: var(--font-display); font-size: var(--s-lead); line-height: 1.4; }
.tm-care__more { font-weight: 700; }

/* 返品の表 */
.tm-ret { padding: clamp(64px, 8vw, 112px) var(--margin); }
.tm-ret h2 { margin-bottom: 24px; }
.tm-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--r-m); overflow: hidden; }
.tm-table th, .tm-table td { text-align: left; padding: 16px 20px; border: 0; border-bottom: 2px solid var(--surface); vertical-align: top; }
.tm-table th { background: var(--surface); }
.tm-table tr.is-ok [data-out=state], .tm-table tr.is-ok [data-out=cost] { color: var(--accent); font-weight: 700; }
.tm-table tr:not(.is-ok) { color: #566072; }
@media (max-width: 47.99em) {
  .tm-table thead { display: none; }
  .tm-table tr { display: grid; grid-template-columns: 1fr auto; padding: 16px 20px; border-bottom: 2px solid var(--surface); }
  .tm-table td { padding: 0; border: 0; }
  .tm-table td[data-out=note] { grid-column: 1 / -1; }
}
.tm-ret__note { margin-top: 16px; }

/* 最後の写真（1枚） */
.tm-last { padding: 0 var(--margin); }
.tm-last img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--r-l); }
.tm-credits { padding: 24px var(--margin) 48px; color: var(--muted); font-size: var(--s-small); max-width: 60ch; }

/* テーマとのつなぎ（ラボルで本番に出して分かったこと） */
.tp-mattress .l-main { padding: 0; }
.tp-mattress .site-header__ad { color: inherit; }

/* 動き：節が見えたら下から出る。スクリプトが無い・動きを減らす設定では最初から出ている */
@media (prefers-reduced-motion: no-preference) {
  .tm-js [data-rise] { opacity: 0; transform: translateY(18px); animation: tm-rise .8s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
  .tm-js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .9s var(--ease); }
  .tm-js [data-reveal].is-in { opacity: 1; transform: none; }
}
@keyframes tm-rise { to { opacity: 1; transform: none; } }
