/* コミュニティ(COMMUNITY-3)。#screen-community の中だけ(.cm3-*)。ほかの画面には触れない。
   ポップで明るい配色(青・黄・オレンジ・緑・紫)・パステルの背景・角丸のカード・やわらかい影。文字は読みやすさを優先 */
#screen-community {
  --cm3-ink: #1f2a44;
  --cm3-sub: #5b6782;
  --cm3-line: #e3e9f5;
  --cm3-card: #ffffff;
  --cm3-blue: #2f7cf6;
  --cm3-blue-dark: #1f5fd1;
  --cm3-shadow: 0 6px 18px rgba(36, 70, 140, 0.10);
  --cm3-radius: 18px;
  --cm3-yellow-bg: #fff6d6; --cm3-yellow: #f2b705;
  --cm3-orange-bg: #ffe9d6; --cm3-orange: #f08a1c;
  --cm3-blue-bg: #e2efff;   --cm3-blue-a: #2f7cf6;
  --cm3-teal-bg: #dcf7ef;   --cm3-teal: #12a88a;
  --cm3-purple-bg: #efe6ff; --cm3-purple: #8a5cf0;
  background: linear-gradient(180deg, #eaf5ff 0%, #f6faff 420px, #f9fbff 100%);
  color: var(--cm3-ink);
  min-height: 100vh;
}
/* ---- ヘッダー: マイページ(css/mypage.css の .mp-header / .mp-btn)と同じ色・線・影・ボタン。
   マイページ配下の画面として見えるように、ルーム一覧の暗いヘッダーは使わない */
#screen-community .cm3-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid #e4e8ef;
  font-family: var(--font-body, system-ui, sans-serif); color: #0f172a;
}
#screen-community .cm3-header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
#screen-community .cm3-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
#screen-community .cm3-header-title { font-size: 17px; font-weight: 700; letter-spacing: .01em; margin: 0; color: #0f172a; white-space: nowrap; }
#screen-community .cm3-header-user { font-size: 13px; color: #475569; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#screen-community .cm3-hbtn {
  appearance: none; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  border-radius: 9px; padding: 8px 14px; min-height: 36px; cursor: pointer;
  border: 1px solid #cbd5e1; background: #fff; color: #0f172a; transition: background .12s, border-color .12s;
}
#screen-community .cm3-hbtn:hover { background: #f8fafc; border-color: #64748b; }
#screen-community .cm3-hbtn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
#screen-community .cm3-hbtn-ghost { background: transparent; border-color: transparent; color: #475569; }
#screen-community .cm3-hbtn-ghost:hover { background: #f8fafc; border-color: #e4e8ef; }
#screen-community .cm3-hicon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#screen-community .cm3-root { width: 100%; max-width: 1240px; margin: 0 auto; padding: 18px 20px 64px; box-sizing: border-box; }   /* .screen は縦並びの flex。width が無いと中身の幅まで縮む */
#screen-community .cm3-thread-page { max-width: 880px; width: 100%; margin: 0 auto; }   /* 詳細は読みやすい幅に */
#screen-community .cm3-page { display: flex; flex-direction: column; gap: 20px; }
#screen-community .cm3-icon { width: 1.15em; height: 1.15em; fill: currentColor; flex-shrink: 0; vertical-align: -0.18em; }
#screen-community a { color: inherit; text-decoration: none; }

