[hidden] { display: none !important; }
/* ↑ hidden 属性を確実に効かせる（.modal-bg 等の display:flex が UA の [hidden] に勝つ事故の再発防止・2026-09-06） */

/* ============================================================
   ScienceX プロジェクトルーム — pj.css（最終版・2026-09-06 合議）
   土台: 生成りの紙地 × 深い紺 × 漆のような金（premium）。
   規律: 型は --t-* の梯子だけ・和文にトラッキングを掛けない・角丸 4/6/10/12・影3段・ヘアラインで区切る。
   信号の役割分担: 選択＝暖色ニュートラル地＋紺バー／注意＝金（未読ドット・回答待ち・追記・アクティブタブ）。
   赤は塗らない（削除・除名・失効は灰→hoverで赤字）。
   レイアウト高さは --hdr-h / --bar-h にだけ書く（.split と sticky が --chrome-h を読む）。
   ============================================================ */
:root {
  /* brand */
  --navy: #1A2742; --navy-700: #26385C; --navy-900: #0F1A2E;
  --gold: #C39A3C; --gold-600: #B08A33; --gold-deep: #8A6516; --gold-100: #F7EFDD; --gold-200: #EBDCB4;
  /* paper & ink */
  --bg: #F5F3EE; --surface: #FFFFFF; --surface-2: #FAF9F6; --surface-3: #F1EEE7; --sel: #EEEBE3;
  --ink: #1F2633; --ink-2: #3A4250; --ink-3: #626A78;
  --line: #E7E3DA; --line-soft: #EFECE5; --line-strong: #D4CEC2; --line-input: #CBD0D9;
  /* status（面は淡く・文字で語る） */
  --red: #B42318; --red-100: #FBEAE8; --red-ink: #9A3328; --green: #1F7A4D; --green-100: #E6F2EA; --blue: #2B4C8C;
  /* legacy names — inline styles in the pages rely on these */
  --body: var(--ink); --gray: var(--ink-3); --border: var(--line);
  /* type ladder（これ以外のサイズを書かない） */
  --t-11: 11px; --t-115: 11.5px; --t-12: 12px; --t-125: 12.5px; --t-13: 13px; --t-135: 13.5px; --t-14: 14px; --t-145: 14.5px; --t-17: 17px; --t-24: 24px;
  /* scales */
  --r-1: 4px; --r-2: 6px; --r-3: 10px; --r-4: 12px;
  --sh-1: 0 1px 2px rgba(24,30,46,.05);
  --sh-2: 0 1px 2px rgba(24,30,46,.05), 0 8px 24px -10px rgba(24,30,46,.12);
  --sh-3: 0 2px 6px rgba(16,22,40,.10), 0 28px 56px -16px rgba(16,22,40,.32);
  --ring: 0 0 0 3px rgba(195,154,60,.30);
  --hdr-h: 52px; --bar-h: 48px; --banner-h: 0px;   /* banner は閲覧のみのときだけ出る。高さは room.html が実測して入れる */
  --chrome-h: calc(var(--hdr-h) + var(--bar-h) + var(--banner-h));
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); font-size: var(--t-14); line-height: 1.65; color: var(--ink); background: var(--bg);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: rgba(195,154,60,.28); }
a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--navy); }
h1, h2, h3 { color: var(--navy); font-weight: 700; letter-spacing: 0; line-height: 1.35; font-feature-settings: "palt"; }
b, strong { font-weight: 600; }
button, input, select, textarea { font-family: inherit; font-size: var(--t-14); color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* ---------- buttons: 主=紺 · 副=白ヘアライン · 警告=灰枠に赤字 · 金=新規作成の入口だけ · quiet=文字だけ ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; min-height: 34px; border-radius: var(--r-2);
  border: 1px solid var(--navy); background: var(--navy); color: #fff;
  font-weight: 600; font-size: var(--t-135); line-height: 1.3; white-space: nowrap; text-decoration: none; user-select: none;
  transition: background-color .12s, border-color .12s, box-shadow .12s, color .12s; }
