/* 共通スタイル。スマホ優先。インラインの style は書かない（CSP） */
:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #1f6feb; --accent-text: #fff; --danger: #c62828; --ok: #2e7d32; --warn: #b26a00;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12151b; --panel: #1b1f27; --text: #e7eaf0; --muted: #9aa3b2; --line: #2b313c; --accent: #4c8dff; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif; }
a { color: var(--accent); }
header.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; }
header.top h1 { font-size: 17px; margin: 0; }
header.top .who { color: var(--muted); font-size: 13px; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
input, select, textarea { width: 100%; padding: 10px 12px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
textarea { min-height: 90px; }
button { padding: 10px 14px; font: inherit; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button.small { padding: 4px 10px; font-size: 13px; }
.msg { padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-size: 14px; }
.msg.error { background: #fdecea; color: var(--danger); }
.msg.ok { background: #e8f5e9; color: var(--ok); }
.msg.warn { background: #fff4e5; color: var(--warn); }
.msg:empty { display: none; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--bg); border: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.hidden { display: none !important; }
.login { max-width: 380px; margin: 10vh auto; }
.scroll { overflow-x: auto; }
pre.secret { background: var(--bg); padding: 12px; border-radius: 8px; user-select: all; }
.list-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 600; }
input.inline { width: auto; margin-right: 6px; }

/* プロジェクトルーム（顧客）と社内のプロジェクト画面 */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; padding: 4px 2px 12px; }
.bubble { max-width: 88%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); white-space: normal; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.bubble.me .who-line { color: inherit; opacity: .85; }
.who-line { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.say textarea { min-height: 70px; }
.thread { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line); }
.list-item p { margin: 6px 0; }
.lane { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.lane > div { min-width: 0; }
.next li { margin: 4px 0; }
.lv { display: inline-block; min-width: 3.2em; text-align: center; padding: 1px 6px; border-radius: 6px; font-size: 12px; margin-right: 6px; border: 1px solid var(--line); }
.lv-遅れ { background: #fdecea; color: var(--danger); border-color: #f5c2c0; }
.lv-今日 { background: #fff4e5; color: var(--warn); border-color: #f3d19e; }
.lv-今週 { background: var(--bg); }
.lv-待ち { background: var(--bg); color: var(--muted); }
.ai-badge { font-size: 11px; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; padding: 0 5px; margin-left: 4px; }
.req-edit textarea { min-height: 54px; }
.grid2 { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
pre.wrap { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 8px; overflow-wrap: anywhere; }
textarea.tall { min-height: 220px; }
.inline-label { display: inline-flex; align-items: center; margin: 0; }
.card .t { font-weight: 600; }
details summary { cursor: pointer; color: var(--accent); font-size: 13px; margin: 6px 0; }
h3 { font-size: 14px; margin: 0 0 8px; }
.tag:empty { display: none; }