/* ---- 共通の部品 */
#screen-community .cm3-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 12px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
#screen-community .cm3-btn:active { transform: translateY(1px); }
#screen-community .cm3-btn[disabled] { opacity: .55; cursor: default; }
#screen-community .cm3-btn-primary { background: var(--cm3-blue); color: #fff; box-shadow: 0 4px 0 var(--cm3-blue-dark); }
#screen-community .cm3-btn-primary:hover:not([disabled]) { background: #3d88ff; }
#screen-community .cm3-btn-ghost { background: #fff; color: var(--cm3-blue-dark); border-color: #cfe0ff; }
#screen-community .cm3-btn-ghost:hover { background: #f2f7ff; }
#screen-community .cm3-btn-danger-ghost { background: #fff; color: #d23b4b; border-color: #f6cdd2; min-height: 36px; padding: 0 12px; font-size: 13px; }
#screen-community .cm3-icon-btn { width: 36px; height: 36px; border-radius: 10px; border: none; background: transparent; color: var(--cm3-sub);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
#screen-community .cm3-icon-btn:hover { background: #eef3fb; color: var(--cm3-ink); }
#screen-community .cm3-comment-delete:hover { background: #fdecee; color: #d23b4b; }
#screen-community .cm3-input, #screen-community .cm3-select, #screen-community .cm3-textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--cm3-ink);
  border: 2px solid var(--cm3-line); border-radius: 12px; background: #fff; padding: 10px 14px; min-height: 46px;
}
#screen-community .cm3-textarea { resize: vertical; line-height: 1.7; }
#screen-community .cm3-input:focus, #screen-community .cm3-select:focus, #screen-community .cm3-textarea:focus {
  outline: none; border-color: var(--cm3-blue); box-shadow: 0 0 0 4px rgba(47, 124, 246, .15);
}
#screen-community .cm3-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
#screen-community .cm3-date { color: var(--cm3-sub); font-size: 13px; }
#screen-community .cm3-loading, #screen-community .cm3-empty { color: var(--cm3-sub); padding: 18px 4px; }
#screen-community .cm3-empty-box { background: #fff; border-radius: var(--cm3-radius); padding: 28px; text-align: center; box-shadow: var(--cm3-shadow); }
#screen-community .cm3-error { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #fff1f2; color: #a8243a;
  border: 2px solid #ffd2d8; border-radius: 14px; padding: 14px 16px; }
#screen-community .cm3-field-error { color: #c02a3f; font-size: 14px; margin: 6px 0 0; }
#screen-community .cm3-sparkle { width: 18px; height: 18px; fill: #ffc531; margin-left: 4px; }
#screen-community .cm3-sparkle-big { width: 34px; height: 34px; vertical-align: top; }

/* カテゴリの色 */
#screen-community .cm3-c-yellow { --c: var(--cm3-yellow); --c-bg: var(--cm3-yellow-bg); }
#screen-community .cm3-c-orange { --c: var(--cm3-orange); --c-bg: var(--cm3-orange-bg); }
#screen-community .cm3-c-blue { --c: var(--cm3-blue-a); --c-bg: var(--cm3-blue-bg); }
#screen-community .cm3-c-teal { --c: var(--cm3-teal); --c-bg: var(--cm3-teal-bg); }
#screen-community .cm3-c-purple { --c: var(--cm3-purple); --c-bg: var(--cm3-purple-bg); }
#screen-community .cm3-chip[class*="cm3-c-"] { background: var(--c-bg); color: color-mix(in srgb, var(--c) 78%, #000); }

/* ---- ファーストビュー */
#screen-community .cm3-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: 12px;
  background: linear-gradient(120deg, #ffffff 0%, #eef6ff 55%, #e2f0ff 100%); border-radius: 28px;
  padding: 26px 30px; box-shadow: var(--cm3-shadow); overflow: hidden;
}
#screen-community .cm3-hero-title { font-size: clamp(36px, 5vw, 60px); font-weight: 900; letter-spacing: .04em; margin: 0 0 14px;
  color: #13204a; text-shadow: 3px 3px 0 #ffd84d; line-height: 1.1; }
#screen-community .cm3-hero-lead { font-size: 17px; line-height: 1.85; color: #33405f; margin: 0; max-width: 34em; }
#screen-community .cm3-hero-art img { width: 100%; height: auto; display: block; border-radius: 18px; }
#screen-community .cm3-actions { display: flex; justify-content: flex-end; margin-top: -6px; }
#screen-community .cm3-create-btn { font-size: 16px; padding: 0 24px; min-height: 50px; border-radius: 14px; }

/* ---- 検索 */
#screen-community .cm3-search {
  display: grid; grid-template-columns: 240px minmax(0, 1fr) auto; gap: 12px; align-items: end;
  background: #fff; border-radius: var(--cm3-radius); padding: 16px 18px; box-shadow: var(--cm3-shadow);
}
#screen-community .cm3-search-field { display: flex; flex-direction: column; gap: 6px; }
#screen-community .cm3-search-label { font-size: 13px; font-weight: 700; color: var(--cm3-sub); }
#screen-community .cm3-search-btn { min-height: 46px; }

