/* 現場NOW v0.10.1 ── 職種カラーで生きる、建設業の部室 */

:root {
  --bg: #14161b;
  --bg-2: #191c22;
  --surface: #1f232b;
  --surface-2: #262b35;
  --line: #323845;
  --text: #eceef2;
  --text-2: #9aa2b1;
  --text-3: #6b7382;
  --accent: #e8a33d;          /* 現場NOWのブランド色＝現場の朝焼けアンバー */
  --accent-ink: #1a1206;
  --danger: #e0614f;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);

  /* 職種カラー（9グループ。正本 data/trades.json） */
  --c-tobi: #6c8fdd;      /* 鳶・揚重＝藍 */
  --c-kutai: #d96f4e;     /* 躯体＝錆朱 */
  --c-shiage: #dfc0cf;    /* 仕上げ＝白＋パステル */
  --c-doboku: #56a373;    /* 土木＝深緑 */
  --c-setsubi: #55a8dc;   /* 設備＝青 */
  --c-denki: #e0b23c;     /* 電気＝山吹 */
  --c-kantoku: #4cc38a;   /* 監督・施工管理＝白×緑 */
  --c-sekkei: #a3adbd;    /* 設計・技術＝グレー */
  --c-shizai: #bd9464;    /* 資材・流通・その他＝茶 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDGothic", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100dvh;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }
img { max-width: 100%; }

/* ---------- 共通部品 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 999px; text-decoration: none;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  padding: 12px 22px; transition: opacity .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: .9; }
.btn-lg { width: 100%; padding: 15px 24px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-3); }
.btn-danger-ghost {
  background: transparent; color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
}
.icon-btn {
  background: none; border: none; color: var(--text);
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%;
}
.icon-btn:hover { background: var(--surface); }

.view { min-height: 100dvh; }

.subhead {
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); z-index: 5;
}
.subhead h2 { font-size: 17px; font-weight: 700; }
.subhead-spacer { width: 40px; }

/* ---------- ゲート ---------- */
.gate-wrap {
  max-width: 480px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 48px) 24px 32px;
  display: flex; flex-direction: column; min-height: 100dvh;
}
.gate-hero { text-align: center; }
.brand-mark { margin-bottom: 10px; }
.brand-mark img { display: inline-block; width: 92px; height: 92px; }
.brand-name { font-size: 34px; font-weight: 800; letter-spacing: .12em; }
.brand-tagline {
  font-size: 12.5px; color: var(--text-3); margin: 6px 0 26px;
  letter-spacing: .06em; word-break: keep-all; overflow-wrap: normal;
}
.gate-copy { font-size: 22px; font-weight: 700; line-height: 1.5; margin-bottom: 14px; }
.gate-desc { color: var(--text-2); font-size: 14px; margin-bottom: 30px; }
.gate-hero .btn-primary { margin-bottom: 12px; }
.gate-hero .btn-ghost { width: 100%; }

.gate-trades { margin-top: 44px; }
.gate-trades-title {
  text-align: center; font-size: 12px; color: var(--text-3);
  letter-spacing: .18em; margin-bottom: 14px;
}
.trade-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.trade-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.trade-dot { width: 10px; height: 10px; border-radius: 50%; }

.gate-footer {
  margin-top: auto; padding-top: 48px; text-align: center;
  color: var(--text-3); font-size: 12px;
}
.ver { margin-top: 2px; font-size: 11px; }

/* ---------- 現場検定 ---------- */
.exam-wrap { max-width: 520px; margin: 0 auto; padding: 12px 20px 40px; }
.exam-progress {
  height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden;
  margin-bottom: 10px;
}
.exam-progress-bar {
  height: 100%; width: 0; background: var(--accent);
  border-radius: 3px; transition: width .3s ease;
}
.exam-counter { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.exam-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow);
}
.exam-q { font-size: 18px; font-weight: 700; margin-bottom: 20px; line-height: 1.6; }
.exam-choices { display: grid; gap: 10px; }
.choice-btn {
  text-align: left; padding: 14px 16px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 15px; line-height: 1.5; transition: border-color .15s, background .15s;
}
.choice-btn:hover { border-color: var(--accent); }
.exam-note { margin-top: 18px; font-size: 12px; color: var(--text-3); text-align: center; }