.btn:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn:active { background: var(--navy-900); border-color: var(--navy-900); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.sec { background: var(--surface); color: var(--navy); border-color: var(--line-strong); }
.btn.sec:hover { background: var(--surface-2); border-color: #C3BCAE; }
.btn.sec:active { background: var(--surface-3); }
.btn.warn { background: var(--surface); color: var(--red-ink); border-color: var(--line-strong); }
.btn.warn:hover { background: var(--red-100); border-color: #E2B8B3; color: var(--red); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.gold:hover { background: var(--gold-600); border-color: var(--gold-600); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--ink-3); font-weight: 500; box-shadow: none; }
.btn.quiet:hover { background: var(--surface-3); color: var(--red-ink); }   /* 赤は hover の文字だけ・面には塗らない */
.btn.quiet:active { background: var(--line-soft); }
.btn.sm { padding: 4px 10px; min-height: 28px; font-size: var(--t-125); font-weight: 500; }
a.btn { text-decoration: none; }

/* ---------- form controls（枠は中立グレー＝無効欄に見せない。金はフォーカスにだけ） ---------- */
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line-input); border-radius: var(--r-2); outline: none;
  background: var(--surface); color: var(--ink); line-height: 1.5; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: #B3BAC6; }
input:focus, select:focus, textarea:focus { border-color: var(--gold-600); box-shadow: var(--ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--ink-3); border-color: var(--line); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--navy); margin: 0; }
input[type=file] { font-size: var(--t-125); color: var(--ink-3); padding: 6px 0; }
textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
label { display: block; font-size: var(--t-12); font-weight: 600; color: var(--ink-3); margin: 14px 0 6px; }
label .muted { font-weight: 400; }
label:has(> input[type=checkbox]) { font-weight: 400; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-12); }
.err { color: var(--red); font-size: var(--t-125); min-height: 18px; margin-top: 8px; }
.ok { color: var(--green); font-size: var(--t-125); }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- header: 製品の銘板（ナビは全部ゴースト、金はヘアラインと "プロジェクトルーム" と在席ドットだけ） ---------- */
.hdr {
  position: sticky; top: 0; z-index: 30; height: var(--hdr-h);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: var(--navy); color: #fff; border-bottom: 1px solid rgba(195,154,60,.40); }
.hdr .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 700; font-size: var(--t-145); letter-spacing: .04em; white-space: nowrap; }
.hdr .brand img { width: 18px; height: 30px; object-fit: contain; display: block; }   /* 素材は縦長の金X（204×338）。正方形に潰さない */
.hdr .brand span.pj { color: var(--gold); font-weight: 600; }
.hdr .title { flex: 1; min-width: 0; font-size: var(--t-135); line-height: 1.4; color: #D5DBE8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr .title:not(:empty)::before { content: ''; display: inline-block; width: 1px; height: 16px; margin-right: 16px; background: rgba(255,255,255,.16); vertical-align: -3px; }
.hdr nav { display: flex; gap: 2px; align-items: center; flex: 0 1 auto; min-width: 0; }
.hdr nav a, .hdr nav button {
  display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-2); background: transparent;
  color: rgba(255,255,255,.78); text-decoration: none; font-size: var(--t-125); font-weight: 500; white-space: nowrap;
  transition: background-color .12s, color .12s; }
