/* 新しいトップ（public/js/top-moment.js）：売りたいものを書く欄と今日のお題、相手が集まる画面、一週間の画面の置き場所。
   色・字・角は共通の変数（kosei.css）、ボタンは決まった3つの形（parts.css）。一週間の部品そのものの見た目は week-view.css。 */
.tm, .tm-page { --tm-gap: 24px; color: var(--text); font-family: var(--font-sans); font-size: var(--fs-body); line-height: 1.8; text-align: left; }
.tm *, .tm-page * { box-sizing: border-box; min-width: 0; }
.tm :where(p, h1, h2, ul, dl, dd, dt), .tm-page :where(p, h1, h2, ul, dl, dd, dt) { margin: 0; padding: 0; }
.tm :where(ul), .tm-page :where(ul) { list-style: none; }
.tm :where(p, li, dd), .tm-page :where(p, li, dd) { word-break: auto-phrase; }
.tm { max-width: 1280px; margin: 0 auto; padding: 4px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); background: #fff; }
/* 中身の左右は、上の帯の箱にそろえる（main の幅いっぱい。帯も同じ幅：tone.css） */
.tm-page { margin: 0; padding: var(--tm-gap) 0 48px; }

/* 企画を読めなかったときの一言と、もう一度の口 */
.tm-fail { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .35); color: #fff; font-size: var(--fs-body); }
/* 紺の帯：呼びかけ、欄、押したあとに手に入るもの */
.tm-band { display: grid; grid-template-columns: auto minmax(min(460px, 100%), 1fr); align-items: center; gap: 6px 32px; padding: 10px 24px 10px 32px; border-radius: 4px; background: var(--band); color: #fff; }
.tm-askline { font: 800 var(--fs-title)/1.5 var(--font-mincho); letter-spacing: .02em; }
.tm-band .pch-import-note { grid-column: 2; margin: 0; font-size: var(--fs-tag); color: #fff; }
.tm .tm-ask { display: flex; align-items: center; flex-wrap: nowrap; max-width: none; margin: 0; height: auto; min-height: 52px; padding: 0 0 0 16px; border-radius: 2px; overflow: hidden; background: #fff; color: var(--text-muted); }
/* 欄の下の一言（アイデアでない言葉、読めないアドレスなど。.search-hint）が出たら、欄の中で次の行に置く。欄は狭めない */
.tm .tm-ask:has(.search-hint) { flex-wrap: wrap; }
.tm .tm-ask .search-hint { margin: 0 0 var(--s2); }
.tm .tm-ask .pch-go { align-self: stretch; min-height: 52px; border-radius: 0; background: var(--gold); color: var(--brand-12); font-weight: 700; white-space: nowrap; }
@media (max-width: 1180px) {
  .tm-band { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .tm-band .pch-import-note { grid-column: 1; }
}
@media (max-width: 700px) {
  .tm-band { padding: 16px 12px; }
  .tm-askline { white-space: normal; font-size: 1.0625rem; }
  .tm .tm-ask { padding-left: 12px; }
  .tm .tm-ask .pch-glass { display: none; }
  .tm .tm-ask .pch-go { padding: 0 8px; font-size: var(--fs-control); }
  .tm .tm-ask { padding-left: 8px; }
  .tm .tm-ask .pch-clip, .tm .tm-ask [data-voice] { width: 36px; }
}

/* 今日のお題：札、商品の名前、届けたい相手の一行 */
.tm-today { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 12px; padding-bottom: 6px; border-bottom: 3px solid var(--text-head); }
.tm-tag { flex: none; padding: 2px 10px; background: var(--text-head); color: #fff; font-size: var(--fs-note); font-weight: 700; line-height: 1.6; }
.tm-today h1 { font: 800 var(--fs-head)/1.4 var(--font-mincho); color: var(--text-head); }
.tm-who { font-size: var(--fs-note); color: var(--text-muted); text-wrap: balance; }
/* ほかの日のお題：小さな見出しと、曜日だけの丸い札を7つ、1行に（題は左の見出しで見せる。下の一週間の曜日の並びとは違う見た目に） */
.tm-days { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; margin-left: auto; }
.tm-days-label { flex: none; margin-right: 6px; font-size: var(--fs-note); color: var(--text-muted); white-space: nowrap; }
.tm-days button { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-width: 0; min-height: 0; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--text); font: inherit; font-size: var(--fs-note); cursor: pointer; }
.tm-days button:hover { border-color: var(--text-head); }
.tm-days button[aria-pressed='true'], .tm-days button[aria-pressed='true']:hover { background: var(--text-head); border-color: var(--text-head); color: #fff; font-weight: 700; }
@media (max-width: 700px) { .tm-days { margin-left: 0; flex-basis: 100%; gap: 0; justify-content: space-between; } .tm-days { gap: 4px; } .tm-days button { flex: 1 1 0; width: auto; max-width: 44px; height: var(--tap); margin-block: 0; border-radius: 22px; } }
.tm-week { margin-top: 10px; min-height: 60vh; }

/* ほかの二つのラボへ */
.tm-labs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.tm-lab { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; min-height: 64px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.tm-lab b { grid-column: 1; font: 800 var(--fs-lead)/1.5 var(--font-mincho); color: var(--text-head); }
.tm-lab span { grid-column: 1; font-size: var(--fs-note); line-height: 1.5; color: var(--text-muted); }
.tm-lab i { grid-column: 2; grid-row: 1 / span 2; font-style: normal; font-size: 1.25rem; color: var(--text-head); }
.tm-lab:hover { border-color: var(--text-head); }
@media (max-width: 700px) { .tm-labs { grid-template-columns: minmax(0, 1fr); } }

/* 待つあいだの一行 */
.tm-wait { padding: 48px 0; text-align: center; color: var(--text-muted); }

/* 相手が集まる：人数、条件、内訳、主役のボタン。その下に集まった人 */
.tm-g-head { display: grid; gap: 12px; justify-items: start; }
.tm-count strong { font-size: var(--fs-display); }
/* 「3,000人中」は、狭い画面でも出す（相手探しの紺のカードでは省いている） */
.tm-page .tm-count .find-of { display: inline; }
.tm-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: var(--tap); padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tm-tags span { padding: 2px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-note); line-height: 1.7; background: #fff; white-space: nowrap; }
.tm-tags em { font-style: normal; font-size: var(--fs-note); color: var(--text-head); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.tm-dropped { font-size: var(--fs-note); color: var(--text-muted); }
.tm-g-head .find-relax { justify-content: flex-start; margin: 0; }
.tm-split { display: grid; grid-template-columns: repeat(2, minmax(0, 22rem)); gap: 8px 48px; width: 100%; margin-top: 4px; }
.tm-bars { display: grid; gap: 2px; align-content: start; }
.tm-bars dt { font-size: var(--fs-note); font-weight: 700; color: var(--text-head); }
.tm-bars dd { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) 4rem; align-items: center; gap: 8px; font-size: var(--fs-note); line-height: 1.7; }
.tm-bars dd span { white-space: nowrap; }
.tm-bars dd i { display: block; height: 6px; background: var(--line-soft); }
.tm-bars dd u { display: block; height: 100%; background: var(--band); text-decoration: none; }
.tm-bars dd b { font-weight: 400; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-ai { min-height: 1lh; font-size: var(--fs-note); color: var(--text); }
.tm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 4px; }
.tm-actions-end { margin-top: 32px; justify-content: center; }
.tm-page button.primary.tm-go { min-width: 17rem; font-weight: 700; }
.tm-of { width: 100%; margin-top: 20px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font: 800 var(--fs-title)/1.5 var(--font-mincho); color: var(--text-head); }
.tm-people { margin-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; }
.tm-person { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-content: start; gap: 0 12px; width: 100%; min-height: 76px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line-soft); background: none; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.tm-person img { grid-row: 1 / span 3; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--line-soft); }
.tm-person-name { font-size: var(--fs-note); line-height: 1.6; color: var(--text-muted); }
.tm-person-name b { font-size: var(--fs-body); color: var(--text-head); }
.tm-person-name em { margin-left: 8px; padding: 1px 6px; background: var(--band); color: #fff; font-style: normal; font-size: var(--fs-tag); white-space: nowrap; }
/* 一行目：集めた条件に当たる、その人の暮らし。二行目：仕事 */
.tm-person-life { text-wrap: balance; grid-column: 2; font-size: var(--fs-note); line-height: 1.6; color: var(--text); }
.tm-person-life span { display: inline-block; }
.tm-person-line { grid-column: 2; font-size: var(--fs-note); line-height: 1.6; color: var(--text-muted); }
.tm-person:hover .tm-person-name b { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1080px) { .tm-people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .tm-people, .tm-split { grid-template-columns: minmax(0, 1fr); }
  .tm-page button.primary.tm-go { width: 100%; min-width: 0; }
  .tm-actions { width: 100%; }
}

/* 六段の相手探しから、集まった画面へ戻るボタン（find.js closeHTML）：字が増えるぶん、幅だけ */
.find-close.find-close-gather { white-space: nowrap; }

/* 一週間のページ：帯の下の空きを、集まった画面とそろえる。部品の最初の行は文字だけのボタン（押せる範囲が字より上下に広い）なので、そのぶん上へ */
.tm-page > .tm-week { margin-top: calc((1.875rem - var(--tap)) / 2 - 2px); min-height: 0; }

/* 新しい流れの帯（集まる・一週間・待つあいだ）：企画の言葉は、狭い画面でも「…」で切らず、2行まで折り返す */
@media (max-width: 700px) {
  html[data-top='new'] .page-band:has(+ .tm-page) .page-band-eyebrow, html[data-top='new'] .find-new.is-gathering .page-band-eyebrow { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-overflow: clip; letter-spacing: .04em; }
}
/* 待つあいだの帯：右に「戻る」のボタンが無いので、その分の空きを取らない（企画の言葉が切れない） */
html[data-top='new'] body .find-new.is-gathering > .page-band .page-band-in { padding-right: 0; }
.tm-scene-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

/* 待つあいだの画面（find.js gatheringHTML）：顔を並べた上に、白い箱の一言と動く線。ヘッダーと帯は、ほかの画面と同じ */
.tm-gathering { position: relative; display: grid; place-items: center; min-height: 420px; }
.tm-wait-wall { position: absolute; inset: var(--tm-gap) 0 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; max-height: 420px; overflow: hidden; }
/* 待つあいだ、止まって見えないように：顔が、あちこちで一人ずつ順に明るくなる（--turn は、一巡のうちのその顔の番。find.js gatheringHTML） */
.tm-wait-wall img { width: 40px; height: 40px; border-radius: 2px; object-fit: cover; opacity: .45; transition: opacity .3s; animation: tm-wait-look 9s linear infinite; animation-delay: calc(var(--turn, 0s) * -1); }
@keyframes tm-wait-look { 0%, 12%, 100% { opacity: .45; } 4% { opacity: 1; } }
/* 相手の条件が届いたら：条件の札が一つずつ出て、当てはまらない顔が薄くなり、当てはまる顔が残る（find.js narrowDown） */
.tm-gathering:has(.tm-narrow) .tm-wait-wall img { animation: none; opacity: 1; }
.tm-gathering:has(.tm-narrow) .tm-wait-wall img.out { opacity: .1; }
.tm-page .tm-narrow { display: grid; gap: 10px; justify-items: center; text-align: center; }
.tm-narrow p { margin: 0; }
.tm-narrow .tm-tags { justify-content: center; min-height: 0; cursor: default; }
.tm-narrow .tm-tags span:last-child { animation: tm-narrow-in .25s ease-out; }
@keyframes tm-narrow-in { from { opacity: 0; transform: translateY(4px); } }
/* 待った秒数は小さく（出る前から一行ぶんを空けておく：出たときに箱が伸びない） */
.find-wait-new .tm-wait-sec { min-height: 1.4em; font-size: var(--fs-note); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .tm-wait-wall img { animation: none; opacity: .55; transition: none; } }
.tm-page .tm-wait-box { position: relative; width: min(520px, 100%); margin: 0; padding: 22px 28px; background: #fff; border: 3px solid var(--brand-12, #0c1030); box-shadow: 0 8px 24px rgba(12, 16, 48, .15); }
/* 読めなかったあと、欄に残った企画の言葉が1字だけ折れないように */
.tm .tm-ask textarea { text-wrap: pretty; }

/* いちばん上：ペルコモとは（上の線のすぐ下）→ 問い（間をあける）→ 紺の帯 → お題。説明と問いは小さくしすぎない。紺の四角の札は、今日のお題の一つだけ。
   句ごとに span を inline-block にして、語の途中で折れないようにする */
.tm { padding-top: 0; }
.tm-what { margin: -14px 0 0; font-size: var(--fs-body); line-height: 1.7; color: var(--text-head); }
.tm-what b { font-weight: 800; margin-right: .5em; }
.tm-what span, .tm-q span, .tm-who span, .tm-askline span { display: inline-block; }
.tm-q { margin: 30px 0 16px; font: 800 clamp(1.625rem, 3.1vw, 2.375rem)/1.3 var(--font-sans, 'LINE Seed JP', sans-serif); color: var(--text-head); letter-spacing: .01em; }
.tm-band { padding-block: 16px; }
.tm-today { align-items: center; gap: 6px 14px; margin-top: 28px; padding-bottom: 10px; }
.tm-today h1 { font-family: var(--font-sans, 'LINE Seed JP', sans-serif); line-height: 1.35; }
.tm-today .tm-who { flex: 1 1 100%; margin: 0; font-size: var(--fs-body); line-height: 1.7; color: var(--text-head); text-wrap: pretty; }
.tm-days { flex: 1 1 100%; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.tm-days-label { margin-right: 4px; }
.tm-days button { width: auto; height: auto; padding: 5px 12px; border-radius: 2px; font-size: var(--fs-note); line-height: 1.5; }
@media (max-width: 700px) {
  .tm-what { font-size: var(--fs-note); }
  .tm-q { margin: 18px 0 12px; font-size: 1.375rem; }
  .tm-today { margin-top: 20px; }
  .tm-days { flex-wrap: wrap; justify-content: flex-start; }
  .tm-days button { flex: none; max-width: none; height: auto; min-height: 36px; border-radius: 2px; white-space: nowrap; }
}

/* 集まった画面の「相手をくわしく選び直す」：脇役のボタンと一行の説明（朱色の塗りは主役の一つだけ） */
.tm-reselect { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.tm-reselect p { flex: 1 1 18em; font-size: var(--fs-note); color: var(--text-muted); text-wrap: pretty; }

/* 下のほうの小さな「ペルコモとは」 */
.tm-about { display: grid; gap: 6px; max-width: 46rem; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: var(--fs-note); color: var(--text-muted); }
.tm-about h2 { font: 800 var(--fs-body)/1.5 var(--font-sans); color: var(--text-head); }
.tm-about p { text-wrap: pretty; }
/* 文中リンクの形は人物紹介の .pf-doc-link と同じ（下線）。その CSS は color-mix で下線の色を決めていて、トップを画像にする道具（html2canvas）が読めず止まるので、ここでは色を決めず字の色のままにする */
.tm-about-link { all: unset; cursor: pointer; font-size: var(--fs-note); line-height: 1.7; color: inherit; text-decoration: underline; text-underline-offset: .2em; }
.tm-about-link:focus-visible { outline: 2px solid var(--focus, #2b6cb0); outline-offset: 2px; }
@media (max-width: 767px) { .tm-about-link { display: inline-flex; align-items: center; min-height: 2.75rem; } }
.tm-about-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 4px; }
.tm-about + .tm-labs { margin-top: 24px; }

/* 一週間の部品との間（広い画面） */
@media (min-width: 701px) {
  .tm-week { margin-top: 4px; }
}

/* 相手が集まる画面：紺の帯と人数の行のあいだを、トップの帯とお題のあいだ（28px）に近づける */
.tm-gather { margin-top: -8px; padding-top: 4px; }
.tm-gather .tm-count { line-height: 1.4; }
.tm-days > .pill-br { flex: 0 0 100%; height: 0; margin: -6px 0 0; }
