/* 「〇〇さんとして受け取ってみる」（public/js/receive.js）。いつもの対話（白地、相手が AI）と役が逆なので、
   山吹のうすい地と上の帯で、いまはあなたが相手だと分かるようにする。 */
:root {
  --receive-ground: var(--warn-1);
  --receive-paper: #ffffff;
  --receive-band: var(--warn-3);
  --receive-ink: var(--warn-11);
  --receive-line: var(--warn-5);
}

/* 入口：対話の書く欄の上、最初の質問の前に */
.receive-entry {
  margin: 0 0 var(--space-2);
}
.receive-start {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 0.25em;
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--receive-line);
  border-radius: var(--radius-composer, 18px);
  background: var(--receive-ground);
  color: var(--receive-ink);
  font: inherit;
  font-size: var(--type-body);
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  cursor: pointer;
}
.receive-start-sub {
  font-size: var(--type-note);
  font-weight: 400;
}
@media (hover: hover) {
  .receive-start:hover {
    background: var(--warn-2);
  }
}
.receive-start:focus-visible {
  outline: 2px solid var(--receive-ink);
  outline-offset: 2px;
}

/* 受け取っている間：対話の3列をやめ、1列に */
body.is-chat .cv.receiving {
  grid-template-columns: minmax(0, 1fr);
}
body.is-chat .cv .chat-main.receive {
  background: var(--receive-ground);
}
.receive-band {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: none;
  padding: var(--space-2) var(--space-4);
  background: var(--receive-band);
  color: var(--receive-ink);
  font-size: var(--type-body);
  line-height: 1.5;
}
.receive-band .portrait {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-face, 50%);
  object-fit: cover;
  object-position: center 18%;
}
.receive-band-text {
  flex: 1;
  min-width: 0;
}
.receive-band b {
  font-weight: 700;
}
.receive-band.back {
  background: var(--surface-quiet);
  color: var(--text);
}
.receive-band .receive-skip {
  flex: none;
  color: var(--receive-ink);
}

.receive-log {
  flex: 1;
  min-height: 3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.receive-thread {
  max-width: 46rem;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-4);
}
.receive-turn {
  margin: 0 0 var(--space-5);
}
.receive-turn p {
  margin: 0 0 var(--space-3);
  font-size: var(--type-body-lg);
  line-height: 1.9;
  word-break: auto-phrase;
}
.receive-turn p:last-child {
  margin-bottom: 0;
}
.receive-who {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  margin: 0 0 var(--space-2);
  font-size: var(--type-note);
  color: var(--text-quiet);
}
.receive-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.receive-turn.guide {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--receive-line);
  border-radius: var(--radius-composer, 18px);
  background: var(--receive-paper);
}
.receive-q {
  font-weight: 600;
  color: var(--receive-ink);
}
.receive-plan {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--receive-line);
  background: var(--receive-ground);
  font-size: var(--type-body-lg);
  line-height: 1.85;
}
.receive-turn.you {
  width: fit-content;
  max-width: 85%;
  margin-left: auto;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-composer, 18px);
  background: var(--receive-band);
}
.receive-turn.you p {
  font-size: var(--type-body);
}
.receive-dots {
  color: var(--text-faint);
}

