/* ==========================================================================
   ktarts_app 共通スタイル
   レスポンシブ前提。幅375px（iPhone基準）で横スクロールなしに操作できること。
   タップ対象は最小44px。表は横スクロール枠に入れる。
   ========================================================================== */

:root{
  --bg:#f4f6f8; --panel:#fff; --ink:#1c2733; --sub:#5b6b7c; --line:#dbe2ea;
  --accent:#1f6feb; --accent-d:#1656bb; --ok:#127a3d; --ok-bg:#e6f4ec;
  --warn:#9a6400; --warn-bg:#fff5e0; --bad:#b3261e; --bad-bg:#fdecea;
  --gray:#8b98a5; --gray-bg:#eef1f4;
  --radius:10px; --tap:44px;
  --shadow:0 1px 2px rgba(16,32,48,.06), 0 2px 8px rgba(16,32,48,.05);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font:15px/1.65 "Segoe UI","Yu Gothic UI","Hiragino Kaku Gothic ProN",Meiryo,sans-serif;
  -webkit-text-size-adjust:100%;
  overflow-x:hidden;
}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3{line-height:1.35; margin:0 0 .5em}
h1{font-size:20px}
h2{font-size:17px; margin-top:0}
h3{font-size:15px}
p{margin:.4em 0}

/* ---------- ヘッダー・ナビ ---------- */
.hd{
  position:sticky; top:0; z-index:50;
  background:#16283c; color:#fff; box-shadow:var(--shadow);
}
/* ★ ヘッダーは、どの幅でも「1本の帯」に収める。
   折り返させない・帯からはみ出させない、を CSS 側でも担保する。
   （並べる数の調整は app.js の fitNav が実測でやるが、
     JS が動く前の一瞬や、想定外に長い氏名でも崩れないようにしておく） */