/* ---- セクション */
#screen-community .cm3-section { background: rgba(255, 255, 255, .7); border-radius: 24px; padding: 18px 18px 22px; }
#screen-community .cm3-cats-section { background: #fffaf0; }
#screen-community .cm3-section.is-hot { background: #fff5f0; }
#screen-community .cm3-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
#screen-community .cm3-section-title { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 900; margin: 0; }
#screen-community .cm3-section-icon { width: 34px; height: 34px; fill: var(--cm3-blue); }
#screen-community .is-hot .cm3-section-icon { fill: #ff6b35; }
#screen-community .cm3-more { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 2px; color: var(--cm3-blue-dark); font-weight: 700; font-size: 15px; padding: 6px 4px; }
#screen-community .cm3-count-pill { background: #eaf1ff; color: var(--cm3-blue-dark); border-radius: 999px; padding: 2px 12px; font-size: 15px; }

/* ---- カテゴリのカード */
#screen-community .cm3-cats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
#screen-community .cm3-cat {
  display: flex; flex-direction: column; background: var(--c-bg); border-radius: 20px; padding: 14px; gap: 10px;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 30%, transparent), var(--cm3-shadow);
  transition: transform .12s ease, box-shadow .12s ease; border: 2px solid #fff;
}
#screen-community .cm3-cat:hover { transform: translateY(-3px); }
#screen-community .cm3-cat-head { display: flex; align-items: center; gap: 10px; min-height: 46px; }   /* 名前が2行に折れても絵の位置をそろえる */
#screen-community .cm3-cat-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--c); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
#screen-community .cm3-cat-icon .cm3-icon { width: 26px; height: 26px; }
#screen-community .cm3-cat-name { font-weight: 900; font-size: 17px; line-height: 1.3; }
#screen-community .cm3-cat-art { display: block; border-radius: 14px; overflow: hidden; background: #fff; aspect-ratio: 3 / 2; }
#screen-community .cm3-cat-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
#screen-community .cm3-cat-foot { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 10px 12px; flex: 1; }
#screen-community .cm3-cat-desc { font-size: 13px; line-height: 1.6; color: #3c4763; flex: 1; }
#screen-community .cm3-cat-go { width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0; }

/* ---- スレッドのカード */
#screen-community .cm3-rail-wrap { position: relative; }
#screen-community .cm3-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, calc((100% - 56px) / 5)); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; scrollbar-width: thin; }
#screen-community .cm3-rail > .cm3-card { scroll-snap-align: start; }
#screen-community .cm3-rail-next { position: absolute; right: -10px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
  border-radius: 50%; border: none; background: #fff; color: var(--cm3-blue); box-shadow: var(--cm3-shadow); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; }
#screen-community .cm3-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; background: var(--cm3-card); border-radius: 16px;
  padding: 14px; box-shadow: var(--cm3-shadow); border: 2px solid transparent; min-width: 0;
  transition: transform .12s ease, border-color .12s ease;
}
#screen-community .cm3-card:hover { transform: translateY(-2px); border-color: #cfe0ff; }
#screen-community .cm3-card.is-hot { padding-top: 40px; }
#screen-community .cm3-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
#screen-community .cm3-card-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#screen-community .cm3-card-title { font-size: 16px; font-weight: 800; line-height: 1.45; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#screen-community .cm3-card-excerpt { font-size: 13px; line-height: 1.65; color: var(--cm3-sub); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
#screen-community .cm3-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#screen-community .cm3-thumb { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: #eef3fb;
  display: inline-flex; align-items: center; justify-content: center; }
#screen-community .cm3-thumb.is-icon { background: var(--c-bg); color: var(--c); }
#screen-community .cm3-thumb.is-icon .cm3-icon { width: 30px; height: 30px; }
#screen-community .cm3-thumb-img { width: 100%; height: 100%; object-fit: cover; }
#screen-community .cm3-hot-badge { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 800; color: #fff; }
#screen-community .cm3-hot-badge > .cm3-icon { background: #ff5a36; border-radius: 999px; padding: 3px; width: 22px; height: 22px; fill: #fff; }
#screen-community .cm3-hot-badge { color: #e2451f; }
#screen-community .cm3-hot-recent { font-weight: 600; color: #a2553b; font-size: 12px; }
#screen-community .cm3-stats { display: inline-flex; gap: 10px; align-items: center; color: var(--cm3-sub); font-size: 14px; }
#screen-community .cm3-stat { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: #f2f5fb; }

/* アバター(上半身) */
#screen-community .cm3-author { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; font-size: 14px; }
#screen-community a.cm3-author:hover .cm3-author-name { text-decoration: underline; }
#screen-community .cm3-author-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#screen-community .cm3-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden;
  background: #e5f0ff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); flex-shrink: 0; }