/* お金の物差し */
.receive-money {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: 12px;
  background: var(--receive-ground);
}
.receive-money .receive-money-h {
  margin-bottom: var(--space-1);
  font-size: var(--type-note);
  color: var(--text-quiet);
}
.receive-money p {
  font-size: var(--type-body);
}
.receive-asks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
}
.receive-asks > span {
  flex-basis: 100%;
}
.receive-ask {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.receive-ask input {
  width: 4.5em;
  min-height: var(--tap);
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  text-align: right;
}
.receive-formula {
  font-variant-numeric: tabular-nums;
}

/* 書く欄（対話の書く欄と同じ形、地の色だけ変える） */
.receive-dock {
  flex: none;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0.5rem 1rem max(0.5rem, env(safe-area-inset-bottom));
}
.receive-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2) var(--space-2) var(--space-4);
  border: 1px solid var(--receive-line);
  border-radius: var(--radius-composer, 18px);
  background: var(--receive-paper);
  box-shadow: var(--shadow-field);
}
.receive-composer:focus-within {
  border-color: var(--receive-ink);
}
.receive-composer textarea {
  width: 100%;
  min-height: 2.75rem;
  max-height: 12rem;
  margin: 0;
  padding: var(--space-1) var(--space-2) 0 0;
  border: 0;
  outline: 0;
  background: none;
  box-shadow: none;
  font: inherit;
  font-size: var(--type-body-lg);
  line-height: 1.7;
  field-sizing: content;
  resize: none;
}
.receive-composer button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-face, 50%);
  background: var(--receive-ink);
  color: #ffffff;
  font-size: var(--type-body-lg);
  cursor: pointer;
}
.receive-composer button:disabled {
  opacity: 0.35;
}
.receive-dock .chat-caution {
  margin: var(--space-1) 0 0;
  font-size: var(--type-note);
  color: var(--text-faint);
  text-align: center;
}

/* 出口 */
.receive-exit {
  margin: var(--space-2) 0 var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-composer, 18px);
  background: var(--surface);
}
.receive-exit h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--type-title);
  line-height: var(--leading-title);
}
.receive-exit > p {
  margin: 0 0 var(--space-3);
  font-size: var(--type-body-lg);
  line-height: 1.9;
}
.receive-said,
.receive-record {
  margin: 0 0 var(--space-4);
  font-size: var(--type-body);
}
.receive-said summary,
.receive-record summary {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-quiet);
}
.receive-said summary::before,
.receive-record summary::before {
  content: '▸';
  margin-right: 0.5em;
}
.receive-said[open] summary::before,
.receive-record[open] summary::before {
  content: '▾';
}
.receive-said ol,
.receive-record ol {
  margin: var(--space-2) 0;
  padding-left: 1.5em;
  line-height: 1.8;
}
.receive-record {
  padding: 0 var(--space-4);
  border-radius: 12px;
  background: var(--receive-ground);
}
.receive-exit-go {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  margin: 0 0 var(--space-2);
}

body.is-chat .cv.receiving .head-clues {
  display: none;
}
.receive-skip-short {
  display: none;
}
.receive-band-text b {
  white-space: nowrap;
}
@media (max-width: 767px) {
  .receive-skip-long {
    display: none;
  }
  .receive-skip-short {
    display: inline;
  }
  .receive-band {
    padding: var(--space-2) var(--space-3);
    font-size: var(--type-note);
  }
  .receive-thread {
    padding: var(--space-4) var(--space-3);
  }
  .receive-turn.guide {
    padding: var(--space-3) var(--space-4);
  }
  .receive-turn p,
  .receive-plan {
    font-size: var(--type-body);
  }
  .receive-exit {
    padding: var(--space-4);
  }
  .receive-exit-go .primary {
    width: 100%;
  }
  .receive-dock {
    padding: 0.375rem 0.5rem max(0.375rem, env(safe-area-inset-bottom));
  }
}

/* ── 紺と金のトンマナ（斉藤さん 2026-10-25「帯だけでなく、ボタンやカラー、すべて」）。新しいトップから来た人だけ。
 * 山吹の地をやめ、役が逆なことは上の紺の帯（名前は金）で分ける。地は淡い灰、問いの札は白、線は灰。 */
html[data-top='new'] {
  --receive-ground: var(--surface-quiet);
  --receive-paper: var(--surface);
  --receive-band: var(--brand-12);
  --receive-ink: var(--brand-12);
  --receive-line: var(--line);
}
html[data-top='new'] .receive-band {
  color: #fff;
}
html[data-top='new'] .receive-band b {
  color: var(--gold);
}
html[data-top='new'] .receive-start {
  border-color: var(--gold);
  background: var(--surface);
}
@media (hover: hover) {
  html[data-top='new'] .receive-start:hover {
    background: var(--surface-quiet);
  }
}