.hdr nav a:hover, .hdr nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.hdr nav a:focus-visible, .hdr nav button:focus-visible { outline-color: var(--gold); outline-offset: -2px; }
.hdr .me {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; margin: 0 6px 0 8px; padding: 0 10px 0 9px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(255,255,255,.07);
  font-size: var(--t-12); color: #E4E8F0; white-space: nowrap; }
.hdr .me::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.hdr .me:empty { display: none; }

/* ---------- card (login / join / new) ---------- */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(900px 520px at 50% -8%, #EFEAE0 0%, var(--bg) 62%); }
.card {
  width: 100%; max-width: 420px; padding: 36px 36px 28px; background: var(--surface);
  border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: var(--r-4); box-shadow: var(--sh-2); }
.card.wide { max-width: 600px; }
.card .brand { text-align: center; margin-bottom: 24px; }
.card .brand img { width: 40px; height: 40px; object-fit: contain; }
.card .brand h1 { font-size: var(--t-17); letter-spacing: .06em; margin: 12px 0 5px; }
.card .brand .sub { color: var(--ink-3); font-size: var(--t-11); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.card input:where([type=text], [type=email], [type=password], [type=date], [type=number]) { height: 42px; font-size: var(--t-14); }
.card .btn { width: 100%; margin-top: 22px; padding: 11px; min-height: 42px; font-size: var(--t-14); }
.card .secure { margin: 24px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: var(--t-115); line-height: 1.7; color: var(--ink-3); }
.card .secure summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.links { margin-top: 16px; text-align: center; font-size: var(--t-125); }
.links a, .links button.link { color: var(--navy); background: none; border: none; text-decoration: none; margin: 0 6px; padding: 0; font-size: var(--t-125); font-weight: 500; }
.links a:hover, .links button.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- general pages (index / admin / settings) ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 24px 20px 72px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-1);
  padding: 20px 24px 22px; margin-bottom: 20px; min-width: 0; overflow-x: auto; contain: inline-size; }
div:has(> .panel) { min-width: 0; }   /* grid/flex の子に置かれても panel が親を押し広げない（幅は panel 側で吸収して横スクロール） */
.panel h2 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line); font-size: var(--t-145); }
.panel h2::before, .modal h2::before { content: ''; width: 3px; height: 15px; border-radius: 1px; background: var(--gold); flex: none; }
.panel h2 .sp { flex: 1; }
.panel h2 .muted { font-weight: 400; }
.panel h3 { font-size: var(--t-135); font-weight: 600; }
.panel > p.muted { line-height: 1.7; }
.tblwrap {
  overflow-x: auto;
  /* 横に続きがあることが分かるよう端に影を出す（狭い幅で操作列が隠れるため） */
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, rgba(255,255,255,0)) right center / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(20,24,32,.10), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(20,24,32,.10), transparent) right center / 12px 100% no-repeat scroll;
}
/* メンバー表: 長い列は詰めて省略し、操作ボタンが右端で切れないようにする（2026-09-06） */
table.tbl td.clip { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
table.tbl td.email { max-width: 190px; }
@media (max-width: 1100px) { table.tbl td.clip { max-width: 96px; } table.tbl td.email { max-width: 140px; } }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-13); }
table.tbl th, table.tbl td { border-bottom: 1px solid var(--line-soft); padding: 12px 10px; text-align: left; vertical-align: middle; line-height: 20px; white-space: nowrap; word-break: keep-all; }
table.tbl th { color: var(--ink-3); font-weight: 600; font-size: var(--t-115); border-bottom: 1px solid var(--line-strong); padding-top: 4px; padding-bottom: 8px; }
table.tbl td b { color: var(--ink); }
table.tbl td .small { font-size: var(--t-12); color: var(--ink-3); }
table.tbl td:last-child { white-space: normal !important; }   /* 操作セルだけ折り返しを許し、ボタンが右端で切れないようにする */
table.tbl td .btn.sm { margin: 2px 4px 2px 0; padding: 3px 8px; min-height: 26px; font-size: var(--t-12); }
table.tbl td .btn.sm + .btn.sm { margin-left: 0; }
table.tbl a { text-decoration: none; }
table.tbl a:hover { text-decoration: underline; }
table.tbl tr:hover td { background: var(--surface-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .row2, .row3 { grid-template-columns: 1fr; } }

/* ---------- tags · badge · banner · toast · copy（タグは1形状: 20px/角4/11px/600・枠なし） ---------- */
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-1);
  font-size: var(--t-11); font-weight: 600; letter-spacing: .02em; line-height: 1; white-space: nowrap; vertical-align: middle;
  background: #EBEEF4; color: var(--navy); text-decoration: none; }