#screen-community .cm3-avatar canvas { width: 100%; height: 100%; image-rendering: pixelated; }
#screen-community .cm3-avatar.is-default { background: linear-gradient(135deg, #8fb8ff, #6b8cff); color: #fff; font-weight: 800; }
#screen-community .cm3-author.is-large { font-size: 16px; }

/* ---- 一覧 */
#screen-community .cm3-crumbs { font-size: 14px; color: var(--cm3-sub); }
#screen-community .cm3-crumbs a { color: var(--cm3-blue-dark); font-weight: 700; }
#screen-community .cm3-list-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center;
  background: var(--c-bg, #fff); border-radius: 22px; padding: 20px 22px; box-shadow: var(--cm3-shadow); }
#screen-community .cm3-list-title { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 28px; font-weight: 900; }
#screen-community .cm3-list-desc { grid-column: 1; margin: 0; color: #3c4763; }
#screen-community .cm3-list-head .cm3-create-btn { grid-row: 1 / span 2; grid-column: 2; }
#screen-community .cm3-count { margin: 0; color: var(--cm3-sub); font-weight: 700; }
#screen-community .cm3-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
#screen-community .cm3-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 8px; }
#screen-community .cm3-page-btn { min-width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--cm3-line); background: #fff;
  font: inherit; font-weight: 800; color: var(--cm3-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
#screen-community .cm3-page-btn.is-current { background: var(--cm3-blue); color: #fff; border-color: var(--cm3-blue); }
#screen-community .cm3-page-btn[disabled]:not(.is-current) { opacity: .4; cursor: default; }
#screen-community .cm3-page-gap { color: var(--cm3-sub); padding: 0 2px; }

/* ---- 詳細 */
#screen-community .cm3-thread-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
#screen-community .cm3-thread { background: #fff; border-radius: 24px; box-shadow: var(--cm3-shadow); padding: 26px; display: flex; flex-direction: column; gap: 18px; }
#screen-community .cm3-thread-head { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
#screen-community .cm3-thread-title { font-size: clamp(22px, 3vw, 30px); font-weight: 900; line-height: 1.4; margin: 0; overflow-wrap: anywhere; }
#screen-community .cm3-thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
#screen-community .cm3-thread-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.9; color: #27324f; }
#screen-community .cm3-gallery { display: flex; flex-direction: column; gap: 10px; }
#screen-community .cm3-gallery-main { width: 100%; aspect-ratio: 16 / 9; background: #f1f5fc; border-radius: 18px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
#screen-community .cm3-gallery-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
#screen-community .cm3-gallery-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; }
#screen-community .cm3-gallery-thumb { flex: 0 0 auto; width: 96px; height: 64px; border-radius: 10px; overflow: hidden; padding: 0;
  border: 3px solid transparent; background: #eef3fb; cursor: pointer; opacity: .75; }
#screen-community .cm3-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#screen-community .cm3-gallery-thumb.is-active { border-color: var(--cm3-blue); opacity: 1; }

/* ---- コメント */
#screen-community .cm3-comments { background: #fff; border-radius: 24px; box-shadow: var(--cm3-shadow); padding: 22px 24px; }
#screen-community .cm3-comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
#screen-community .cm3-comment { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--cm3-line); }
#screen-community .cm3-comment:first-child { border-top: none; }
#screen-community .cm3-comment-main { flex: 1; min-width: 0; }
#screen-community .cm3-comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#screen-community .cm3-comment-head .cm3-comment-delete { margin-left: auto; }
#screen-community .cm3-comment-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; line-height: 1.8; }
#screen-community .cm3-comment-images { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
#screen-community .cm3-comment-image img { width: 140px; height: 100px; object-fit: cover; border-radius: 10px; display: block; background: #eef3fb; }
#screen-community .cm3-comment-open { margin-top: 16px; }
#screen-community .cm3-comment-form { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; background: #f6f9ff; border-radius: 16px; padding: 14px; }
#screen-community .cm3-form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* 画像を選ぶ */
#screen-community .cm3-picker { display: flex; flex-direction: column; gap: 8px; }
#screen-community .cm3-attach { align-self: flex-start; position: relative; overflow: hidden; }
#screen-community .cm3-attach.is-disabled { opacity: .5; pointer-events: none; }
#screen-community .cm3-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#screen-community .cm3-previews { display: flex; gap: 8px; flex-wrap: wrap; }
#screen-community .cm3-preview { position: relative; width: 96px; height: 72px; border-radius: 10px; overflow: hidden; background: #eef3fb; }
#screen-community .cm3-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
#screen-community .cm3-preview-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(20, 30, 50, .7); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* ---- ポップアップ */
#screen-community .cm3-modal-overlay, .cm3-viewer {
  position: fixed; inset: 0; z-index: 1000; background: rgba(18, 28, 52, .5); display: flex; align-items: center; justify-content: center;
  padding: 16px; box-sizing: border-box;
}
#screen-community .cm3-modal { width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: #fff; border-radius: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); overflow: hidden; }
#screen-community .cm3-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--cm3-line); }
#screen-community .cm3-modal-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 20px; font-weight: 900; }
#screen-community .cm3-modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
#screen-community .cm3-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--cm3-line); }
#screen-community .cm3-field { display: flex; flex-direction: column; gap: 6px; }
#screen-community .cm3-field-label { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; }
#screen-community .cm3-field-label em { font-style: normal; font-size: 11px; color: #fff; background: #ff6b5a; border-radius: 6px; padding: 1px 6px; }
#screen-community .cm3-field-label small { font-weight: 500; color: var(--cm3-sub); }
.cm3-viewer { cursor: zoom-out; }
.cm3-viewer-img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ---- スマートフォン */
@media (max-width: 1100px) {
  #screen-community .cm3-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 899px) {                       /* マイページと同じ境目で詰める */
  #screen-community .cm3-header { padding: 10px 12px; }
  #screen-community .cm3-header-title { font-size: 15px; }
}
@media (max-width: 760px) {
  #screen-community .cm3-root { padding: 12px 12px 48px; }
  #screen-community .cm3-hero { grid-template-columns: 1fr; padding: 20px 18px; border-radius: 22px; }
  #screen-community .cm3-hero-lead { font-size: 15px; }
  #screen-community .cm3-actions { justify-content: stretch; margin-top: 0; }
  #screen-community .cm3-actions .cm3-create-btn { width: 100%; }
  #screen-community .cm3-search { grid-template-columns: 1fr; }
  #screen-community .cm3-search-btn { width: 100%; }
  #screen-community .cm3-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #screen-community .cm3-cat { padding: 10px; }
  #screen-community .cm3-cat-name { font-size: 14px; }
  #screen-community .cm3-cat-desc { font-size: 12px; }
  #screen-community .cm3-section { padding: 14px 10px 16px; border-radius: 18px; }
  #screen-community .cm3-section-title { font-size: 19px; gap: 8px; white-space: nowrap; }
  #screen-community .cm3-section-title .cm3-sparkle { display: none; }   /* 狭い画面では見出しを1行に収める */
  #screen-community .cm3-cat-foot { padding: 8px 9px; gap: 6px; }
  #screen-community .cm3-cat-go { width: 24px; height: 24px; }
  #screen-community .cm3-rail { grid-auto-columns: 78%; }
  #screen-community .cm3-rail-next { display: none; }
  #screen-community .cm3-list-head { grid-template-columns: 1fr; padding: 16px; }
  #screen-community .cm3-list-head .cm3-create-btn { grid-row: auto; grid-column: 1; width: 100%; }
  #screen-community .cm3-list-title { font-size: 22px; }
  #screen-community .cm3-list { grid-template-columns: 1fr; }
  #screen-community .cm3-thread { padding: 18px 16px; border-radius: 18px; }
  #screen-community .cm3-comments { padding: 16px 14px; border-radius: 18px; }
  #screen-community .cm3-page-btn { min-width: 40px; height: 40px; }
  #screen-community .cm3-modal-overlay { padding: 8px; align-items: flex-end; }
  #screen-community .cm3-modal { max-height: calc(100vh - 16px); border-radius: 20px 20px 16px 16px; }
}
@media (max-width: 480px) {                       /* 390px でも1行に収める(名前は隠し、戻るは矢印だけ) */
  #screen-community .cm3-header { gap: 6px; flex-wrap: nowrap; }
  #screen-community .cm3-header-left { gap: 4px; }
  #screen-community .cm3-header-user { display: none; }
  #screen-community .cm3-hbtn { padding: 7px 10px; font-size: 13px; min-height: 34px; }
  #btn-community-rooms span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 380px) {
  #screen-community .cm3-cats { grid-template-columns: 1fr; }
}
