/* 使い方は X のタイムラインに寄せ、見た目は別物にする（温かみのある白とインクの黒、差し色は青緑、話題名もゴシック）。
   X のロゴや名前、認証マークのような X 自身の印は使わない */
:root {
  --bg: #faf8f4;
  --surface: #faf8f4;
  --surface-2: #f1eee7;
  --text: #22201c;
  --muted: #706b62;
  --line: #e6e1d8;
  --line-strong: #cdc6ba;
  --accent: #2c7a6f;
  --like: #2c7a6f;
  --danger: #b4452f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1917; --surface: #1a1917; --surface-2: #24221f; --text: #ebe7df;
    --muted: #9b958a; --line: #34312c; --line-strong: #4a463f; --accent: #6cbcae; --like: #6cbcae; --danger: #e0806b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1917; --surface: #1a1917; --surface-2: #24221f; --text: #ebe7df;
  --muted: #9b958a; --line: #34312c; --line-strong: #4a463f; --accent: #6cbcae; --like: #6cbcae; --danger: #e0806b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; cursor: pointer; color: var(--text); background: transparent; border: 1px solid var(--line-strong); border-radius: 99px; padding: 6px 16px; }
button.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 700; }
button.ghost { border-color: transparent; color: var(--muted); }
button.small { font-size: 13px; padding: 3px 12px; }
button.link { border: none; padding: 0; color: var(--accent); font-size: 13px; }
button.link.on { color: var(--danger); }
button.on { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
textarea, input[type="text"], select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px;
}
textarea { width: 100%; resize: vertical; display: block; }
input[type="text"] { width: 100%; }
select { border-radius: 99px; padding: 4px 12px; font-size: 14px; color: var(--accent); border-color: var(--line-strong); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }

/* 試作用の帯 */
header.site { display: flex; justify-content: space-between; align-items: center; padding: 4px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.logo { color: var(--text); font-weight: 700; }
.logo small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.header-tools { display: flex; gap: 4px; }
.header-tools button { font-size: 12px; padding: 1px 8px; }
main { padding: 0; }

/* 配置：真ん中にタイムライン（幅 600px）、右に欄（幅 350px）。狭い画面では右の欄なし */
.x-layout { display: flex; justify-content: center; gap: 28px; align-items: flex-start; }
.timeline { width: 100%; max-width: 600px; min-height: 100vh; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.sidebar { width: 350px; flex-shrink: 0; padding-top: 12px; position: sticky; top: 0; }
.mobile-only { display: none !important; }
@media (max-width: 1000px) {
  .sidebar { display: none; }
  .mobile-only { display: flex !important; }
}
@media (max-width: 600px) {
  .timeline { border: none; }
}

/* タイムラインの見出し */
.tl-header {
  display: flex; align-items: center; gap: 20px; padding: 8px 16px; min-height: 53px;
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px);
}
.back-btn { color: var(--text); font-size: 20px; }
.tl-title { font-size: 20px; font-weight: 700; line-height: 1.4; }
.tl-sub { font-size: 13px; color: var(--muted); }

/* タブ（X の「おすすめ／フォロー中」と同じ形） */
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  flex: 1 0 auto; border: none; border-radius: 0; padding: 0 16px; height: 53px;
  color: var(--muted); font-weight: 500; display: flex; justify-content: center; align-items: center;
}
.tab:hover { background: var(--surface-2); }
.tab span { position: relative; height: 100%; display: flex; align-items: center; }
.tab.on { color: var(--text); font-weight: 700; }
/* 選んだタブの下線は、動く1本の線（.tab-ind）で表す */
.tabs { position: relative; }
.tab-ind { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); pointer-events: none;
  transition: transform .45s cubic-bezier(.33,1,.68,1), width .45s cubic-bezier(.33,1,.68,1); }

/* 投稿欄 */
.compose { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.compose-main { flex: 1; min-width: 0; }
.compose textarea { border: none; padding: 8px 0; font-size: 19px; background: transparent; }
.compose textarea:focus { outline: none; }
.compose-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }

/* 一言 */
.thread { border-bottom: 1px solid var(--line); padding: 4px 0; }
.xpost { padding: 10px 20px; }
.xpost:hover { background: var(--surface-2); }
/* 反論は字下げして、左の細い線で元の一言につなぐ */
.xpost.is-reply { margin-left: 34px; padding: 8px 20px 8px 14px; border-left: 2px solid var(--line-strong); }
.xpost.is-reply + .xpost.is-reply { margin-top: 0; }
.xp-main { flex: 1; min-width: 0; }
.xp-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.xp-name { font-weight: 700; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.xp-you { font-size: 12px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; }
.xp-time { color: var(--muted); }
.new-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 4px; }
/* 立場は、X の「返信先：@〜」と同じ位置に灰色の小さな文字で */
.xp-stance { font-size: 13px; color: var(--muted); }
.xp-body { white-space: pre-wrap; word-break: break-word; margin-top: 3px; font-size: 15.5px; line-height: 1.7; }
.fold-note { font-size: 14px; color: var(--muted); margin: 4px 0; }
.xpost.folded .xp-body, .xpost.folded .xp-actions { display: none; }
.xp-actions { display: flex; align-items: center; gap: 16px; margin-top: 4px; color: var(--muted); }
.act { border: none; padding: 0; color: var(--muted); display: inline-flex; align-items: center; font-size: 13px; }
.act svg { width: 18px; height: 18px; }
button.act:hover { color: var(--accent); }
.act.like.on { color: var(--like); font-weight: 700; }
.act.static { cursor: default; }
.empty { color: var(--muted); padding: 24px 16px; text-align: center; }