.tag.gold { background: var(--gold-100); color: var(--gold-deep); }
.tag.red { background: #F5E9E6; color: #8E3A2F; }
.tag.green { background: var(--green-100); color: #1F6B44; }
.tag.gray { background: #ECEAE4; color: #5B6472; }
a.tag:hover { text-decoration: underline; text-underline-offset: 2px; }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: var(--gold); color: var(--navy); font-size: var(--t-11); font-weight: 700; line-height: 1; }
.banner { display: flex; align-items: center; gap: 10px; background: var(--gold-100); color: #6F5212; padding: 9px 20px; font-size: var(--t-125); border-bottom: 1px solid var(--gold-200); }
.banner::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100;
  background: var(--navy-900); color: #fff; padding: 10px 18px; border-radius: var(--r-2); font-size: var(--t-13); box-shadow: var(--sh-3);
  opacity: 0; transition: opacity .15s; pointer-events: none; }
.toast.show { opacity: 1; }
.toast.bad { background: var(--red); }
.copy {
  display: inline-block; max-width: 36em; white-space: normal; word-break: break-all;
  font-family: var(--mono); font-size: var(--t-12); color: var(--ink-2); line-height: 1.5;
  background: var(--surface-2); border: 1px solid var(--line-soft); padding: 4px 8px; border-radius: var(--r-1); }

/* ---------- roombar: tabs left · [search 表示行 select] | actions right ---------- */
.roombar {
  position: sticky; top: var(--hdr-h); z-index: 20; height: var(--bar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; height: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  height: 100%; padding: 0 12px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--ink-3); font-size: var(--t-135); font-weight: 600; white-space: nowrap; transition: color .12s, border-color .12s; }
.tabs button:hover { color: var(--navy); }
.tabs button.on { color: var(--navy); border-bottom-color: var(--gold); }
.tabs button:focus-visible { outline-offset: -2px; }
.tabs button .n {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; vertical-align: 1px;
  background: var(--surface-3); color: var(--ink-3); font-size: var(--t-11); font-weight: 600; line-height: 18px; text-align: center; }
.tabs button .n:empty { display: none; }
.tabs button.on .n { background: #E8E4DA; color: var(--navy); }
.roombar .sp { flex: 1; }
.roombar .tools { display: flex; align-items: center; gap: 8px; font-size: var(--t-12); color: var(--ink-3); }
.roombar .tools > span { white-space: nowrap; }
.roombar .tools select { width: auto; height: 30px; min-height: 30px; padding: 0 26px 0 8px; font-size: var(--t-125); }
.roombar .tools select + .btn { position: relative; margin-left: 10px; }
.roombar .tools select + .btn::before { content: ''; position: absolute; left: -10px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
/* 検索（部品1）: 静かな枠・CSSで描く虫眼鏡・右端に件数 */
.roombar .tools .search { position: relative; display: inline-flex; align-items: center; }
.roombar .tools .search::before { content: ''; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px; margin-top: -6px; border: 1.5px solid var(--ink-3); border-radius: 50%; pointer-events: none; }
.roombar .tools .search::after { content: ''; position: absolute; left: 19px; top: 50%; width: 5px; height: 1.5px; margin-top: 2px; background: var(--ink-3); transform: rotate(45deg); transform-origin: left center; pointer-events: none; }
.roombar .tools .search input {
  width: 240px; height: 30px; min-height: 30px; padding: 0 44px 0 30px; border: 1px solid var(--line); border-radius: var(--r-2);
  background: var(--surface-2); font-size: var(--t-125); -webkit-appearance: none; appearance: none; }
.roombar .tools .search input::-webkit-search-cancel-button, .roombar .tools .search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.roombar .tools .search input:hover { border-color: var(--line-strong); }
.roombar .tools .search input:focus { border-color: var(--gold-600); background: var(--surface); box-shadow: var(--ring); }
.roombar .tools .search .cnt { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: var(--t-11); color: var(--ink-3); pointer-events: none; }

/* ---------- split: list + detail ---------- */
.split { display: grid; grid-template-columns: minmax(340px, 40%) minmax(0, 1fr); flex: 1; min-height: 0; height: calc(100vh - var(--chrome-h)); height: calc(100dvh - var(--chrome-h)); }
/* ルームバーは幅が狭いと折り返して高くなる。実測に追随させるため、プロジェクトルームのページは
   本文を縦フレックスにして .split に残りを与える（--chrome-h のズレで空スクロールが出るのを防ぐ・2026-09-06） */
body:has(> .split) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
body:has(> .split) .split { height: auto; }
.list { overflow-y: auto; overscroll-behavior: contain; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; scrollbar-color: #CFC9BD transparent; scrollbar-gutter: stable; }
.detail { overflow-y: auto; overscroll-behavior: contain; min-height: 0; background: var(--bg); padding: 24px 32px 72px; scrollbar-width: thin; scrollbar-color: #CFC9BD transparent; }
.detail > * { max-width: 880px; }   /* 14.5px の和文で1行約60字に抑える */
.detail > .empty { max-width: none; }
.detail .empty { padding: 96px 24px; }
/* 通知帯（部品2）: 一覧の先頭に置く静かな金の帯。モーダルで遮らない */
.notice {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 22px;
  background: var(--gold-100); border-bottom: 1px solid var(--gold-200); color: #6F5212; font-size: var(--t-125); line-height: 1.5; }
.notice::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: -2px; }
.notice > span:first-of-type { min-width: 0; }
.notice .sp { flex: 1; }
.notice button.link {
  background: none; border: 0; padding: 2px 4px; border-radius: var(--r-1); color: var(--navy); font-size: var(--t-125); font-weight: 600; white-space: nowrap;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold-200); transition: background-color .12s, text-decoration-color .12s; }
.notice button.link:hover { text-decoration-color: var(--navy); background: rgba(26,39,66,.06); }
.notice button.link.x { color: var(--ink-3); text-decoration: none; font-size: var(--t-14); line-height: 1; padding: 2px 7px; }
.notice button.link.x:hover { color: var(--ink); }
/* 一覧の行: Q番号(幅固定) → 記入者 → 補助 → 日時 ／ 質問 ／ Aプレビュー */
.row { position: relative; padding: 12px 18px 12px 24px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background-color .12s; }
.row:hover { background: var(--surface-2); }
.row.sel { background: var(--sel); box-shadow: inset 3px 0 0 var(--navy); }
.row.done { color: var(--ink-3); background: var(--surface-2); }
.row.done.sel { background: #E9E5DC; }
.row:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; }
.row.unread::before { content: ''; position: absolute; left: 10px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--gold-100); }
.row .top { display: flex; align-items: center; gap: 8px; font-size: var(--t-115); line-height: 1.4; color: var(--ink-3); margin-bottom: 5px; }
.row .top .no { font-weight: 700; font-size: var(--t-13); color: var(--navy); min-width: 3.5ch; }
.row.done .top .no { color: var(--ink-3); }
.row .top .who { color: var(--ink-2); font-weight: 600; font-size: var(--t-12); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 10em; }
.row .top .co { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12em; }
.row .top .rel { padding: 0 5px; border: 1px solid var(--line); border-radius: var(--r-1); font-size: 10.5px; line-height: 15px; color: var(--ink-3); white-space: nowrap; }
.row .top .att { white-space: nowrap; color: var(--ink-3); font-size: var(--t-11); filter: grayscale(1); opacity: .7; }
.row .top .when { margin-left: auto; white-space: nowrap; color: var(--ink-3); }
.row .top .tag { height: 18px; font-size: 10.5px; }
.row .q, .row .a { font-size: var(--t-135); line-height: 1.6; overflow: hidden; word-break: break-word; }
.row .q { color: var(--ink); }
.row.done .q { color: var(--ink-3); }
.row .a { font-size: var(--t-125); line-height: 1.55; color: var(--ink-3); margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line); }
.row.sel .a { border-left-color: #C9CFDB; }
.row .a::before { content: 'A'; font-size: 10px; font-weight: 700; color: var(--gold-deep); margin-right: 6px; letter-spacing: .05em; }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.clamp-5 { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.clamp-0 { display: block; white-space: pre-wrap; }
.empty { padding: 56px 20px; text-align: center; color: var(--ink-3); font-size: var(--t-135); line-height: 1.8; }

/* ---------- detail pane ---------- */
.d-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.d-head .no { font-size: var(--t-24); font-weight: 700; color: var(--navy); letter-spacing: -.01em; line-height: 1.1; margin-right: 2px; }
.d-head .tag { align-self: center; }
.d-head a.tag { background: var(--surface); border: 1px solid var(--line-strong); color: var(--navy); height: 20px; }   /* 参照＝枠付き（状態＝塗り と区別） */
.d-head a.tag:hover { border-color: var(--navy); text-decoration: none; }
.d-head .meta { font-size: var(--t-12); color: var(--ink-3); }
.d-head .meta b { color: var(--ink-2); }
.d-head .back { display: none; align-self: center; }
.qsec {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-1);
  padding: 16px 20px 18px; margin-bottom: 14px; }
.qsec h3 {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft); font-size: var(--t-13); }
.qsec h3 .lbl {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none;
  border-radius: var(--r-2); background: var(--navy); color: #fff; font-size: var(--t-125); font-weight: 700; }
.qsec.a h3 .lbl { background: var(--gold); color: var(--navy); }   /* 金地には紺文字（CTA・Aマーカーと同じ規則・5.7:1） */
.qsec h3 .meta { flex: 1; min-width: 8em; font-size: var(--t-12); font-weight: 400; color: var(--ink-3); }
.qsec h3 .meta b { color: var(--ink-2); }
.qsec .text { font-size: var(--t-145); line-height: 1.85; color: var(--ink); min-height: 27px; }
.qsec .text.empty-text { color: var(--ink-3); }
/* 回答の空状態（部品4）: 招待として見せる。押せることは点線と hover の金で伝える */
.qsec .text.invite {
  padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface-2);
  color: var(--ink-3); font-size: var(--t-135); line-height: 1.7; cursor: pointer; min-height: 0;
  transition: border-color .12s, background-color .12s, color .12s; }
.qsec .text.invite:hover, .qsec .text.invite:focus-visible { border-color: var(--gold); background: #FCF8EE; color: #6F5212; }
.qsec .text.invite:focus-visible { outline: none; box-shadow: var(--ring); }
.qsec .editor textarea { min-height: 150px; font-size: var(--t-14); }
.qsec .editor .ebtns { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.qsec .editor .ebtns .muted { flex: 1; }
.files { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.files .f { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 3px 0; font-size: var(--t-125); }
.files .f a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); font-weight: 500; text-decoration: none; }
.files .f a:hover { text-decoration: underline; }
.files .f .meta { color: var(--ink-3); white-space: nowrap; font-size: var(--t-115); }
.files .f button { background: none; border: none; color: var(--ink-3); font-size: var(--t-115); padding: 2px 6px; border-radius: var(--r-1); transition: background-color .12s, color .12s; }
.files .f button:hover { color: var(--red); background: var(--red-100); }
.drop {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; padding: 9px 12px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-2); background: var(--surface-2);
  font-size: var(--t-125); color: var(--ink-3); transition: border-color .12s, background-color .12s; }
.drop.over { border-color: var(--gold); background: var(--gold-100); color: #6F5212; }
.drop input { display: none; }
.drop .pick { color: var(--navy); background: none; border: none; padding: 0; font-size: var(--t-125); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.drop .pick:hover { text-decoration-color: var(--navy); }
/* 追記の見出し（本文 .pre の中に入るので inline-block・white-space は戻す） */
.ap { margin: 14px 0 4px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.ap-h { display: inline-block; white-space: normal; font-size: var(--t-115); color: var(--ink-3); }
.ap-h::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--gold); vertical-align: 1px; }
.ap-h b { color: var(--navy); font-weight: 600; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 16px; }
.hist { font-size: var(--t-125); }
.hist .e { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); line-height: 1.5; }
.hist .e:last-child { border-bottom: none; }
.hist .e b { color: var(--ink-2); white-space: nowrap; }
.hist .e .t { min-width: 88px; color: var(--ink-3); white-space: nowrap; }
.hist .e .d { flex: 1; min-width: 0; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- modals ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center;
  padding: 64px 16px; overflow-y: auto; background: rgba(20,27,42,.45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal { width: 100%; max-width: 720px; padding: 24px 28px; background: var(--surface); border-radius: var(--r-4); box-shadow: var(--sh-3); }
.modal h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); font-size: var(--t-17); }
.modal .mbtns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
/* attachment viewer */
.modal-bg.view { padding: 3vh 2vw; align-items: stretch; }
.modal.viewer { max-width: none; width: 100%; height: 94vh; padding: 10px 12px 12px; display: flex; flex-direction: column; }
.viewer .vhead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.viewer .vtitle { font-weight: 600; font-size: var(--t-135); color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .vbody { flex: 1; min-height: 0; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-2); overflow: auto; display: flex; align-items: center; justify-content: center; }
.viewer .vbody iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer .vbody img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* change list */
.chg .e { display: flex; align-items: baseline; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); border-radius: var(--r-1); cursor: pointer; font-size: var(--t-13); transition: background-color .12s; }
.chg .e:hover { background: var(--surface-2); }
.chg .e b { color: var(--ink-2); white-space: nowrap; }
.chg .e .no { font-weight: 700; color: var(--navy); width: 48px; flex: none; }
.chg .e .t { color: var(--ink-3); margin-left: auto; white-space: nowrap; font-size: var(--t-12); }
/* 動きが多いと本文より下にボタンが行って押せなくなる。一覧だけスクロールさせる */
.chg { max-height: 52vh; overflow: auto; }

/* スマホ: 1行に詰めると文字が縦に割れる。2段に折り返す */
@media (max-width: 560px) {
  .chg { max-height: 46vh; }
  .chg .e { flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 9px 4px; }
  .chg .e .no { width: auto; min-width: 2.6em; }
  .chg .e b { flex: none; }
  .chg .e .t { margin-left: auto; }
  .chg .e .muted { flex: 1 0 100%; max-width: 100% !important; white-space: normal !important;
                   overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .modal { padding: 18px 16px; }
  .modal .mbtns { flex-wrap: wrap; }
}

/* ---------- wide desktop: カードに少し空気を入れる ---------- */
@media (min-width: 1280px) {
  .qsec { padding: 18px 24px 20px; }
}
/* ---------- laptop: ルームバーを1行に収める（検索を詰め・「表示行」ラベルを省く） ---------- */
@media (max-width: 1279px) {
  .roombar .tools .search input { width: 180px; }
  .roombar .tools > span:not(.search) { display: none; }
  .tabs button { padding: 0 10px; }
}
/* ---------- small laptop / tablet landscape: タブ行とツール行の2段。高さは --bar-h だけを変える ---------- */
@media (max-width: 1100px) and (min-width: 821px) {
  :root { --bar-h: 92px; }
  .roombar { flex-wrap: wrap; align-content: flex-start; gap: 0; }
  .roombar .sp { display: none; }
  .tabs { flex: 1 0 100%; height: 46px; box-shadow: inset 0 -1px 0 var(--line-soft); }
  .roombar .tools { width: 100%; height: 46px; justify-content: flex-end; }
  .roombar .tools .search input { width: 220px; }
}

/* ---------- mobile: single pane; body.show-detail switches to the detail ---------- */
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; height: auto; }
  .list { border-right: none; min-height: 0; }
  .detail { display: none; padding: 16px 14px 64px; }
  .detail .empty { padding: 56px 20px; }
  body.show-detail .list { display: none; }
  body.show-detail .detail { display: block; min-height: 0; }
  .d-head .back { display: inline-flex; }
  .d-head .no { font-size: 22px; }
  .hdr { padding: 0 12px; gap: 10px; }
  .hdr .title { display: none; }
  .hdr .me { margin-left: 2px; }
  .roombar { flex-wrap: wrap; height: auto; padding: 4px 12px 8px; gap: 6px 8px; }
  .roombar .tools { flex-wrap: wrap; row-gap: 6px; }
  .roombar .tools > span:not(.search) { display: none; }   /* 「表示行」ラベルを省く（select は残す） */
  .roombar .tools .search input { width: 200px; }
  .roombar .tools select + .btn { margin-left: 0; }
  .roombar .tools select + .btn::before { display: none; }
  .tabs { height: 38px; }
  .tabs button { padding: 0 10px; }
  .row { padding: 12px 14px 12px 22px; }
  .qsec { padding: 12px 14px 14px; }
  .page { padding: 16px 12px 56px; }
  .panel { padding: 16px 16px 18px; }
  .card { padding: 28px 22px 22px; }
  .modal-bg { padding: 24px 10px; }
  .modal { padding: 18px 16px; }
}
@media (max-width: 560px) {
  /* phones: keep the brand bar on one line — drop the display-name chip and the "ScienceX " word (the gold "プロジェクトルーム" stays) */
  .hdr .me { display: none; }
  .hdr .brand > span { font-size: 0; }
  .hdr .brand span.pj { font-size: var(--t-14); }
  .hdr nav a, .hdr nav button { padding: 0 7px; font-size: var(--t-12); }
  .roombar .tools .search { flex: 1 1 160px; }
  .roombar .tools .search input { width: 100%; }
  .roombar .tools > select { display: none; }   /* 電話では行数の切替を省き、検索に幅を渡す（既定の2行のまま） */
  .files .f { flex-wrap: wrap; }
  .files .f a { flex-basis: 100%; }
  .files .f .meta { flex: 1; }
}
@media (max-width: 360px) {
  .hdr { padding: 0 10px; gap: 8px; }
  .roombar { padding: 4px 10px; }
  .tabs button { padding: 0 8px; }
}

/* 絵文字アイコン（📎📄）は小さく・薄く。将来 SVG に置換 */
.ico { display: inline-block; font-size: 12px; line-height: 1; filter: grayscale(1); opacity: .55; margin-right: 2px; vertical-align: -1px; }


/* 無効になった行は opacity で薄くせず、文字色で落とす（薄すぎて読めなくなるため・2026-09-06） */
table.tbl tr[style*="opacity"] { opacity: 1 !important; color: var(--ink-3); }
table.tbl tr[style*="opacity"] td, table.tbl tr[style*="opacity"] td b { color: var(--ink-3); }
/* 添付ビューアの見出しは狭い画面でも読めるように */
@media (max-width: 560px) {
  .viewer .vhead { flex-wrap: wrap; }
  .viewer .vtitle { flex: 1 1 100%; white-space: normal; word-break: break-all; font-size: var(--t-12); }
}