/* ---------- 結果 ---------- */
.result-wrap {
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 60px) 24px 40px;
  display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.result-badge {
  width: 120px; height: 120px; margin: 0 auto 22px;
  border-radius: 50%; display: grid; place-items: center;
  border: 3px solid var(--accent); color: var(--accent);
}
.result-badge.fail { border-color: var(--text-3); color: var(--text-3); }
.result-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.result-score { color: var(--text-2); margin-bottom: 26px; }
.result-wrap .btn { margin-bottom: 12px; }

/* ---------- フォーム ---------- */
.form-wrap { max-width: 480px; margin: 0 auto; padding: 8px 22px 48px; }
.passed-banner {
  display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 14px; font-weight: 600; margin-bottom: 22px;
}
.field { display: block; margin-bottom: 18px; }
.field-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 7px;
}
.field-label em {
  font-style: normal; font-size: 10px; font-weight: 700;
  background: var(--danger); color: #fff;
  border-radius: 4px; padding: 1px 6px;
}
.field-label em.opt { background: var(--surface-2); color: var(--text-3); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; }
.form-error {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}

.trade-select { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.trade-option {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1.5px solid var(--line);
  color: var(--text-2); font-size: 13px; font-weight: 600;
  text-align: left; line-height: 1.3;
}
.trade-option.selected {
  color: var(--text);
  border-color: var(--tc);
  background: color-mix(in srgb, var(--tc) 14%, var(--surface));
}
/* グループ名は「・」区切りの単位で折り返す（1〜2文字だけの孤立改行を防ぐ） */
.trade-option-label { word-break: keep-all; overflow-wrap: normal; }

/* ---------- メイン ---------- */
#view-app {
  display: flex; flex-direction: column; height: 100dvh;
  /* 部屋テーマ切替用 */
  --room: var(--accent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--room) 10%, var(--bg)) 0%, var(--bg) 240px);
  transition: background .3s;
}
.app-head {
  display: flex; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 10px;
}
.app-head-title h2 { font-size: 19px; font-weight: 800; letter-spacing: .02em; }
.app-head-sub { font-size: 12px; color: var(--text-2); }
.app-main {
  flex: 1; overflow-y: auto;
  padding: 4px 16px calc(env(safe-area-inset-bottom) + 140px);
  -webkit-overflow-scrolling: touch;
}
.pane { max-width: 560px; margin: 0 auto; }

/* 投稿カード */
.feed-list { display: grid; gap: 12px; }
.feed-empty { text-align: center; color: var(--text-3); padding: 60px 20px; font-size: 14px; }
.post-card {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--tc, var(--line));
  border-radius: var(--radius); padding: 14px 16px 10px;
}
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: color-mix(in srgb, var(--tc) 22%, var(--surface-2));
  color: var(--tc); font-weight: 800; font-size: 16px;
  border: 1.5px solid color-mix(in srgb, var(--tc) 55%, transparent);
}
.post-who { min-width: 0; flex: 1; }
.post-nick {
  font-size: 14.5px; font-weight: 700;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.badge-pass {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 4px; padding: 0 5px; line-height: 1.7;
}
.post-meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 6px; flex-wrap: wrap; }
.trade-tag {
  color: var(--tc); font-weight: 700;
}
.post-menu-btn { color: var(--text-3); }
.post-body { font-size: 15px; white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.post-image {
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 8px;
  border: 1px solid var(--line);
}
.post-image img { display: block; width: 100%; max-height: 380px; object-fit: cover; }
.post-actions {
  display: flex; align-items: center; gap: 4px;
  border-top: 1px solid var(--line); padding-top: 4px;
}
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--text-3);
  font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 999px;
}
.action-btn:hover { background: var(--surface-2); color: var(--text-2); }
.action-btn.liked { color: var(--c-kutai); }
.room-chip-inline {
  margin-left: auto; font-size: 11px; font-weight: 700;
  color: var(--tc); border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent);
  border-radius: 999px; padding: 1px 9px;
}