.hd-top{
  display:flex; align-items:center; gap:10px; flex-wrap:nowrap;
  padding:8px 12px; min-height:var(--tap); min-width:0;
}
.hd-title{font-weight:700; font-size:15px; min-width:0; flex:0 1 auto}
.hd-title a{color:#fff; display:flex; align-items:center; gap:8px; min-width:0}
.hd-title a:hover{text-decoration:none}
.hd-title span{white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

/* ---------- 文字ロゴ（2026-09-05。画像ロゴから置き換え） ----------
   ★ 欧文は Marcellus 系のセリフ。ネットショップの実装指示書 v2 A-1 が
     「欧文（ロゴ・見出し・価格）：Marcellus」と定めているので、それに寄せる。
   ★ ただし外部フォントは読み込まない。このアプリは本文も system の書体だけで
     組んでおり、先方のブラウザから第三者へ通信を増やしたくない
     （遮断された環境では、読み込めずに別書体へ化ける）。
     そこで Marcellus を先頭に置き、入っていなければ
     Palatino（Windows・macOS/iOS の両方に標準で入る人文主義的オールドスタイル）へ落とす。
     Marcellus に最も近い雰囲気で、どちらのOSでも同じ系統になる。
   ★ 和文の「進行管理」はゴシックのまま（実装指示書 A-1 も和文はゴシック指定）。
     BIZ UDGothic を先頭に置く——Windows 標準で、小さい字でも読み分けやすい。 */
.hd-logo{
  flex:none; display:flex; flex-direction:column; justify-content:center;
  line-height:1.06; min-width:0;
}
.hd-logo .lg-en{
  font-family:Marcellus,"Palatino Linotype",Palatino,"Hiragino Mincho ProN",
              Georgia,"Times New Roman",serif;
  font-weight:400; font-size:17px; letter-spacing:.12em; white-space:nowrap;
}
.hd-logo .lg-ja{
  font-family:"BIZ UDGothic","Yu Gothic UI","Hiragino Sans",Meiryo,sans-serif;
  font-weight:400; font-size:10px; letter-spacing:.22em; color:#a9c0d8;
  white-space:nowrap;
}
/* 狭い画面では文字ロゴを一回り小さくする。
   ★ 画像ロゴのときは「幅375では題名を隠してロゴだけ」にしていたが、
     文字ロゴでは題名そのものがロゴなので、隠さずに縮める。
     何のアプリかが読めなくなるほうが困る。 */
@media (max-width:479px){
  .hd-logo .lg-en{font-size:15px; letter-spacing:.08em}
  .hd-logo .lg-ja{font-size:9px; letter-spacing:.16em}
}
/* 右側（通知バッジ・氏名・所属・ログアウト）。
   ★ 縮められるようにしておく。縮まないと、氏名が長い人の画面で
     帯の外へせり出し、本文の上に重なる。 */
.hd-me{
  margin-left:auto; display:flex; align-items:center; gap:8px;
  font-size:12.5px; white-space:nowrap; min-width:0; flex:0 1 auto; overflow:hidden;
}
.hd-me .nm{font-weight:600; min-width:0; overflow:hidden; text-overflow:ellipsis}
.hd-me .ttl{color:#a9c0d8; min-width:0; overflow:hidden; text-overflow:ellipsis}
.hd-me .pb, .hd-me .hd-out, .hd-me .badge{flex:none}
/* 中間の幅では所属を落とす。氏名とログアウトの方が要る */
@media (max-width:820px){ .hd-me .ttl{display:none} }
.pb{
  display:inline-flex; align-items:center; border-radius:12px; padding:3px 8px;
  font-size:11.5px; font-weight:700; white-space:nowrap; min-height:24px;
}
.pb:hover{text-decoration:none; filter:brightness(1.1)}
/* バッジは <a> のことも <button> のこともある（押すと再購読する状態）。
   どちらでも同じ見た目にする */
button.pb{border:0; font:inherit; cursor:pointer}
.pb.on{background:#1d6b45; color:#c9f0da}
.pb.off{background:rgba(255,255,255,.14); color:#c9d8e6}
.pb.ng{background:#6b4a00; color:#ffe6a8}
.hd-out{
  background:rgba(255,255,255,.14); color:#fff; border:0; border-radius:6px;
  padding:7px 10px; font-size:12.5px; cursor:pointer; min-height:34px;
}
.hd-out:hover{background:rgba(255,255,255,.24)}
/* ★ ナビと「…」は、横並びの2つの箱にする（2026-09-05）。
   「…」を .nav（横スクロールする箱）の中に入れて position:sticky で
   右端へ貼り付けていたのをやめた。貼り付けが効かない状況になると
   「…」が帯の外へ落ちて本文に重なるため。
   いまは **JS が1行も動かなくても**「…」は帯の中の右端から動かない。 */
.navwrap{display:flex; align-items:center; gap:0; padding:0 6px 6px; min-width:0}
.nav{
  flex:1 1 auto; min-width:0;
  display:flex; flex-wrap:nowrap; gap:2px; overflow-x:auto; padding:0;
  scrollbar-width:thin; -webkit-overflow-scrolling:touch;
}
.nav a{
  color:#c9d8e6; padding:9px 11px; border-radius:7px; white-space:nowrap;
  font-size:13.5px; min-height:38px; display:flex; align-items:center;
}
.nav a:hover{background:rgba(255,255,255,.10); text-decoration:none; color:#fff}
.nav a.on{background:#2f5f8f; color:#fff; font-weight:600}

/* ---------- レイアウト ---------- */
/* width:100% を明示しないと、チャット画面（body が flex）で中身の最小幅に
   引っ張られて版面が広がることがある */
.wrap{width:100%; max-width:1280px; margin:0 auto; padding:14px 12px 60px}
.card{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:14px; margin:0 0 14px; box-shadow:var(--shadow);
}
.card>h2:first-child,.card>h1:first-child{margin-top:0}
.row{display:flex; flex-wrap:wrap; gap:10px}
.row>*{min-width:0}
.grid2{display:grid; grid-template-columns:1fr; gap:14px}
@media(min-width:820px){ .grid2{grid-template-columns:1fr 1fr} }
.spread{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap}
.muted{color:var(--sub); font-size:13px}
.small{font-size:12.5px}
.right{text-align:right}
.nowrap{white-space:nowrap}
.pre{white-space:pre-wrap; word-break:break-word}
.hide{display:none !important}

/* ---------- ボタン ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-height:var(--tap); padding:10px 15px; border-radius:8px;
  border:1px solid var(--line); background:#fff; color:var(--ink);
  font-size:14px; font-family:inherit; cursor:pointer; text-decoration:none;
}
.btn:hover{background:#f2f5f8; text-decoration:none}
.btn:active{transform:translateY(1px)}
.btn[disabled]{opacity:.5; cursor:not-allowed}
.btn.pri{background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600}
.btn.pri:hover{background:var(--accent-d)}
.btn.danger{background:#fff; border-color:#e3b4b0; color:var(--bad)}
.btn.danger:hover{background:var(--bad-bg)}
.btn.sm{min-height:34px; padding:6px 10px; font-size:13px; border-radius:7px}
.btn.wide{width:100%}

/* ---------- フォーム ---------- */
label{display:block; font-size:13px; color:var(--sub); margin:0 0 3px; font-weight:600}
input[type=text],input[type=date],input[type=email],input[type=number],input[type=search],
select,textarea{
  width:100%; padding:10px 11px; min-height:var(--tap);
  border:1px solid var(--line); border-radius:8px; background:#fff;
  font:inherit; font-size:15px; color:var(--ink);
}
textarea{min-height:96px; resize:vertical; line-height:1.6}
input:focus,select:focus,textarea:focus{
  outline:2px solid rgba(31,111,235,.35); outline-offset:-1px; border-color:var(--accent);
}
.field{margin:0 0 11px}
.fields{display:grid; grid-template-columns:1fr; gap:0 12px}
@media(min-width:640px){ .fields.c2{grid-template-columns:1fr 1fr} .fields.c3{grid-template-columns:1fr 1fr 1fr} }
.checks{display:flex; flex-wrap:wrap; gap:6px}
.checks label{
  display:flex; align-items:center; gap:6px; margin:0; font-weight:400; color:var(--ink);
  border:1px solid var(--line); border-radius:20px; padding:8px 12px; min-height:38px;
  background:#fff; cursor:pointer; font-size:13.5px;
}
.checks input{width:auto; min-height:auto; margin:0}
.checks label:has(input:checked){background:#e8f0fe; border-color:var(--accent); font-weight:600}
.filters{display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end}
.filters .field{margin:0; flex:1 1 150px; min-width:130px}
.filters .field.sm{flex:0 1 110px}

/* ---------- 表 ---------- */
.tablewrap{overflow-x:auto; -webkit-overflow-scrolling:touch; margin:0 -14px; padding:0 14px}
table{border-collapse:collapse; width:100%; font-size:13.5px}
th,td{border-bottom:1px solid var(--line); padding:9px 8px; text-align:left; vertical-align:top}
th{background:#f7f9fb; color:var(--sub); font-size:12.5px; font-weight:700; white-space:nowrap;
   position:sticky; top:0; z-index:1}
tbody tr:hover{background:#f8fbff}
tr.clickable{cursor:pointer}
td.num,th.num{text-align:right; white-space:nowrap}
.emptynote{padding:22px 8px; text-align:center; color:var(--sub)}

/* ---------- 視点切替の帯（借りているあいだ、全画面の上に出続ける） ---------- */
.viewbar{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:9px 14px; background:#fde7a9; color:#5c3d00;
  border-top:1px solid #e6c96f; font-size:13px; line-height:1.5;
}
.viewbar .ic{font-size:16px; flex:0 0 auto}
.viewbar .tx{flex:1 1 220px; min-width:0}
.viewbar .ro{
  background:#fff6dd; border:1px solid #e6c96f; border-radius:10px;
  padding:1px 8px; font-size:11.5px; font-weight:700; white-space:nowrap;
}
.viewbar .sub{display:block; font-size:12px; opacity:.85}
.viewbar .btn{flex:0 0 auto}

/* ---------- ?hddebug=1 のときだけ出る実測値 ---------- */
.hddebug{
  background:#3a2a00; color:#ffe6a8; font-size:11.5px; line-height:1.5;
  padding:6px 12px; border-top:1px solid #6b4a00; font-family:ui-monospace,monospace;
  word-break:break-all;
}

/* ---------- バッジ・状態 ---------- */
.badge{
  display:inline-block; padding:2px 8px; border-radius:11px; font-size:11.5px;
  font-weight:700; white-space:nowrap; line-height:1.7;
}
.b-未着手{background:var(--warn-bg); color:var(--warn)}
.b-対応中{background:#e6f0fd; color:var(--accent-d)}
.b-提出済み{background:#efe7fb; color:#6b3fb0}
.b-完了{background:var(--ok-bg); color:var(--ok)}
/* 保留＝いまは動かさないが、やめたわけでもない。取り下げ（灰）と混ぜない */
.b-保留{background:#e9edf2; color:#4a5b70; border:1px solid #ccd6e0}
/* フェーズの状態 */
.b-進行中{background:#e6f0fd; color:var(--accent-d)}
.b-未確定{background:var(--warn-bg); color:var(--warn)}
.b-確定済{background:var(--ok-bg); color:var(--ok)}
.b-取り下げ{background:var(--gray-bg); color:var(--sub)}
.b-有効{background:var(--ok-bg); color:var(--ok)}
.b-取消{background:var(--gray-bg); color:var(--sub)}
.b-over{background:var(--bad-bg); color:var(--bad)}
.b-soon{background:var(--warn-bg); color:var(--warn)}
.b-dev{background:#fde7a9; color:#7a5200}
tr.over,li.over{background:#fdf2f1}
.overtext{color:var(--bad); font-weight:700}
.struck{text-decoration:line-through; color:var(--sub)}
.lv{color:#c98a00; letter-spacing:-1px; white-space:nowrap}

/* ---------- 数字タイル ---------- */
.tiles{display:grid; grid-template-columns:repeat(2,1fr); gap:10px}
@media(min-width:700px){ .tiles{grid-template-columns:repeat(4,1fr)} }
.tile{
  display:block; background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  padding:12px; min-height:var(--tap); color:inherit;
}
.tile:hover{background:#f6f9ff; border-color:#bcd3f5; text-decoration:none}
.tile .k{font-size:12.5px; color:var(--sub); font-weight:600}
.tile .v{font-size:26px; font-weight:700; line-height:1.25}
.tile .u{font-size:12.5px; color:var(--sub); font-weight:400}
.tile.bad .v{color:var(--bad)}
.tile.warn .v{color:var(--warn)}

/* 進捗の帯グラフ */
.bar{display:flex; height:16px; border-radius:8px; overflow:hidden; background:var(--gray-bg); margin:8px 0 6px}
.bar i{display:block; height:100%}
.bar .s-完了{background:#2f9e5e}
.bar .s-進行中{background:#4a8fe0}
.bar .s-未着手{background:#e8b23a}
.legend{display:flex; flex-wrap:wrap; gap:4px}
.legend a{
  display:inline-flex; align-items:center; gap:5px; font-size:12.5px; color:var(--ink);
  border:1px solid var(--line); border-radius:16px; padding:5px 10px; min-height:32px; background:#fff;
}
.legend a:hover{background:#f2f5f8; text-decoration:none}
.legend i{width:9px; height:9px; border-radius:50%; display:inline-block}

/* ---------- チャット ---------- */
.chatpage{display:flex; flex-direction:column; height:100dvh}
.chatpage .wrap{flex:1; display:flex; flex-direction:column; min-height:0; min-width:0;
  padding-bottom:0}
.chatpage .wrap > *{min-width:0; max-width:100%}
/* チャット上部の導線。狭い画面では折り返して、版面を押し広げないようにする */
.linkline{display:flex; gap:8px; align-items:center; flex-wrap:wrap;
  justify-content:space-between; padding:4px 0; max-width:100%; min-width:0}
.linkline .btn{white-space:normal; text-align:left; max-width:100%; min-width:0}
.linkline > *{min-width:0; max-width:100%}
#feed{
  flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
  background:#eef2f6; border:1px solid var(--line); border-radius:var(--radius);
  padding:12px; min-height:0;
}
.daysep{text-align:center; margin:14px 0 10px}
.daysep span{background:#dde5ed; color:var(--sub); font-size:12px; padding:3px 12px; border-radius:12px}
.msg{display:flex; margin:0 0 10px; gap:8px; min-width:0; max-width:100%}
.msg .bub{
  max-width:min(78%,560px); background:#fff; border-radius:12px; padding:8px 11px;
  box-shadow:0 1px 1px rgba(16,32,48,.08);
  /* flex アイテムの最小幅は既定で min-content になる。折り返さないバッジが
     入ると版面を押し広げてしまうので、明示的に 0 にして縮められるようにする */
  min-width:0;
}
.msg .who{font-size:12px; color:var(--sub); margin:0 0 2px; font-weight:600}
.msg .who .ttl{font-weight:400; color:#8b98a5}
.msg .tx{white-space:pre-wrap; word-break:break-word}
.msg .mt{font-size:11px; color:var(--gray); margin-top:3px}
.msg.mine{flex-direction:row-reverse}
.msg.mine .bub{background:#dcefff}
.msg.mine .mt{text-align:right}
.msg .bub{overflow:hidden}          /* 長いバッジが吹き出しからはみ出さないように */
.msg .tags{margin-top:4px; display:flex; gap:4px; flex-wrap:wrap; align-items:center;
  max-width:100%; min-width:0}
.msg .tags a{font-size:11.5px; background:var(--gray-bg); border-radius:10px; padding:1px 8px; color:var(--sub)}
.msg .tags a.dbadge{
  background:#e6f0fd; color:var(--accent-d); font-weight:700;
  min-height:32px; display:inline-flex; align-items:center; padding:2px 10px; border-radius:11px;
  max-width:100%; min-width:0; flex:0 1 auto;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.msg .tags a.dbadge:hover{background:#d6e6fc; text-decoration:none}
.msg .tags .rtag{font-size:11.5px; background:var(--gray-bg); border-radius:10px;
  padding:1px 8px; color:var(--sub)}
.msg .atts{margin-top:6px; display:flex; flex-wrap:wrap; gap:6px}
.msg .atts img{max-width:150px; max-height:150px; border-radius:8px; display:block; border:1px solid var(--line)}
.msg .atts .fl{font-size:12.5px; background:var(--gray-bg); border-radius:7px; padding:6px 9px; display:inline-block}
.msg .pin{font-size:11px; color:var(--warn); font-weight:700}
.composer{
  border-top:1px solid var(--line); background:var(--panel); padding:9px 0 12px;
  position:sticky; bottom:0;
}
.composer textarea{min-height:46px; max-height:130px}
.composer .line{display:flex; gap:7px; align-items:flex-end; margin-top:7px; flex-wrap:wrap}

/* ---------- タスクへのリンク ---------- */
/* No＋内容のブロック。押せる範囲を広くとる */
.dref{
  display:flex; align-items:flex-start; gap:9px; min-height:var(--tap);
  padding:7px 9px; margin:-7px -9px; border-radius:9px;
  color:inherit; text-decoration:none;
}
.dref:hover{background:#eef4ff; text-decoration:none}
.dref:focus-visible{outline:2px solid var(--accent); outline-offset:-2px}
.dref .no{
  flex:0 0 auto; font-weight:700; color:var(--accent-d); font-size:13px;
  background:#e6f0fd; border-radius:11px; padding:2px 9px; white-space:nowrap; line-height:1.7;
}
.dref .bd{flex:1 1 auto; min-width:0; font-size:13.5px; line-height:1.5}
.dref:hover .bd{text-decoration:underline}
.dref .sub{display:block; font-size:12px; color:var(--sub); margin-top:2px;
  text-decoration:none}
.dref:hover .sub{text-decoration:none}

/* 小さいバッジ型（本文の中に置く用）。押せる高さは確保する */
.dref-in{
  display:inline-flex; align-items:center; min-height:32px; padding:2px 10px;
  background:#e6f0fd; color:var(--accent-d); border-radius:11px;
  font-size:12.5px; font-weight:700; white-space:nowrap;
}
.dref-in:hover{background:#d6e6fc; text-decoration:none}

/* 行全体をタップで移動できる表 */
tr.rowlink{cursor:pointer}
tr.rowlink:hover{background:#eef4ff}
tr.rowlink:focus-visible{outline:2px solid var(--accent); outline-offset:-2px}
tr.rowlink td{min-height:var(--tap)}
.rowhint{font-size:11.5px; color:var(--gray); white-space:nowrap}
tr.rowlink:hover .rowhint{color:var(--accent)}

/* ---------- リアクション ---------- */
.rx{display:flex; gap:5px; margin-top:5px; flex-wrap:wrap}
.rxb{
  display:inline-flex; align-items:center; gap:4px; min-height:30px; padding:2px 9px;
  border:1px solid var(--line); border-radius:15px; background:#fff; cursor:pointer;
  font-size:14px; line-height:1.4; font-family:inherit;
}
.rxb:hover{background:#f2f5f8}
.rxb b{font-size:12px; font-weight:700; color:var(--sub)}
.rxb.on{background:#e8f0fe; border-color:var(--accent)}
.rxb.on b{color:var(--accent-d)}

/* ---------- チャットの返信（引用） ---------- */
.quote{
  display:block; border-left:3px solid var(--accent); background:rgba(31,111,235,.07);
  border-radius:0 7px 7px 0; padding:4px 9px; margin:0 0 5px; font-size:12px;
  color:var(--sub); text-decoration:none; max-width:100%; overflow:hidden;
}
.quote:hover{background:rgba(31,111,235,.13); text-decoration:none}
.quote b{color:var(--accent-d); font-weight:700}
.msg.flash .bub{animation:flash 1.4s ease-out}
@keyframes flash{
  0%{box-shadow:0 0 0 3px rgba(31,111,235,.55)}
  100%{box-shadow:0 0 0 3px rgba(31,111,235,0)}
}
#replyBar{
  display:flex; align-items:center; gap:8px; background:#eef3fb; border:1px solid #c7dafa;
  border-left:4px solid var(--accent); border-radius:0 8px 8px 0; padding:7px 10px;
  margin:0 0 7px; font-size:12.5px; color:var(--sub);
}
#replyBar .t{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
#replyBar b{color:var(--accent-d)}
#replyBar button{
  border:0; background:rgba(0,0,0,.08); border-radius:6px; min-height:30px; padding:4px 10px;
  cursor:pointer; font-family:inherit; font-size:12.5px;
}
#replyBar button:hover{background:rgba(0,0,0,.15)}

/* ---------- タスクの経過履歴（タイムライン） ---------- */
.tl{position:relative; margin:6px 0 0; padding-left:26px}
.tl::before{content:''; position:absolute; left:8px; top:6px; bottom:6px; width:2px;
  background:var(--line)}
.tli{position:relative; margin:0 0 14px}
.tli::before{content:''; position:absolute; left:-22px; top:7px; width:11px; height:11px;
  border-radius:50%; background:#fff; border:2px solid var(--gray)}
.tli.c-comment::before{border-color:var(--accent); background:var(--accent)}
.tli.c-post::before{border-color:#2f9e5e; background:#2f9e5e}
.tli.c-photo::before{border-color:#c98a00; background:#c98a00}
.tli .when{font-size:12px; color:var(--gray)}
.tli .who{font-size:13px; font-weight:700; color:var(--ink)}
.tli .who .ttl{font-weight:400; color:var(--sub); font-size:12px}
.tli .bd{background:#fff; border:1px solid var(--line); border-radius:9px; padding:9px 11px;
  margin-top:4px; white-space:pre-wrap; word-break:break-word}
.tli.c-log .bd{background:var(--gray-bg); border-color:#e3e8ed; color:var(--sub);
  font-size:12.5px; padding:6px 10px}
.tli.c-post .bd{background:#f4fbf6; border-color:#cdeadb}
.tli .src{font-size:11.5px; color:var(--sub); margin-bottom:3px}
.tli .src a{font-weight:700}
.commentbox{background:#f7f9fb; border:1px solid var(--line); border-radius:10px;
  padding:12px; margin-top:12px}

/* ---------- 写真 ---------- */
.gal{display:grid; grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:9px}
.gal .it{
  border:1px solid var(--line); border-radius:9px; overflow:hidden; background:#fff;
  display:flex; flex-direction:column;
}
.gal .it .ph{
  display:block; width:100%; aspect-ratio:1/1; object-fit:cover; background:var(--gray-bg);
}
.gal .it .noimg{
  display:flex; align-items:center; justify-content:center; text-align:center;
  font-size:11.5px; color:var(--sub); padding:6px; aspect-ratio:1/1; background:var(--gray-bg);
}
.gal .it .cap{padding:5px 7px; font-size:11.5px; color:var(--sub); line-height:1.45}
.gal .it .cap b{color:var(--ink); font-weight:600; display:block; font-size:12px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.thumbrow{display:flex; gap:6px; flex-wrap:wrap}
.thumbrow a{display:block}
.thumbrow img{width:78px; height:78px; object-fit:cover; border-radius:7px; border:1px solid var(--line)}
.thumbrow .noimg{
  width:78px; height:78px; border-radius:7px; border:1px solid var(--line); background:var(--gray-bg);
  display:flex; align-items:center; justify-content:center; font-size:10.5px; color:var(--sub);
  text-align:center; padding:4px;
}

/* ---------- モーダル ---------- */
.modal{
  position:fixed; inset:0; background:rgba(14,24,35,.5); z-index:100;
  display:flex; align-items:flex-end; justify-content:center; padding:0;
}
@media(min-width:640px){ .modal{align-items:center; padding:20px} }
.modal .box{
  background:#fff; border-radius:14px 14px 0 0; width:100%; max-width:620px;
  max-height:92dvh; overflow-y:auto; padding:16px; box-shadow:0 8px 40px rgba(0,0,0,.3);
}
@media(min-width:640px){ .modal .box{border-radius:14px} }
.modal .box h2{margin-top:0}
.modal .acts{display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; margin-top:14px}
.modal .acts .btn{flex:1 1 auto}
@media(min-width:640px){ .modal .acts .btn{flex:0 0 auto} }

/* ---------- 通知・エラー ---------- */
/* トーストは画面下端に重なるため、出ている間もその裏のボタンを押せるようにする。
   タップを受けるのは「×」だけ（rev29）。本文は pointer-events:none で背面へ透過。 */
#toasts{position:fixed; left:0; right:0; bottom:0; z-index:200; padding:10px; pointer-events:none}
.toast{
  max-width:620px; margin:0 auto 8px; padding:11px 44px 11px 14px; border-radius:9px;
  font-size:14px; box-shadow:0 4px 20px rgba(0,0,0,.2); word-break:break-word;
  pointer-events:none; position:relative;
}
/* 「×」だけが反応する。指で押しやすい大きさ（44px）を確保する */
.toast .tx{
  position:absolute; top:0; right:0; width:44px; height:100%; min-height:44px;
  display:flex; align-items:center; justify-content:center;
  border:none; background:none; color:inherit; opacity:.65;
  font:inherit; font-size:19px; line-height:1; cursor:pointer;
  pointer-events:auto; border-radius:0 9px 9px 0;
}
.toast .tx:hover{opacity:1; background:rgba(0,0,0,.06)}
.toast.err{background:#fdecea; color:#8a1c15; border:1px solid #f0b7b2}
.toast.ok{background:#e6f4ec; color:#0f5c30; border:1px solid #a8d8bd}
.toast.info{background:#e8f0fe; color:#1a4a9c; border:1px solid #b7cdf3}
#updbar{
  position:fixed; left:0; right:0; top:0; z-index:300; background:#7a5200; color:#fff;
  padding:11px 14px; font-size:14px; text-align:center;
}
#updbar button{margin-left:10px; min-height:32px; padding:5px 12px; border-radius:6px;
  border:0; background:#fff; color:#7a5200; font-weight:700; cursor:pointer}
.devbar{background:#fff4d2; border:1px solid #e8cf8a; color:#6b4a00; border-radius:9px;
  padding:9px 12px; font-size:13px; margin:0 0 12px}
.errbox{background:var(--bad-bg); border:1px solid #f0b7b2; color:#8a1c15;
  border-radius:9px; padding:11px 13px; margin:0 0 12px; font-size:14px}
.loading{padding:22px; text-align:center; color:var(--sub)}

/* ---------- 通知の案内（iPhone のホーム画面追加手順） ---------- */
.iossteps{display:grid; gap:10px; margin-top:10px}
.iostep{display:flex; gap:10px; align-items:flex-start; background:#f7f9fb;
  border:1px solid var(--line); border-radius:9px; padding:10px 12px}
.iostep .n{flex:0 0 26px; height:26px; border-radius:50%; background:var(--accent);
  color:#fff; font-weight:700; font-size:13px; display:flex; align-items:center;
  justify-content:center}
.iostep .fig{font-size:12.5px; color:var(--sub); margin-top:3px; display:flex;
  align-items:center; gap:6px; flex-wrap:wrap}
.iostep .ic{display:inline-flex; align-items:center; justify-content:center;
  width:26px; height:26px; border:1px solid var(--line); border-radius:6px; background:#fff}
.appicon{width:22px; height:22px; border-radius:5px; vertical-align:middle}

/* ---------- ログイン ---------- */
.loginwrap{max-width:420px; margin:0 auto; padding:34px 16px}
.loginwrap .card{padding:20px}
.step{display:none}
.step.on{display:block}

/* ---------- 印刷・細部 ---------- */
.linkrow{display:flex; flex-wrap:wrap; gap:6px}
.linkrow a{font-size:12.5px; background:var(--gray-bg); border-radius:7px; padding:5px 9px;
  color:var(--sub); min-height:32px; display:inline-flex; align-items:center}
.linkrow a:hover{background:#e2e7ec; text-decoration:none}
ul.plain{list-style:none; margin:0; padding:0}
ul.plain li{padding:9px 0; border-bottom:1px solid var(--line)}
ul.plain li:last-child{border-bottom:0}
.kv{display:grid; grid-template-columns:auto 1fr; gap:4px 12px; font-size:13.5px}
.kv dt{color:var(--sub); font-weight:600; white-space:nowrap}
.kv dd{margin:0}
hr{border:0; border-top:1px solid var(--line); margin:14px 0}
code{background:var(--gray-bg); padding:1px 5px; border-radius:4px; font-size:13px}

/* ---------- 概況（ゴール・今の焦点・フェーズ） ---------- */
.ov .lbl{
  display:inline-block; font-size:11.5px; font-weight:700; color:var(--sub);
  background:var(--gray-bg); border-radius:4px; padding:2px 7px; margin-right:8px;
}
.ov-goal{margin-top:12px}
.ov-goal .val{font-size:17px; font-weight:700}
.ov-focus{
  margin-top:10px; padding:10px 12px; border-radius:8px;
  background:#fffbef; border:1px solid #f0e0b6;
}
.ov-focus .val{font-weight:700}
.ov-focus .small{display:block; margin-top:4px}
.ov-phase{margin-top:14px}
.phases{list-style:none; margin:6px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:6px}
.phases .ph{
  display:inline-flex; align-items:center; gap:6px; font-size:12.5px;
  border:1px solid var(--line); border-radius:16px; padding:5px 11px; background:#fff;
}
.phases .dot{width:9px; height:9px; border-radius:50%; background:#d3dae1; flex:none}
.phases .st{font-size:11px; color:var(--sub)}
.phases .done .dot{background:#2f9e5e}
.phases .done .nm{color:var(--sub)}
.phases .now{border-color:#8bb6ec; background:#f2f7ff}
.phases .now .dot{background:#4a8fe0}
.phases .now .nm{font-weight:700}
@media (max-width:420px){
  .phases{flex-direction:column; align-items:stretch}
  .phases .ph{justify-content:space-between}
}

/* ==========================================================================
   タスク実行ページ（shinro_app の mission.html から移植）
   配色は ktarts の変数体系（--accent / --ok / --warn / --bad …）に読み替えてある。
   ========================================================================== */
.stbtn{font:inherit;font-size:13px;padding:5px 14px;border:1px solid var(--line);background:#fff;color:var(--sub);border-radius:16px;cursor:pointer;margin-right:6px}
.stbtn:hover:not(:disabled){border-color:var(--accent);color:var(--accent-d)}
.stbtn:disabled{opacity:.55;cursor:not-allowed}
.stbtn.on{border-color:transparent;font-weight:600}
.stbtn.on[data-s="未着手"]{background:var(--gray-bg);color:var(--gray)}
.stbtn.on[data-s="対応中"]{background:var(--warn-bg);color:var(--warn)}
.stbtn.on[data-s="提出済み"]{background:#efe7fb;color:#6b3fb0}
.stbtn.on[data-s="完了"]{background:var(--ok-bg);color:var(--ok)}
.stbtn.on[data-s="取り下げ"]{background:var(--gray-bg);color:var(--sub)}
.head{display:grid;grid-template-columns:110px 1fr;gap:8px 14px;align-items:center;font-size:13px}
.head .k{color:var(--sub);font-size:12px}
.steps{counter-reset:st;padding:0;margin:0;list-style:none}
.steps li{counter-increment:st;position:relative;padding:8px 0 8px 34px;border-bottom:1px dotted var(--line);font-size:13px}
.steps li:last-child{border-bottom:none}
.steps li::before{content:counter(st);position:absolute;left:0;top:7px;width:22px;height:22px;border-radius:50%;
  background:var(--accent);color:#fff;font-size:12px;font-weight:600;display:flex;align-items:center;justify-content:center}
.chk li{display:flex;align-items:flex-start;gap:9px;padding:8px 0;border-bottom:1px dotted var(--line);font-size:13px}
.chk li:last-child{border-bottom:none}
.chk input{width:17px;height:17px;margin:1px 0 0;flex:none}
.chk .who{font-size:11px;color:var(--sub);margin-left:auto;white-space:nowrap}
.chk li.done span.t{color:var(--sub);text-decoration:line-through}
/* 操作の結果は押したボタンのすぐ下に出す。ページ上部のflashだけだと、
   下のフォームを操作している人の視界に入らない。 */
.actmsg{margin-top:10px;padding:10px 14px;border-radius:10px;font-size:13px;font-weight:600;line-height:1.6}
.actmsg.ok{background:var(--ok-bg);color:var(--ok);border:1px solid #b6dfc6}
.actmsg.ng{background:#fdecec;color:var(--bad);border:1px solid #f0bcbc}
.actmsg .sub{display:block;font-weight:400;font-size:12px;margin-top:3px;opacity:.85}
.act{border:2px solid var(--accent);border-radius:12px;padding:18px 20px;margin-bottom:14px;background:var(--panel)}
.act h3{margin:0 0 10px;font-size:15px;color:var(--accent-d);display:flex;align-items:center;gap:8px}
.act h3 .ic{font-size:19px}
.act .btn{font-size:15px;padding:11px 22px}
.act input[type=file]{font:inherit;font-size:14px;padding:9px;border:2px dashed var(--accent);
  border-radius:10px;background:#f8fafc;cursor:pointer;max-width:100%}
.act .how{background:#fff8e6;border:1px solid #e7d493;border-radius:8px;padding:9px 12px;
  font-size:12px;color:#6b4a00;margin-bottom:10px}
.doguide{background:var(--ok-bg);border:1px solid #b9dcc6;border-radius:12px;padding:12px 16px;
  font-size:13px;color:var(--ok);font-weight:600;margin-bottom:12px}
.waitbar{background:var(--bad-bg);border:1px solid #f0bcc8;border-radius:12px;padding:12px 16px;
  font-size:13px;color:var(--bad);margin-bottom:14px}
.remand{background:var(--warn-bg);border:2px solid #e0c56a;border-radius:12px;padding:14px 18px;
  font-size:13px;color:#6b4a00;margin-bottom:14px}
/* 確認の画面であることの目印。見出しと一覧の動線で同じ緑を使う */
.vflag{display:inline-block;background:var(--ok);color:#fff;font-size:13px;font-weight:600;
  border-radius:8px;padding:2px 10px;margin-right:10px;vertical-align:middle}
/* 提出済みの元タスク側から、確認画面へ迷わず行けるようにする */
.waitverify{border:2px solid var(--ok);background:#f6fbf8;border-radius:12px;padding:14px 18px;
  margin-bottom:14px;font-size:13px;display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.waitverify .btn{white-space:nowrap}
.vbox{border:2px solid var(--ok);border-radius:12px;padding:18px 20px;margin-bottom:14px;background:#f6fbf8}
.vbox h3{margin:0 0 10px;font-size:15px;color:var(--ok)}
.vbox .sub{border:1px solid var(--line);background:#fff;border-radius:10px;padding:12px 14px;margin-bottom:12px}
.vbox textarea{width:100%;min-height:70px;font:inherit;font-size:13px;padding:8px 10px;
  border:1px solid var(--line);border-radius:8px}
.vbox .btn{font-size:15px;padding:11px 22px}
.rel{font-size:12px;margin-top:4px}
.rel a{color:var(--accent);text-decoration:none;border-bottom:1px dotted var(--accent)}
/* 終わった相手は、まだ終わっていない相手より目立たせない */
.rel a.donelink{color:var(--sub);border-bottom-color:var(--line)}
.donefold{display:inline-block;vertical-align:top}
.donefold summary{cursor:pointer;color:var(--sub);font-size:11px;list-style:none}
.donefold summary::-webkit-details-marker{display:none}
.donefold summary::before{content:'▸ ';font-size:10px}
.donefold[open] summary::before{content:'▾ '}
.donefold summary:hover{color:var(--accent)}
.act textarea{width:100%;min-height:90px;font:inherit;font-size:13px;padding:8px 10px;border:1px solid var(--line);border-radius:8px}
.act .q{background:#f8fafc;border:1px solid var(--line);border-radius:8px;padding:8px 11px;font-size:12px;margin-bottom:8px}
.ans{border-left:3px solid var(--accent);padding:8px 0 8px 12px;margin-top:10px;font-size:13px}
/* タスクのやり取り（コメント）。
   経過履歴と並ぶので、ひと目で別物と分かるよう吹き出し寄りの見た目にしている。 */
.talkitem{border:1px solid var(--line);border-radius:10px;padding:10px 13px;margin-bottom:9px;
  background:#fff;font-size:13px}
.talkitem.mine{background:#f2f8ff;border-color:#cfe2f7}
.talkitem .hd{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;margin-bottom:5px;font-size:12px}
.talkitem .hd b{font-size:13px}
.talkitem .hd .org{color:#8b98a5;font-size:11.5px}
.talkitem .hd .when{color:var(--gray);font-size:11.5px}
.talkitem .hd .to{background:var(--accent);color:#fff;border-radius:10px;padding:1px 9px;font-size:11px}
.talkform{margin-top:14px;border-top:1px dashed var(--line);padding-top:14px}
.talkform textarea{width:100%;min-height:80px;font:inherit;font-size:13px;padding:8px 10px;
  border:1px solid var(--line);border-radius:8px}
.towrap{margin-top:9px}
.tolist{display:flex;flex-wrap:wrap;gap:6px;margin:5px 0}
.tochk{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;
  border:1px solid var(--line);border-radius:16px;padding:5px 12px;background:#fff;cursor:pointer}
.tochk:has(input:checked){border-color:var(--accent);background:#eaf3fd;color:var(--accent-d)}
.tochk input{width:15px;height:15px;margin:0}
.linkbtn{display:inline-block;margin:0 8px 8px 0;padding:8px 14px;border:1px solid var(--accent);border-radius:8px;
  color:var(--accent-d);text-decoration:none;font-size:13px;font-weight:600;background:#fff}
.linkbtn:hover{background:#f0f3f7}

/* ==========================================================================
   画像のサムネイルとライトボックス
   原本は変換しない。一覧に出すのはブラウザ側で作った縮小画像か、
   原本を CSS で縮めたもの（object-fit: cover）。
   ========================================================================== */
.thumb{
  display:inline-flex; align-items:center; justify-content:center;
  width:56px; height:56px; padding:0; flex:none;
  border:1px solid var(--line); border-radius:8px; background:#fff;
  overflow:hidden; cursor:zoom-in;
}
.thumb:hover{border-color:var(--accent)}
.thumb img{width:100%; height:100%; object-fit:cover; display:block}
.thumb.noimg{
  flex-direction:column; gap:1px; cursor:pointer;
  background:var(--gray-bg); color:var(--sub); border-style:dashed;
}
.thumb.noimg .ic{font-size:17px; line-height:1}
.thumb.noimg .tx{font-size:8.5px; line-height:1.15; text-align:center}

/* 一覧の「画像」列。行が縦に伸びすぎないようにする */
td.thumbcell{width:70px; padding-top:6px; padding-bottom:6px}

/* ---------- ライトボックス ---------- */
body.lb-open{overflow:hidden}          /* 背面がスクロールしないように */
.lightbox{
  position:fixed; inset:0; z-index:1000;
  background:rgba(12,18,26,.94);
  display:flex; flex-direction:column;
}
.lightbox .lb-bar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 12px; background:rgba(0,0,0,.35); color:#fff;
  /* iPhone のノッチ・ホームバーを避ける */
  padding-top:calc(10px + env(safe-area-inset-top));
  flex:none;
}
.lightbox .lb-name{
  font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  min-width:0;
}
.lightbox .lb-acts{display:flex; gap:8px; flex:none}
.lightbox .lb-body{
  flex:1; min-height:0; display:flex; align-items:center; justify-content:center;
  padding:10px; padding-bottom:calc(10px + env(safe-area-inset-bottom));
  overflow:auto;
}
.lightbox .lb-body img{
  max-width:100%; max-height:100%; object-fit:contain;
  border-radius:6px; background:#fff;
}
/* ★ 原寸で開く（data-full="1" を付けた画像）。
   デザイン案は縦が数千pxあり、画面に収めると文字が読めないため、
   縮めずに出して枠の中を送ってもらう（lb-body は overflow:auto） */
.lightbox.full .lb-body{align-items:flex-start; justify-content:flex-start}
.lightbox.full .lb-body img{
  max-width:none; max-height:none; width:auto; height:auto;
  object-fit:none; margin:auto;
}
.lightbox .lb-noimg{
  color:#e8eef4; font-size:14px; line-height:1.9; text-align:center;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.18);
  border-radius:10px; padding:22px 20px; max-width:min(520px, 92vw);
}
@media (max-width:420px){
  .thumb{width:48px; height:48px}
  td.thumbcell{width:60px}
  .lightbox .lb-name{font-size:12px}
}

/* 見た目はリンク、実体はボタン（画面遷移させたくないもの） */
.linklike{
  border:0; background:none; padding:0; font:inherit; color:var(--accent);
  cursor:pointer; text-align:left;
}
.linklike:hover{text-decoration:underline}

/* チャットの添付画像。見た目は従来どおりで、押すとライトボックスが開く */
.atts .imgbtn{
  border:0; padding:0; background:none; cursor:zoom-in; display:inline-block; line-height:0;
}
.atts .imgbtn img{border-radius:8px; max-width:180px; max-height:180px; object-fit:cover}
.atts button.fl{
  border:1px solid var(--line); background:#fff; font:inherit; font-size:12.5px;
  cursor:pointer; text-align:left;
}


/* ==========================================================================
   B37 スマホ幅での一覧のカード化
   --------------------------------------------------------------------------
   列が4つ以上ある一覧（.tablewrap.cards は app.js が付ける）を、
   狭い画面では「1行＝1枚のカード」に組み替える。
   見出しは <td data-label> から出す。画面ごとの CSS は要らない。
   ========================================================================== */
@media (max-width:640px){
  /* カードにするので、横スクロールは要らなくなる */
  .tablewrap.cards{overflow-x:visible; margin:0; padding:0}
  .tablewrap.cards table{width:100%}

  /* 見出し行は目には見せないが、読み上げには残す */
  .tablewrap.cards thead{
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
  }

  .tablewrap.cards tbody tr{
    display:block; background:#fff; border:1px solid var(--line);
    border-radius:10px; padding:10px 12px; margin:0 0 10px;
  }
  .tablewrap.cards tbody tr:hover{background:#fff}
  /* 期限超過の行は、カードでも色で分かるようにする */
  .tablewrap.cards tbody tr.over{background:#fdf2f1; border-color:#f0c9c4}

  .tablewrap.cards tbody td{
    display:flex; align-items:flex-start; gap:10px;
    border:0; padding:3px 0; white-space:normal; text-align:left;
  }
  /* 見出しのある列だけ、左に見出しを出す */
  .tablewrap.cards tbody td[data-label]::before{
    content:attr(data-label);
    flex:0 0 5.5em; color:var(--sub); font-size:12px; line-height:1.75;
  }
  /* 中身が空の欄はカードに出さない（空行が並ぶと読みにくい） */
  .tablewrap.cards tbody td:empty{display:none}
  /* 表では右寄せ・折り返し無しにしていた欄も、カードでは左から普通に流す */
  .tablewrap.cards tbody td.num{text-align:left}
  .tablewrap.cards tbody td.nowrap,
  .tablewrap.cards tbody td.num{white-space:normal}
  /* 操作ボタンの欄は見出しが無いので、少し間を空けて下に置く */
  .tablewrap.cards tbody td:not([data-label]){padding-top:6px}
  /* サムネイルの欄は幅指定を外す */
  .tablewrap.cards tbody td.thumbcell{width:auto}

  /* ------------------------------------------------------------------
     資料の一覧だけ、カードの組み方を変える（.filecards）

     ★ なぜ揃えないか。
       ふつうのカードは「見出し（5.5em）｜中身」を縦に積む。列の中身が
       短い一覧ではそれで読める。ところが資料は**題名が長く、しかも
       いちばん見たいもの**なので、5.5em を見出しに取られると
       題名が3〜4文字ずつ折り返って読めなくなる（幅375px）。
       そこで題名だけは見出しを外して全幅に置き、
       分類・版・登録者・日付は小さく横に並べて2行目へ畳む。
     ------------------------------------------------------------------ */
  /* サムネイルは題名の左に回り込ませる。行の終わりで回り込みを解く */
  .tablewrap.cards.filecards tbody tr{overflow:hidden}
  .tablewrap.cards.filecards tbody td.thumbcell{
    float:left; width:auto; margin:2px 10px 4px 0; padding:0;
  }
  /* 題名は見出しを付けず、カードの見出しとして全幅で太く出す */
  .tablewrap.cards.filecards tbody td.ttlcell{
    display:block; padding:0 0 6px; font-size:14.5px; font-weight:700; line-height:1.45;
  }
  .tablewrap.cards.filecards tbody td.ttlcell::before{content:none}
  .tablewrap.cards.filecards tbody td.ttlcell .small{font-weight:400}
  /* 分類・版・登録者・日付は、小さく横に並べて2行目に畳む */
  .tablewrap.cards.filecards tbody td.metacell{
    display:inline-flex; align-items:baseline; gap:4px; width:auto;
    padding:2px 12px 2px 0; white-space:nowrap;
  }
  .tablewrap.cards.filecards tbody td.metacell::before{
    flex:0 0 auto; font-size:11px; line-height:1.6;
  }
  .tablewrap.cards.filecards tbody td.metacell .small{white-space:nowrap}
  /* 操作ボタンは、回り込みを解いてから下に置く */
  .tablewrap.cards.filecards tbody td:last-child{clear:both; padding-top:8px}
}


/* ==========================================================================
   HP制作（たたき台の閲覧）
   --------------------------------------------------------------------------
   画像は資料庫の分類「デザイン案」をそのまま映す。この画面に案を埋め込まない
   （差し替えは資料庫側で完結させる）。
   ========================================================================== */
/* ---------- 案タブ ---------- */
.hptabs{
  display:flex; flex-wrap:wrap; gap:6px;
  margin:0 0 10px; padding:0 0 10px; border-bottom:1px solid var(--line);
}
.hptab{
  display:inline-flex; align-items:center; gap:6px;
  min-height:var(--tap); padding:8px 12px; border-radius:8px;
  border:1px solid var(--line); background:#fff; color:var(--ink);
  font:600 14px/1.4 inherit; font-family:inherit; cursor:pointer;
}
.hptab:hover{background:#f2f5f8}
.hptab.on{background:var(--accent); border-color:var(--accent); color:#fff}
.hpbadge{
  display:inline-block; padding:2px 7px; border-radius:999px;
  background:var(--ok-bg); color:var(--ok); font-size:11px; font-weight:700;
  white-space:nowrap;
}
.hptab.on .hpbadge{background:rgba(255,255,255,.92); color:var(--accent-d)}

/* ---------- 端末タブ（スマホ／PC） ---------- */
.hpdev{
  display:inline-flex; gap:0; margin:0 0 14px;
  border:1px solid var(--line); border-radius:9px; overflow:hidden; background:#fff;
}
.hpseg{
  min-height:var(--tap); padding:8px 20px; border:0; background:#fff;
  color:var(--ink); font:600 14px/1.4 inherit; font-family:inherit; cursor:pointer;
}
.hpseg + .hpseg{border-left:1px solid var(--line)}
.hpseg:hover{background:#f2f5f8}
.hpseg.on{background:var(--ink); color:#fff}

/* ---------- スマホ版（幅375を端末風の枠で囲み、枠の中を縦に送る） ---------- */
.hpphone{
  width:min(375px, 100%); margin:0 auto;
  background:#1d2733; border:10px solid #1d2733; border-radius:30px;
  box-shadow:0 10px 30px rgba(16,32,48,.22); overflow:hidden;
}
.hpnotch{
  height:16px; display:flex; align-items:center; justify-content:center;
  background:#1d2733;
}
.hpnotch::before{
  content:''; width:96px; height:5px; border-radius:3px; background:#38495c;
}
.hpscroll{
  height:min(70vh, 620px); overflow-y:auto; overflow-x:hidden;
  background:#fff; border-radius:20px; -webkit-overflow-scrolling:touch;
}
.hpscroll .hpshot{display:block; width:100%; padding:0; cursor:zoom-in}
.hpscroll .hpshot img{display:block; width:100%; height:auto}

/* ---------- PC版（横幅いっぱい・最大1280） ---------- */
.hppc{
  width:100%; max-width:1280px; margin:0 auto;
  border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#fff;
}
.hppc .hpshot{display:block; width:100%; padding:0; cursor:zoom-in}
.hppc .hpshot img{display:block; width:100%; height:auto}

.hpcenter{text-align:center; margin:8px 0 0}
.hpcap{margin:12px 0 0; font-size:13px; line-height:1.7}
.hpempty{
  border:1px dashed var(--line); border-radius:10px; background:#fafcfe;
  padding:26px 16px; text-align:center; color:var(--sub); line-height:1.9;
}
.hpempty code{
  background:var(--gray-bg); padding:1px 5px; border-radius:4px;
  font-size:12px; word-break:break-all;
}
.hpnotes{margin:0; padding-left:1.2em; font-size:14px; line-height:1.9}

/* ---------- その他（決まりに合わなかった資料） ---------- */
.hpfig{margin:0; display:flex; flex-direction:column; gap:8px}
.hpfig .hpimg{
  border:1px solid var(--line); border-radius:10px; overflow:hidden;
  background:#f4f7fa; padding:0; cursor:zoom-in; display:flex;
  justify-content:center; width:100%;
}
.hpfig .hpimg img{display:block; width:auto; max-width:100%; max-height:280px;
  object-fit:contain}
.hpfig figcaption{font-size:13px; line-height:1.7}
.hpold{
  display:inline-block; padding:1px 7px; border-radius:999px;
  background:var(--gray-bg); color:var(--sub); font-size:11px; font-weight:700;
}
.hpnoimg{
  border:1px dashed var(--line); border-radius:10px; padding:20px;
  text-align:center; color:var(--sub); background:#fafcfe;
}
/* ほかの案は並べて置く。狭い画面では1列にする（横スクロールを出さない） */
.hpgrid{display:grid; gap:14px; grid-template-columns:1fr}
@media (min-width:640px){ .hpgrid{grid-template-columns:1fr 1fr} }
@media (min-width:1000px){ .hpgrid{grid-template-columns:1fr 1fr 1fr} }

/* ==========================================================================
   画面再設計（2026-09-04・制作案件向けシンプル版）で足した部品
   --------------------------------------------------------------------------
   ここから下は、工事向け（kyouwadx 系）から分岐して制作案件向けに作った分。
   考え方は3つだけ。
     * 先方の動線「見る → 書く → 決める」を1画面で終わらせる
     * 同じ情報を2か所に出さない
     * 説明は1行以内。長い注記は「?」に畳む
   ========================================================================== */

/* ---------- ナビの「…」（日常的に開かない画面をここへ畳む） ---------- */
/* ★ ナビは横に流れる。「…」が流れて画面の外に出ると、マニュアルにも管理にも
   たどり着けなくなるので、右端に貼り付けて常に見えるようにする */
.navmore{
  position:relative; display:inline-flex; align-items:center; flex:0 0 auto;
  background:linear-gradient(to right, rgba(22,40,60,0) 0, #16283c 8px, #16283c 100%);
  padding-left:10px;
}
.navmore:empty{display:none}
.navmore-b{
  color:#c9d8e6; background:none; border:0; border-radius:7px;
  padding:9px 14px; min-height:38px; font:600 15px/1 inherit; cursor:pointer;
  letter-spacing:2px;
}
.navmore-b:hover{background:rgba(255,255,255,.10); color:#fff}
.navmore-b.on{background:#2f5f8f; color:#fff}
.navmenu{
  position:absolute; top:calc(100% + 4px); right:0; z-index:60; min-width:170px;
  background:#fff; border:1px solid var(--line); border-radius:10px; padding:5px;
  box-shadow:0 8px 24px rgba(16,32,48,.22);
}
.navmenu a{
  display:flex; align-items:center; min-height:var(--tap); padding:8px 12px;
  border-radius:7px; color:var(--ink); font-size:14px; white-space:nowrap;
}
.navmenu a:hover{background:#eef4ff; text-decoration:none}
.navmenu a.on{background:#e6f0fd; color:var(--accent-d); font-weight:700}

/* ---------- 2択・3択の切り替え（種別・端末など） ---------- */
.seg{display:inline-flex; border:1px solid var(--line); border-radius:9px;
  overflow-x:auto; overflow-y:hidden; background:#fff; max-width:100%;
  scrollbar-width:thin}
.segb{
  min-height:var(--tap); padding:8px 16px; border:0; background:#fff; color:var(--ink);
  font:600 14px/1.4 inherit; font-family:inherit; cursor:pointer; white-space:nowrap;
}
.segb + .segb{border-left:1px solid var(--line)}
.segb:hover{background:#f2f5f8}
.segb.on{background:var(--accent); color:#fff}
/* ★ 狭い画面では、切り替えを「札」に組み替えて折り返す。
   横に隠すと、いちばん右の選択肢に永久にたどり着けない人が出る
   （2026-09-05、タスクの絞り込み「保留」が幅375で隠れていた）。
   選択肢を1つ足したときに、黙って画面の外へ押し出されるのを防ぐ。 */
@media (max-width:560px){
  .seg{flex-wrap:wrap; overflow:visible; border:0; background:none; gap:6px}
  .segb{border:1px solid var(--line); border-radius:8px}
  .segb + .segb{border-left:1px solid var(--line)}
}

/* ---------- 折り畳み（くわしい設定・履歴） ---------- */
.foldset{border-top:1px dashed var(--line); margin-top:6px; padding-top:10px}
.foldset > summary{
  cursor:pointer; color:var(--accent-d); font-size:13px; font-weight:600;
  min-height:34px; display:flex; align-items:center; list-style:none;
}
.foldset > summary::-webkit-details-marker{display:none}
.foldset > summary::before{content:'▸ '; margin-right:4px}
.foldset[open] > summary::before{content:'▾ '}
.foldset > summary:hover{text-decoration:underline}
.foldset[open]{padding-bottom:4px}

/* ---------- 注記を「?」に畳む ---------- */
.qmark{
  display:inline-flex; align-items:center; justify-content:center;
  width:20px; height:20px; margin-left:6px; padding:0; vertical-align:middle;
  border:1px solid var(--line); border-radius:50%; background:#fff;
  color:var(--sub); font:700 12px/1 inherit; font-family:inherit; cursor:help;
}
.qmark:hover{background:#eef4ff; border-color:var(--accent); color:var(--accent-d)}
.qbody{
  margin:8px 0 0; padding:9px 12px; border-radius:8px;
  background:#f7f9fb; border:1px solid var(--line);
  font-size:12.5px; line-height:1.75; color:var(--sub);
}

/* ==========================================================================
   工程の帯（6工程を1本で。ガントは廃止した）
   --------------------------------------------------------------------------
   ★ 日付の目盛りは持たない。制作案件で先方が知りたいのは
     「いま何合目か」であって、何日に何ミリ進んだかではない。
     節目（マイルストーン）は帯の上の点として置く。
   ========================================================================== */
.route{margin:12px 0 0}
.route-bar{
  display:flex; width:100%; height:14px; border-radius:7px; overflow:hidden;
  background:var(--gray-bg); position:relative;
}
.route-bar i{display:block; height:100%; border-right:2px solid #fff}
.route-bar i:last-child{border-right:0}
.route-bar i.done{background:#2f9e5e}
.route-bar i.now{background:#4a8fe0}
.route-bar i.todo{background:#dfe5eb}
/* 節目は帯の上の点。日付は下の一覧で読む（帯の上に文字を重ねない） */
.route-ms{position:relative; height:14px; margin-bottom:3px}
.route-ms .pt{
  position:absolute; top:4px; width:10px; height:10px; margin-left:-5px;
  border-radius:50%; background:#7a4fd6; border:2px solid #fff;
  box-shadow:0 0 0 1px #7a4fd6;
}
.route-steps{
  list-style:none; margin:8px 0 0; padding:0;
  display:grid; grid-template-columns:repeat(6,1fr); gap:6px;
}
.route-steps li{font-size:11.5px; line-height:1.45; color:var(--sub); text-align:center}
.route-steps li .n{
  display:block; font-weight:700; color:var(--ink); font-size:12px;
  word-break:break-word;
}
.route-steps li.done .n{color:var(--sub); font-weight:400}
.route-steps li.now{
  background:#f2f7ff; border-radius:8px; padding:4px 2px;
  outline:1px solid #8bb6ec;
}
.route-steps li.now .n{color:var(--accent-d)}
.route-note{margin-top:8px; font-size:12.5px; color:var(--sub)}
.route-note b{color:var(--ink)}
@media (max-width:560px){
  /* 6つを横並びにすると1文字ずつになる。狭い画面では帯だけにして、
     現在地はすぐ下の .route-note が言葉で伝える（同じことを2か所に出さない） */
  .route-steps{display:none}
}

/* ==========================================================================
   あなたの番（先方がいちばん最初に見る場所）
   1列だけ。判断待ち・確認待ち・返信待ちを混ぜて時系列ではなく種類順に出す。
   ========================================================================== */
.turn{list-style:none; margin:0; padding:0}
.turn li{
  display:flex; gap:11px; align-items:flex-start;
  padding:11px 12px; margin:0 0 8px; border-radius:10px;
  border:1px solid var(--line); background:#fff;
}
.turn li:last-child{margin-bottom:0}
.turn li.j{border-color:#e0c56a; background:#fffbef}
.turn li.v{border-color:#b9dcc6; background:#f6fbf8}
.turn li.r{border-color:#c7dafa; background:#f5f9ff}
.turn .ic{flex:0 0 auto; font-size:18px; line-height:1.5}
.turn .bd{flex:1 1 auto; min-width:0}
.turn .ttl{font-weight:700; font-size:14px; display:block; word-break:break-word}
.turn .sub{display:block; font-size:12.5px; color:var(--sub); margin-top:2px}
.turn .go{flex:0 0 auto; align-self:center}
.turn-none{
  display:flex; align-items:center; gap:10px; padding:16px 12px;
  border-radius:10px; background:var(--ok-bg); color:var(--ok);
  font-size:14px; font-weight:600;
}

/* ---------- 直近の動き ---------- */
.moves{list-style:none; margin:0; padding:0}
.moves li{
  display:flex; gap:10px; align-items:flex-start;
  padding:9px 0; border-bottom:1px solid var(--line); font-size:13px;
}
.moves li:last-child{border-bottom:0}
.moves .ic{flex:0 0 auto}
.moves .bd{flex:1 1 auto; min-width:0}
.moves .bd .t{display:block; word-break:break-word}
.moves .bd .m{display:block; font-size:11.5px; color:var(--gray); margin-top:1px}

/* ---------- タスクの種別アイコン ---------- */
.tmark{
  display:inline-flex; align-items:center; justify-content:center;
  width:26px; height:26px; border-radius:7px; font-size:14px; flex:none;
  background:var(--gray-bg);
}
.tmark.t-judge{background:#fff3d4}
.tmark.t-verify{background:var(--ok-bg)}
.tmark.t-work{background:#e9eef4}

/* 一覧の「何を」欄。アイコン＋題名＋補足を1かたまりで押せるようにする */
.what{display:flex; gap:9px; align-items:flex-start; min-width:0}
.what .bd{min-width:0}
.what .ttl{font-weight:600; word-break:break-word}
.what .sub{display:block; font-size:12px; color:var(--sub); margin-top:1px}
.what .dec{
  display:block; font-size:12.5px; color:var(--ok); margin-top:3px;
  word-break:break-word;
}

/* ==========================================================================
   HP制作 — 画面専用のスレッドと版
   ========================================================================== */
/* この画面だけ本文の幅を広げる（PC版のたたき台を最大1280で出すため） */
.hppage .wrap{max-width:1320px}

/* ---------- スレッド（この画面の中だけの発言） ---------- */
.thread{
  max-height:min(60vh, 520px); overflow-y:auto; -webkit-overflow-scrolling:touch;
  background:#eef2f6; border:1px solid var(--line); border-radius:var(--radius);
  padding:12px; margin:0 0 12px;
}
.thread .msg .bub{max-width:min(86%,640px)}
.thread-none{padding:18px 8px; text-align:center; color:var(--sub); font-size:13px}
.thread .to{
  display:inline-block; background:var(--accent); color:#fff; border-radius:10px;
  padding:1px 9px; font-size:11px; font-weight:700; margin-bottom:3px;
}

/* ---------- 版（第N版）と履歴 ---------- */
.vbadge{
  display:inline-block; padding:2px 9px; border-radius:11px; font-size:11.5px;
  font-weight:700; background:#e6f0fd; color:var(--accent-d); white-space:nowrap;
}
.vbadge.old{background:var(--gray-bg); color:var(--sub)}
.vers{list-style:none; margin:8px 0 0; padding:0}
.vers li{
  display:flex; gap:10px; align-items:center; padding:8px 0;
  border-bottom:1px dotted var(--line); font-size:13px;
}
.vers li:last-child{border-bottom:0}
.vers .bd{flex:1 1 auto; min-width:0}
.vers .bd b{display:block; word-break:break-word}
.vers .bd span{font-size:11.5px; color:var(--gray)}

/* ---------- ドラッグ＆ドロップの受け口 ---------- */
.drop{
  border:2px dashed #b9c9dc; border-radius:12px; background:#fafcfe;
  padding:18px 14px; text-align:center; color:var(--sub); cursor:pointer;
  font-size:13.5px; line-height:1.8;
}
.drop:hover{border-color:var(--accent); background:#f4f9ff}
.drop.over{border-color:var(--accent); background:#e8f2ff; color:var(--accent-d)}
.drop b{display:block; color:var(--ink); font-size:14px}
.drop .picked{
  margin-top:8px; font-size:12.5px; color:var(--accent-d); font-weight:600;
  word-break:break-all;
}

/* ==========================================================================
   決定（決定ログと正式文書）
   ========================================================================== */
.declist{list-style:none; margin:0; padding:0}
.declist > li{
  border:1px solid var(--line); border-radius:10px; padding:12px 14px;
  margin:0 0 10px; background:#fff;
}
.declist > li.dead{background:#fafbfc}
.declist .dhd{display:flex; gap:10px; align-items:baseline; flex-wrap:wrap}
.declist .dhd .when{font-size:12.5px; color:var(--sub); white-space:nowrap}
.declist .dhd .ttl{font-weight:700; font-size:14.5px; flex:1 1 200px; min-width:0}
.declist .body{margin-top:6px; font-size:13.5px; line-height:1.75}
.declist .meta{margin-top:6px; font-size:12.5px; color:var(--sub);
  display:flex; gap:12px; flex-wrap:wrap}
.declist .acts{margin-top:10px; display:flex; gap:8px; flex-wrap:wrap}
.declist .refs{margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; align-items:center}
.declist .refs .rf{
  display:inline-flex; align-items:center; gap:6px; min-height:34px; padding:4px 10px;
  border:1px solid var(--line); border-radius:8px; background:#fff;
  font-size:12.5px; color:var(--ink);
}
.declist .refs .rf:hover{background:#eef4ff; text-decoration:none}

/* ---------- 画面のいちばん上に置く1行の説明 ---------- */
.lead{margin:6px 0 0; font-size:13px; color:var(--sub)}

/* ---------- SNS業務効率化のたたき台（画面の中で描く流れ図） ---------- */
/* ★ SVG は viewBox で縮むので、横に溢れることはない。
   それでも入れ物に max-width を置くのは、PC の広い画面で図が間延びして
   文字だけが小さく見えるのを防ぐため（図の意味は横幅では変わらない）。 */
.snsfig{max-width:900px; margin:0 auto}
.snsfig svg{display:block; width:100%; height:auto}
.snsfig[data-device="スマホ"]{max-width:380px}
/* ★ モックの画像。幅に応じて縮むだけ（端末の札は出さない）。
   縦に長いモック（下層ページなど）は高さに上限を置き、
   全体の形が1画面で分かるようにする。原寸は押せば開く。 */
.snsmock{
  display:block; width:100%; padding:0; border:1px solid var(--line);
  border-radius:10px; background:#fff; cursor:zoom-in; overflow:hidden;
}
.snsmock:hover{border-color:var(--accent)}
.snsmock img{display:block; width:100%; height:auto; max-height:70vh; object-fit:contain}