/* 右側の欄（狭い画面では「前提・まとめ」タブの中）。塗りはなし、細い枠だけ。操作は触れたときだけ出す */
.card { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.card h2 { font-size: 15px; font-weight: 700; margin: 0; padding: 10px 16px 2px; color: var(--muted); }
.card-row { padding: 8px 16px; font-size: 14px; line-height: 1.6; }
.card-row + .card-row { border-top: 1px solid var(--line); }
.card-label { font-size: 12px; color: var(--muted); }
.claim { font-weight: 700; }
.reasons { margin: 2px 0 0; padding-left: 1.1em; font-size: 13px; color: var(--muted); }
.rebuttal, .sub { font-size: 13px; color: var(--muted); }
.card-meta { display: flex; justify-content: flex-end; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); min-height: 18px; }
.reveal { visibility: visible; }
.card-row:hover .reveal, .card-row.active .reveal { visibility: visible; }
.dispute { color: var(--danger); font-weight: 700; font-size: 12px; }
.proposal { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.proposal button { flex-shrink: 0; }
button.link.done { color: var(--muted); }
.tl-row { font-size: 13px; padding: 5px 16px; }
.tl-row + .tl-row { border-top: none; }
.tl-date { color: var(--muted); font-size: 12px; margin-right: 8px; }
.editing label { display: block; font-size: 12px; color: var(--muted); margin: 6px 0 2px; }
.picks { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin-top: 8px; font-size: 13px; }
.picks ul { margin: 4px 0 0; padding-left: 1.2em; }
.row { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.info-inline { padding: 12px 12px 0; }

/* 話題一覧 */
.topic-row { display: block; color: var(--text); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.topic-row:hover { background: var(--surface-2); }
.topic-title { font-weight: 700; font-size: 17px; }
.topic-row .muted { font-size: 13px; }

/* 通知・小窓 */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 20; pointer-events: none; }
.toast { background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; white-space: nowrap;
  animation: toast-in .36s cubic-bezier(.33,1,.68,1); transition: opacity .25s, transform .25s; }
.toast.leaving { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal { position: fixed; inset: 0; background: rgb(91 112 131 / .4); display: grid; place-items: start center; padding: 48px 16px; z-index: 10; }
.modal[hidden] { display: none; }
.modal .box { background: var(--bg); border-radius: 16px; padding: 16px 18px; max-width: 560px; width: 100%; }
.modal h3 { margin: 0 0 8px; }
.modal p { font-size: 14px; margin: 0 0 10px; }
.modal select { margin-top: 4px; }
.reply-src { border-left: 2px solid var(--line-strong); padding: 0 0 0 12px; margin-bottom: 12px; color: var(--muted); }
.reply-src .xp-name { color: var(--text); }
.modal .compose-foot { border: none; }
.shake { animation: shake .35s; border-color: var(--danger) !important; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* 論点：2つの立場が交互に書き足していく往復 */
.issue-status { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.st { font-size: 12px; font-weight: 700; border-radius: 4px; padding: 0 6px; border: 1px solid currentColor; }
.st.open { color: var(--accent); }
.st.settled { color: var(--text); }
.st.deadlock { color: var(--muted); }
.turns { list-style: none; margin: 12px 0 0; padding: 0; }
.turn { position: relative; padding: 0 0 14px 28px; }
/* 番号を縦の線でつなぎ、往復の流れが見えるようにする */
.turn::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.turn:last-child::before { display: none; }
.turn-head { font-size: 13px; color: var(--muted); }
.turn-head > .turn-no:first-child { position: absolute; left: 0; top: 0; }
.turn-no {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); background: var(--bg);
}
.turn-body { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.7; margin-top: 2px; }
.turn-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.turn-actions.waiting { margin-left: 28px; margin-top: 0; }
button.link.dev { color: var(--muted); font-size: 12px; text-decoration: underline dotted; }

/* 議論場への札（タイムラインで、反論のすぐ下に出る） */
.arena-card {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin: 2px 20px 10px 54px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--text); font-size: 14px;
}
.arena-card:hover { background: var(--surface-2); }
.arena-card-status { color: var(--accent); font-size: 13px; white-space: nowrap; }

/* 議論場：左に本線、右に観客席。狭い画面では本線の下に観客席 */
.arena-layout { display: flex; justify-content: center; gap: 28px; align-items: flex-start; }
.arena-side { width: 350px; flex-shrink: 0; padding-top: 12px; position: sticky; top: 0; }
@media (max-width: 1000px) {
  .arena-layout { flex-direction: column; align-items: center; gap: 0; }
  .arena-side { width: 100%; max-width: 600px; position: static; padding: 0 0 24px; }
  .arena-layout .timeline { min-height: 0; }
}
.arena-players { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 20px 0; font-size: 13px; color: var(--muted); }
.arena-players .vs { color: var(--muted); }
.arena-status { padding: 6px 20px 0; }
.arena-turns { padding: 0 20px; }
.turn-foot { margin-top: 2px; }
.arena-input { margin: 0 20px 20px 48px; }
.seats { border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px 14px; }
.seats h2 { font-size: 15px; color: var(--muted); margin: 0 0 6px; }
.seat { padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.seat .xp-name { margin-right: 6px; }
.seat-input { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.seat-input textarea { flex: 1; }
.seat-note { margin-top: 10px; }

/* 議論場：追記・時間切れ・交代 */
.addendum { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line-strong); font-size: 14px; white-space: pre-wrap; }
.addendum-label { font-size: 12px; color: var(--muted); margin-right: 6px; }
.st.timeout { color: var(--danger); }
.arena-subs { padding: 4px 20px 0; font-size: 12px; color: var(--muted); }
.notice { margin: 8px 20px 0; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.seats .notice { margin: 0 0 8px; }
.notice .link { align-self: flex-start; }
.notice-plain { margin: 0 0 8px; }
.turn { padding-left: 0; }
.turn::before { display: none; }
.arena-input { margin-left: 20px; }

/* トップページ */
.new-topic-btn { background: var(--accent); color: var(--bg); font-weight: 700; border-radius: 99px; padding: 6px 16px; font-size: 14px; white-space: nowrap; }
.search-box { padding: 10px 20px 4px; }
.search-box input { width: 100%; border-radius: 99px; padding: 8px 16px; background: var(--surface-2); border-color: transparent; }
.tag-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 20px 12px; }
.tag-chip { border: 1px solid var(--line-strong); border-radius: 99px; padding: 2px 12px; font-size: 13px; color: var(--text); background: transparent; }
.tag-chip span { color: var(--muted); margin-left: 6px; font-size: 12px; }
.tag-chip:hover { background: var(--surface-2); }
.small-chips { padding: 6px 0 0; }
.tag-text { color: var(--accent); font-size: 13px; margin-right: 8px; }
.topic-row { padding: 14px 20px; }
.topic-camps { font-size: 13px; color: var(--muted); margin-top: 2px; }
.topic-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.topic-meta .tag-text { margin-right: 0; font-size: 12px; }
.result-head { padding: 12px 20px 4px; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.post-hit { display: block; padding: 10px 20px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 14px; }
.post-hit:hover { background: var(--surface-2); }
.post-hit .sub { font-size: 12px; color: var(--muted); }
.arena-link { display: block; color: var(--text); }
.arena-link:hover { background: var(--surface-2); }

/* 話題を立てる */
.new-form { padding: 12px 20px 32px; display: flex; flex-direction: column; }
.new-form label { font-weight: 700; font-size: 14px; margin: 16px 0 4px; }
.new-form .hint { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.new-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.new-form .row { margin-top: 20px; align-items: center; }
.ghost-link { color: var(--muted); font-size: 14px; margin-right: 8px; }
.similar { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.similar-head { font-size: 13px; color: var(--accent); font-weight: 700; }

/* ---------- 動き（参考：モーションリファレンス） ---------- */
/* ポップスケール：「それな」「効いた」を押したとき */
.pop { animation: pop .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
/* アテンションバウンス：議論場で自分の番が来たとき、一度だけ */
.bounce { animation: bounce .62s cubic-bezier(.33,1,.68,1); }
@keyframes bounce { 0% { transform: none; } 30% { transform: translateY(-6px); } 55% { transform: none; } 72% { transform: translateY(-2px); } 100% { transform: none; } }
/* フェード＋スライド：新しく出てきた一言 */
.enter { animation: enter .6s cubic-bezier(.33,1,.68,1); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* 共有要素トランジション：札が広がって議論場になる */
::view-transition-group(arena) { animation-duration: .5s; animation-timing-function: cubic-bezier(.65,0,.35,1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
@media (prefers-reduced-motion: reduce) {
  .pop, .bounce, .enter, .toast { animation: none !important; }
  .tab-ind { transition: none !important; }
}

/* 話題を立てる：タグは押して選ぶ。立場と前提は「くわしく決める」の中 */
.pick-chips { padding: 2px 0 8px; }
.tag-chip.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.more-settings { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 14px; }
.more-settings > summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.more-settings label { display: block; }
.new-form .hint { line-height: 1.6; }

/* トップページ：話題ごとに、対立する2つの立場の代表的なひとことを並べる */
.voices { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 2px; }
.voice { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; font-size: 14px; line-height: 1.55; }
.voice-camp { color: var(--muted); font-size: 12px; padding-top: 2px; }
.voice-text { color: var(--text); }
@media (max-width: 480px) {
  .voice { grid-template-columns: 1fr; gap: 0; }
}

/* トップページの読みやすさ：字を大きく、ひとことは1行、話題の間を広く */
.topic-row { padding: 20px 20px 18px; }
.topic-row .topic-title { font-size: 18px; line-height: 1.45; }
.voices { gap: 6px; margin: 10px 0 0; }
.voice { grid-template-columns: 8em minmax(0, 1fr); font-size: 15px; }
.voice-camp { font-size: 13px; padding-top: 1px; }
.voice-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-meta { margin-top: 8px; }
.topic-meta .live { color: var(--accent); font-size: 12px; }

/* 話題の編集 */
button.link.muted-link { color: var(--muted); font-size: 12px; }
.tl-sub .muted-link { margin-left: 4px; }
.premise-foot { display: flex; gap: 14px; align-items: center; }
.edit-log { max-height: 50vh; overflow-y: auto; }
.log-row { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log-from { color: var(--muted); text-decoration: line-through; }
.log-to { color: var(--text); }

/* 投稿欄の立場：押して選ぶ */
.stance-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.stance-chips .muted { margin-right: 2px; }
.stance-chip { font-size: 13px; padding: 3px 12px; color: var(--muted); }
.stance-chip.on { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; }
.compose-foot { align-items: flex-end; }
.compose-foot > .primary { flex-shrink: 0; }

/* 投稿欄の下段：立場のボタンと送信ボタンを同じ高さにそろえる。
   幅が足りなければ立場のボタンは全幅で折り返し、送信ボタンは次の行の右端へ */
.compose .compose-foot { flex-wrap: wrap; align-items: center; row-gap: 10px; }
.compose .stance-chips { flex: 1 1 auto; }
.stance-chip, .compose .compose-foot > .primary { height: 32px; display: inline-flex; align-items: center; }
.stance-chip { padding: 0 14px; }
.compose .compose-foot > .primary { padding: 0 20px; margin-left: auto; }

/* スマホ：話題名の下の前提の1行、トップの「いま議論中」 */
.premise-line { border: none; padding: 4px 0 0; font-size: 13px; color: var(--muted); }
.premise-line .dispute { font-size: 13px; }
.live-strip { flex-direction: column; border-bottom: 1px solid var(--line); }
.live-strip:empty { display: none !important; }
.live-item { display: flex; gap: 10px; align-items: baseline; padding: 10px 20px; color: var(--text); font-size: 14px; }
.live-item + .live-item { border-top: 1px solid var(--line); }
.live-item .live { color: var(--accent); font-size: 12px; white-space: nowrap; }
.live-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nt-first-stance { margin-top: 8px; }

/* ひとことの表示：本文を先に。立場・名前・時刻と操作は本文の下の1行にまとめ、始まりを少し右にずらす */
.xp-body, .turn-body { margin-top: 0; }
.xp-actions, .turn-foot { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; margin-top: 4px; }
.xp-meta { font-size: 12px; color: var(--muted); padding-left: 1em; display: inline-flex; align-items: center; gap: 4px; }
.arena-turns .turn { padding-bottom: 16px; }
/* 投稿欄：送信ボタンは立場のボタンの並びの最後、右端に寄せる */
.stance-chips { flex: 1 1 100%; }
.stance-chips > [data-post] { margin-left: auto; height: 32px; padding: 0 20px; display: inline-flex; align-items: center; }

/* 観客席のコメント：本文の下に ID */
.seat-foot { margin-top: 2px; }

/* 並べ替え */
.order-row { display: flex; align-items: center; gap: 6px; padding: 8px 20px; border-bottom: 1px solid var(--line); }
.order-btn { border: none; padding: 2px 8px; font-size: 13px; color: var(--muted); border-radius: 6px; }
.order-btn.on { color: var(--text); background: var(--surface-2); font-weight: 700; }

/* スマホ（600px 以下）：投稿欄はタイムラインから外し、右下の「書く」から下にせり上がる形で出す */
.phone-only { display: none !important; }
.fab {
  position: fixed; right: 16px; bottom: 20px; z-index: 15; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: var(--bg); border: none; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 14px rgb(0 0 0 / .3);
}
.modal.sheet { place-items: end center; padding: 0; }
.modal.sheet .box { border-radius: 16px 16px 0 0; max-width: 600px; padding: 8px 16px 20px; animation: sheet-up .3s cubic-bezier(.33,1,.68,1); }
.modal.sheet .compose { border-bottom: none; padding: 0; }
.sheet-head { display: flex; justify-content: flex-start; margin-bottom: 4px; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 600px) {
  .phone-only { display: inline-flex !important; align-items: center; justify-content: center; }
  .compose-inline { display: none; }
  /* 下にスクロールしたら、話題名の欄は「← 話題名（1行）」だけに縮める */
  .tl-header.compact .tl-sub, .tl-header.compact .premise-line, .tl-header.compact [data-topic-edit] { display: none !important; }
  .tl-header.compact .tl-title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tl-header.compact > div { min-width: 0; }
  .tl-header { transition: padding .2s; }
}
@media (prefers-reduced-motion: reduce) { .modal.sheet .box { animation: none; } }

/* 討論場 */
.debate-strip { display: flex; flex-direction: column; gap: 6px; padding: 10px 20px 4px; }
.debate-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); font-size: 14px;
}
.debate-card:hover { background: var(--surface-2); }
.debate-card-label { font-size: 12px; color: var(--accent); font-weight: 700; }
.debate-card-main { flex: 1; min-width: 0; }
.debate-card-status { font-size: 12px; color: var(--muted); white-space: nowrap; }
.teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 14px 20px 6px; }
.team { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.team-name { font-weight: 700; font-size: 14px; }
.team-members { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.seat-empty { color: var(--line-strong); }
.team-vs { align-self: center; color: var(--muted); font-size: 13px; }
.team button { align-self: flex-start; }
.debate-turns { padding: 6px 20px 0; }
.statement { display: block !important; padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
.statement-kind { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.debate-now { margin: 14px 20px 24px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.debate-now.mine { border-style: solid; border-color: var(--accent); }
.debate-now .link.dev { align-self: flex-start; }
.two-sel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
/* 考えの変化 */
.poll-result { margin: 10px 20px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.poll-row { display: grid; grid-template-columns: 8em minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.poll-name { color: var(--text); }
.poll-bars { display: flex; flex-direction: column; gap: 3px; }
.poll-bar { height: 6px; border-radius: 3px; min-width: 2px; }
.poll-bar.before { background: var(--line-strong); }
.poll-bar.after { background: var(--accent); }
.poll-nums { white-space: nowrap; color: var(--muted); }
.poll-nums b { color: var(--text); }
.poll-nums .up { color: var(--accent); }
.poll-nums .down { color: var(--danger); }
.poll-legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 14px; height: 6px; border-radius: 3px; }
.lg.before { background: var(--line-strong); }
.lg.after { background: var(--accent); }
.seats .stance-chips { margin-top: 6px; }
@media (max-width: 600px) {
  .teams { grid-template-columns: 1fr; }
  .team-vs { display: none; }
  .poll-row { grid-template-columns: 1fr; gap: 2px; }
}

/* 討論場：待ってもらう */
.wait-note { font-size: 13px; color: var(--accent); }
.wait-opt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; margin: 8px 0; }
.wait-opt select, .wait-opt input[type="datetime-local"] { font-size: 14px; border-radius: 8px; padding: 4px 8px; }
#wait-reason { margin-top: 6px; }

/* 討論場：質問と回答・字数・後出しの指摘 */
.qa { margin: 6px 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.qa-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.qa-q { color: var(--muted); }
.qa-a { color: var(--text); }
.qa-item textarea { margin-top: 4px; }
.qa-inputs { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.char-count { font-size: 12px; color: var(--muted); text-align: right; }
.char-count.over { color: var(--danger); font-weight: 700; }
.atodashi { margin-top: 6px; font-size: 13px; color: var(--muted); }
.atodashi-badge { color: var(--danger); font-weight: 700; border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; margin-right: 6px; font-size: 12px; }
.atodashi-btn { margin-top: 4px; }

/* 討論場：作戦室 */
.seats.room { border-color: var(--accent); }
.seats.room h2 { color: var(--accent); }

/* 名前の添え書き（議論場は 1対1、討論場は チーム戦） */
.kind-tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; margin-left: 5px; vertical-align: 2px; line-height: 1.5; }
.tl-title .kind-tag { font-size: 12px; vertical-align: 3px; }

/* ヘッダーの「お知らせ」「自分のページ」 */
header.site { gap: 12px; }
.header-nav { display: flex; gap: 14px; margin-right: auto; margin-left: 12px; font-size: 13px; }
.header-nav a { color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.count-badge { background: var(--accent); color: var(--bg); border-radius: 99px; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; }
.count-badge[hidden] { display: none; }

/* お知らせ */
.inbox-row { display: block; padding: 12px 20px; border-bottom: 1px solid var(--line); color: var(--text); }
.inbox-row:hover { background: var(--surface-2); }
.inbox-where { font-size: 12px; color: var(--muted); }
.inbox-text { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.inbox-row:not(.urgent) .inbox-text { color: var(--muted); }
.inbox-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 自分のページ */
.me-section { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.me-section h3 { margin: 0; font-size: 15px; }
.me-name { display: flex; gap: 8px; }
.me-name input { flex: 1; }
.me-row { display: block; color: var(--text); padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.me-row:first-of-type { border-top: none; }
@media (max-width: 600px) {
  .header-nav { margin-left: 4px; gap: 10px; }
  .logo small { display: none; }
}

/* ---------- 本番で足したもの ---------- */
/* 試作の「試作用」ボタンがなくなったので、お知らせと自分のページを右に寄せる */
.header-nav { margin-left: auto; margin-right: 0; }
header.site { padding: 8px 12px; }
.logo { font-size: 15px; letter-spacing: .04em; }

button.danger { background: var(--danger); color: var(--bg); border-color: var(--danger); font-weight: 700; }
input[type="email"], input[type="search"] { font: inherit; }

/* ログインしていない人の投稿欄 */
.compose-guest { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.primary-link { background: var(--accent); color: var(--bg); border-radius: 99px; padding: 6px 18px; font-weight: 700; }

/* 消されたひとこと */
.xpost.deleted .xp-body { font-size: 13px; }

/* ログイン・登録 */
.auth-box { padding: 16px; max-width: 460px; }
.auth-box p { margin: 0 0 16px; line-height: 1.7; }
.auth-box form { display: flex; flex-direction: column; gap: 8px; }
.auth-box form[hidden] { display: none; }
.auth-box label { font-weight: 700; font-size: 14px; margin-top: 8px; }
.auth-box input[type="email"], .auth-box input[type="text"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 16px;
}
.auth-box .hint { color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-box button.primary { margin-top: 8px; padding: 10px; font-size: 15px; }
.auth-box .check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.auth-box .check input { width: 18px; height: 18px; }
.auth-btn { display: block; text-align: center; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px; color: var(--text); font-weight: 700; }
.auth-btn:hover { background: var(--surface-2); }
.auth-or { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin: 16px 0 4px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.auth-error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.notice-plain { padding: 16px; line-height: 1.8; }
.notice-plain p { margin: 12px 0 0; }
.turnstile { min-height: 65px; margin-top: 8px; }
.me-row code { font-size: 15px; letter-spacing: .05em; }

/* ---------- ログイン・新規登録（真ん中に細いカードで置く） ---------- */
.auth-page { display: flex; justify-content: center; padding: 56px 16px 80px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; margin: 0 0 10px; text-align: center; letter-spacing: .02em; }
.auth-lead { color: var(--muted); font-size: 14px; line-height: 1.7; text-align: center; margin: 0 0 24px; }
.auth-note { font-size: 13px; line-height: 1.6; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: -8px 0 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 10px; }
.auth-card form[hidden] { display: none; }
.auth-card label { font-weight: 700; font-size: 13px; margin-top: 6px; }
.auth-card input[type="email"], .auth-card input[type="text"] {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 16px;
}
.auth-card input:focus { outline: none; border-color: var(--accent); }
.auth-card button.primary { height: 44px; border-radius: 8px; font-size: 15px; margin-top: 4px; }
.auth-card .turnstile { min-height: 65px; margin: 4px 0 0; }
.auth-hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }
.auth-card .check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; margin-top: 8px; }
.auth-card .check input { width: 18px; height: 18px; margin: 0; }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.auth-switch a { font-weight: 700; }
.auth-sent { margin-top: 16px; padding: 14px; border-radius: 8px; background: var(--surface-2); font-size: 14px; line-height: 1.8; }
.auth-card .auth-error { margin: 0 0 16px; }

/* ヘッダーの「新規登録」 */
.header-nav .signup-link { background: var(--accent); color: var(--bg); border-radius: 99px; padding: 3px 12px; font-weight: 700; }
.guest-links { display: inline-flex; align-items: center; gap: 14px; }
/* ロボット確認の欄は決まった幅（300px）なので、真ん中に置く */
.auth-card .turnstile { display: flex; justify-content: center; overflow: visible; }

/* 試験公開中の帯と、下のリンク */
.trial-bar { background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; padding: 5px 12px; border-bottom: 1px solid var(--line); }
.site-foot { display: flex; justify-content: center; gap: 20px; padding: 24px 16px 40px; font-size: 12px; }
.site-foot a { color: var(--muted); }

/* プライバシーポリシーなどの文書 */
.doc { padding: 8px 20px 40px; line-height: 1.85; font-size: 15px; }
.doc h2 { font-size: 16px; margin: 28px 0 8px; }
.doc ul { padding-left: 1.3em; margin: 8px 0; }
.doc li { margin: 4px 0; }
.doc-note { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.doc-date { color: var(--muted); font-size: 13px; margin-top: 32px; }