/* 部屋一覧 */
.rooms-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding-top: 6px; }
.room-card {
  position: relative; overflow: hidden; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--tc) 26%, var(--surface)) 0%, var(--surface) 70%);
  padding: 18px 16px 14px; min-height: 116px;
  color: var(--text); display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .08s;
}
.room-card:active { transform: scale(.98); }
/* ドットは通常フローに置き、名前が2行になっても文字と重ならないようにする */
.room-card .room-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--tc); margin-bottom: auto;
}
.room-name {
  font-size: 17px; font-weight: 800; margin-top: 10px;
  word-break: keep-all; overflow-wrap: normal;
}
.room-desc { font-size: 11px; color: var(--text-2); line-height: 1.4; word-break: keep-all; overflow-wrap: normal; }
.rooms-note { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 18px; }

/* 競技 */
.compete-hero {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 20%, var(--surface)) 0%, var(--surface) 65%);
  padding: 24px 20px; margin-top: 6px; margin-bottom: 26px;
}
.compete-label {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .1em;
  color: var(--accent-ink); background: var(--accent);
  border-radius: 4px; padding: 2px 8px; margin-bottom: 10px;
}
.compete-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.compete-desc { font-size: 13.5px; color: var(--text-2); margin-bottom: 18px; }
.compete-coming-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 12px; letter-spacing: .06em; }
.compete-coming { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.coming-card {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 14px; text-align: center; color: var(--text-3);
}
.coming-card .coming-trade { font-size: 11px; font-weight: 800; color: var(--tc); margin-bottom: 3px; }
.coming-card .coming-name { font-size: 14px; font-weight: 700; color: var(--text-2); }
.coming-card .coming-status { font-size: 10px; letter-spacing: .18em; margin-top: 6px; }

/* マイページ */
.mypage-card {
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(150deg, color-mix(in srgb, var(--tc) 24%, var(--surface)) 0%, var(--surface) 70%);
  padding: 24px 20px; margin-top: 6px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 16px;
}
.mypage-card .avatar { width: 60px; height: 60px; font-size: 24px; }
.mypage-nick { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mypage-meta {
  font-size: 13px; color: var(--text-2); margin-top: 2px;
  word-break: keep-all; overflow-wrap: normal;
}
.mypage-section { margin-bottom: 22px; display: grid; gap: 10px; }
.mypage-section h4 { font-size: 14px; font-weight: 700; color: var(--text-2); margin-bottom: 2px; }
.faq { display: grid; gap: 8px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.faq summary { font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.mypage-footer { text-align: center; color: var(--text-3); font-size: 12px; padding-bottom: 20px; }

/* 資格チップ */
.qual-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qual-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 700;
}
.qual-chip em {
  font-style: normal; font-size: 10px; font-weight: 700;
  color: var(--text-3); border: 1px solid var(--line);
  border-radius: 4px; padding: 0 5px; line-height: 1.7;
}
.qual-chip.verified { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.qual-chip.verified em { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.qual-remove {
  background: none; border: none; color: var(--text-3);
  display: grid; place-items: center; padding: 2px; border-radius: 50%;
}
.qual-remove:hover { color: var(--danger); }
.qual-empty { color: var(--text-3); font-size: 12.5px; }
.qual-note { color: var(--text-3); font-size: 11.5px; }

/* けんせつ小町バッジ（公式ロゴは改変せずそのまま表示する。枠・背景・色を重ねない） */
.badge-komachi {
  display: inline-flex; align-items: center; flex-shrink: 0;
  vertical-align: middle;
}
/* 高さ基準・幅は自動＝原本の縦横比を変えない（ガイドラインの禁止事項「プロポーションの変更」を避ける） */
.badge-komachi img { display: block; height: 22px; width: auto; }
.komachi-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer;
}
.komachi-toggle-text { font-size: 14px; font-weight: 700; display: flex; flex-direction: column; gap: 1px; }
.komachi-toggle-text em { font-style: normal; font-size: 11px; color: var(--text-3); font-weight: 400; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-slider {
  position: absolute; inset: 0;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; transition: background .2s, border-color .2s;
}
.switch-slider::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-2); transition: transform .2s, background .2s;
}
.switch input:checked + .switch-slider {
  background: color-mix(in srgb, #d78ba3 45%, var(--surface-2));
  border-color: #d78ba3;
}
.switch input:checked + .switch-slider::after { transform: translateX(20px); background: #fff; }
#modal-quals .btn-sm { margin-bottom: 12px; }
#modal-quals .qual-chips { margin-bottom: 16px; }

/* FAB・タブバー */
.fab {
  position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 84px);
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); border: none;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.45);
  z-index: 20;
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
}
.tab {
  flex: 1; max-width: 120px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; color: var(--text-3);
  font-size: 10.5px; font-weight: 700; padding: 4px 0;
}
.tab.active { color: var(--accent); }

/* モーダル */
.modal-back {
  position: fixed; inset: 0; background: rgba(6,8,12,.66);
  backdrop-filter: blur(3px); z-index: 40;
}
.modal {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 520px; max-height: 86dvh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 24px 22px calc(env(safe-area-inset-bottom) + 22px);
  z-index: 50; box-shadow: var(--shadow);
}
.modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.modal-lead { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.modal .btn-lg { margin-bottom: 10px; }
.modal .btn-ghost { width: 100%; }

.guideline-list { list-style: none; display: grid; gap: 10px; margin-bottom: 18px; }
.guideline-list li {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px;
  color: var(--text-2);
}
.guideline-list strong { color: var(--text); display: block; margin-bottom: 2px; }
.consent-check {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; margin-bottom: 16px;
  padding: 4px 2px; cursor: pointer;
}
.consent-check input { width: 20px; height: 20px; accent-color: var(--accent); }

.compose-preview { margin-top: 10px; display: grid; gap: 8px; justify-items: start; }
.compose-preview img { max-height: 180px; border-radius: var(--radius-sm); border: 1px solid var(--line); }

.comments-list { display: grid; gap: 10px; max-height: 40dvh; overflow-y: auto; margin-bottom: 14px; }
.comment-item {
  background: var(--surface); border-radius: var(--radius-sm);
  border-left: 3px solid var(--tc, var(--line));
  padding: 10px 12px;
}
.comment-who { font-size: 12px; font-weight: 700; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.comment-who .trade-tag { font-size: 11px; }
.comment-who time { color: var(--text-3); font-weight: 400; font-size: 11px; }
.comment-body { font-size: 14px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.comments-empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 14px; }
.comment-image {
  margin-top: 8px; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--line); max-width: 220px;
}
.comment-image img { display: block; width: 100%; max-height: 160px; object-fit: cover; cursor: zoom-in; }
.post-image img { cursor: zoom-in; }
.comment-form { display: flex; gap: 6px; align-items: flex-end; margin-bottom: 12px; }
.comment-attach { flex-shrink: 0; color: var(--text-3); border: 1px solid var(--line); }
.comment-attach:hover { color: var(--text); }
#comment-preview { margin-bottom: 12px; }

/* 写真の拡大表示 */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(6, 8, 12, 0.92);
  display: grid; place-items: center;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 94vw; max-height: 88dvh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.lightbox-close {
  position: absolute; top: calc(env(safe-area-inset-top) + 14px); right: 16px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 50%;
  width: 44px; height: 44px; display: grid; place-items: center;
}
.comment-form textarea {
  flex: 1; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; resize: none; outline: none;
}
.comment-form textarea:focus { border-color: var(--accent); }

.report-reasons { display: grid; gap: 8px; margin-bottom: 14px; }
.report-reason-btn {
  text-align: left; padding: 13px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px;
}
.report-reason-btn:hover { border-color: var(--danger); }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px);
  transform: translateX(-50%);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 20px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); z-index: 60; white-space: nowrap;
}

/* ---------- タブレット・PC ---------- */
@media (min-width: 768px) {
  .app-main { padding-left: 24px; padding-right: 24px; }
  .pane { max-width: 640px; }
  .rooms-grid { grid-template-columns: repeat(3, 1fr); }
  .compete-coming { grid-template-columns: repeat(3, 1fr); }
  body { font-size: 16px; }
  .post-body { font-size: 15.5px; }
}
@media (min-width: 1100px) {
  .pane { max-width: 680px; }
  .modal { border-radius: 22px; bottom: auto; top: 50%; transform: translate(-50%, -50%); border-bottom: 1px solid var(--line); }
}

/* ---------- 同意チェック（登録画面） ---------- */
.agree-list { display: grid; gap: 8px; }
.agree-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13.5px; line-height: 1.5; cursor: pointer;
}
.agree-row input { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.agree-row em {
  display: block; font-style: normal; font-size: 11px; color: var(--text-3); margin-top: 2px;
}
.link-btn {
  background: none; border: none; padding: 0;
  color: var(--accent); font-size: inherit; font-weight: 700;
  text-decoration: underline; text-underline-offset: 2px;
}

/* ---------- 規約・ポリシーの表示 ---------- */
.legal-body {
  max-width: 720px; margin: 0 auto;
  padding: 8px 20px calc(env(safe-area-inset-bottom) + 48px);
  font-size: 14px; line-height: 1.85; color: var(--text-2);
  /* 長文の条文は通常の日本語折り返しにする（keep-allだと句読点でしか折れず読みにくい） */
  word-break: normal; overflow-wrap: anywhere; line-break: strict;
}
.legal-body h1 { font-size: 21px; color: var(--text); margin: 8px 0 14px; line-height: 1.5; }
.legal-body h2 { font-size: 16px; color: var(--text); margin: 26px 0 8px; line-height: 1.5; }
.legal-body h3 { font-size: 14.5px; color: var(--text); margin: 18px 0 6px; }
.legal-body h4 { font-size: 13.5px; color: var(--text-2); margin: 14px 0 4px; }
.legal-body p { margin-bottom: 10px; }
.legal-body strong { color: var(--text); }
.legal-body ul, .legal-body ol { margin: 0 0 12px 1.35em; }
.legal-body li { margin-bottom: 5px; }
.legal-body hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.legal-body blockquote {
  border-left: 3px solid var(--accent); background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px; margin: 0 0 12px;
}
.legal-body code {
  background: var(--surface-2); border-radius: 4px;
  padding: 1px 5px; font-size: 12.5px;
}
.legal-table-wrap { overflow-x: auto; margin-bottom: 14px; }
.legal-body table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.legal-body th, .legal-body td {
  border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top;
}
.legal-body th { background: var(--surface); color: var(--text); white-space: nowrap; }
.legal-loading { color: var(--text-3); text-align: center; padding: 40px 0; }

/* ---------- 通報の一覧（運営者） ---------- */
.reports-wrap {
  max-width: 640px; margin: 0 auto;
  padding: 4px 16px calc(env(safe-area-inset-bottom) + 48px);
}
.reports-note { font-size: 12px; color: var(--text-3); margin-bottom: 14px; }
.reports-list { display: grid; gap: 12px; }
.reports-empty { text-align: center; color: var(--text-3); padding: 50px 20px; font-size: 14px; }
.report-card {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius); padding: 14px 16px;
}
.report-card.handled { border-left-color: var(--text-3); opacity: .72; }
.report-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.report-reason { font-size: 13px; font-weight: 800; color: var(--danger); }
.report-card.handled .report-reason { color: var(--text-2); }
.report-head time { font-size: 11.5px; color: var(--text-3); }
.report-flag {
  font-size: 10px; font-weight: 700; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; line-height: 1.7;
}
.report-target { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.report-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.report-meta { font-size: 11.5px; color: var(--text-3); margin-bottom: 10px; }
.comment-del { width: 28px; height: 28px; color: var(--text-3); margin-left: auto; }
.comment-del:hover { color: var(--danger); }

/* 通報カードの操作と投稿ID */
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.report-id {
  display: inline-block; margin-left: 8px;
  font-size: 10.5px; color: var(--text-3);
  background: var(--surface-2); border-radius: 4px; padding: 1px 6px;
}

/* 削除済みの投稿への通報 */
.report-deleted { color: var(--text-3); font-style: normal; }
