/* MigraQ — ローカルWeb UI
   方針: 静かな作業場。温かいグレーの紙面と白い面、主な操作は墨色（黒）のボタン一色。
   見出しは明朝（Noto Serif JP）、本文はゴシック。角丸は 6/8/12。影は浮いている物（メニュー・ダイアログ）だけ。 */
:root{
  --bg:#f6f5f2; --surface:#ffffff; --surface-2:#fafaf8; --surface-3:#efeee9; --panel:#f6f5f2;
  --border:#e8e6e0; --border-strong:#d5d2ca;
  --fg:#1d1c1a; --muted:#625f58; --faint:#9b978e;
  --accent:#1d1c1a; --accent-hover:#000000; --accent-weak:#efede8; --accent-ink:#1d1c1a; --on-accent:#ffffff;
  --link:#2f5bc4;
  --ok:#2f8a55; --ok-weak:#e5f3ea; --warn:#9a5b06; --warn-weak:#f7eedf;
  --crit:#c23b3b; --crit-weak:#fbe8e6; --ng:#b83e74; --ng-weak:#fbe8f0;
  --banner:#f4ead9; --banner-ink:#8a5414;
  --r-s:6px; --r:8px; --r-l:12px;
  --font-ui:"IBM Plex Sans JP","Noto Sans JP","Hiragino Sans","Yu Gothic UI",Meiryo,system-ui,sans-serif;
  --font-display:"Noto Serif JP","Hiragino Mincho ProN","Yu Mincho",serif;
  --font-mono:"IBM Plex Mono","JetBrains Mono",ui-monospace,Consolas,monospace;
  --h-title:48px;
  --shadow:0 1px 2px rgba(29,28,26,.04),0 8px 24px rgba(29,28,26,.08);
  color-scheme:light;
}
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]){
  --bg:#141312; --surface:#1c1b19; --surface-2:#211f1d; --surface-3:#2a2825; --panel:#181715;
  --border:#2e2c29; --border-strong:#3e3b37;
  --fg:#eceae6; --muted:#aaa59c; --faint:#77736b;
  --accent:#eceae6; --accent-hover:#ffffff; --accent-weak:#2a2825; --accent-ink:#eceae6; --on-accent:#1c1b19;
  --link:#8fb0ff;
  --ok:#5cc28a; --ok-weak:#16291e; --warn:#e3a945; --warn-weak:#2f2512;
  --crit:#ef7272; --crit-weak:#331a1a; --ng:#ec7fae; --ng-weak:#351a27;
  --banner:#2c2418; --banner-ink:#e8b86b;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.4);
  color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#141312; --surface:#1c1b19; --surface-2:#211f1d; --surface-3:#2a2825; --panel:#181715;
  --border:#2e2c29; --border-strong:#3e3b37;
  --fg:#eceae6; --muted:#aaa59c; --faint:#77736b;
  --accent:#eceae6; --accent-hover:#ffffff; --accent-weak:#2a2825; --accent-ink:#eceae6; --on-accent:#1c1b19;
  --link:#8fb0ff;
  --ok:#5cc28a; --ok-weak:#16291e; --warn:#e3a945; --warn-weak:#2f2512;
  --crit:#ef7272; --crit-weak:#331a1a; --ng:#ec7fae; --ng-weak:#351a27;
  --banner:#2c2418; --banner-ink:#e8b86b;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.4);
  color-scheme:dark;
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--fg);font-family:var(--font-ui);font-size:13px;line-height:1.6;
  -webkit-font-smoothing:antialiased;overflow:hidden}
button{font-family:inherit;cursor:pointer;color:inherit}
h1,h2,h3,h4{margin:0;text-wrap:balance}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.mono{font-family:var(--font-mono)}
.tnum{font-variant-numeric:tabular-nums}
#app{height:100%}

/* ---------- 共通部品 ---------- */
.i{width:15px;height:15px;flex:none;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;vertical-align:-3px}
/* モジュールのドット絵（icons.js の monoBadge）。薄い色の台に 12×12 の絵 */
.mono-badge{display:inline-block;flex:none;width:18px;height:18px;border-radius:4px;background:var(--px-tint,var(--surface-3));overflow:hidden;vertical-align:middle}
.mono-badge svg{display:block;width:100%;height:100%}
.mono-badge.lg{width:30px;height:30px;border-radius:7px}

.btn{display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 14px;border-radius:var(--r);
  border:1px solid var(--border-strong);background:var(--surface);color:var(--fg);font-size:13px;font-weight:600;white-space:nowrap;transition:background .12s,border-color .12s,color .12s}
.btn:hover{border-color:var(--faint)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
.btn.ghost{background:transparent}
.btn.sm{height:28px;padding:0 11px;font-size:12.5px;gap:6px}
.btn:disabled{opacity:.42;cursor:not-allowed}
.btn:disabled:hover{border-color:var(--border-strong)}
.btn.primary:disabled:hover{background:var(--accent);border-color:var(--accent)}
.icon-btn{width:28px;height:28px;display:grid;place-items:center;border-radius:var(--r);border:1px solid var(--border);
  background:var(--surface);color:var(--muted)}
.icon-btn:hover{color:var(--fg);border-color:var(--border-strong)}
.brand{display:inline-flex;align-items:center;gap:9px;font-weight:700;font-size:14px;letter-spacing:.01em;color:var(--fg);text-decoration:none}
.brand .mark{width:24px;height:24px;border-radius:var(--r-s);background:var(--fg);color:var(--bg);display:grid;place-items:center;font-size:12px;font-weight:700}
.spin{display:inline-block;width:12px;height:12px;border-radius:50%;border:2px solid var(--border-strong);border-top-color:var(--accent);animation:spin .8s linear infinite;flex:none}
@keyframes spin{to{transform:rotate(360deg)}}
.chg{display:inline-block;font-size:11px;font-weight:600;padding:0 6px;border-radius:var(--r-s);background:var(--warn-weak);color:var(--warn);line-height:18px}
.chg.same{background:var(--surface-3);color:var(--muted)}

/* ---------- 構成ダイアログ ---------- */
.setup{height:100%;overflow:auto;display:flex;flex-direction:column}
.setup-top{flex:none;display:flex;align-items:center;gap:12px;padding:0 20px;height:var(--h-title);background:var(--surface);border-bottom:1px solid var(--border)}
.setup-top .sp{flex:1}
.setup-main{flex:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,600px);gap:20px;align-items:start;padding:clamp(20px,5vh,48px) clamp(16px,3vw,40px) 48px}
@media (max-width:1100px){.setup-main{grid-template-columns:1fr}}
.setup-card{width:100%;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l)}
.sc-head{padding:20px 24px 16px;border-bottom:1px solid var(--border)}
.sc-head h1{font-size:17px;font-weight:700}
.sc-head p{margin:4px 0 0;color:var(--muted);font-size:12.5px}
.scard-sec{padding:18px 24px;border-bottom:1px solid var(--border)}
.cfg-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.cfg-row+.cfg-row{margin-top:14px}
.cfg-row .lbl{width:104px;flex:none;color:var(--muted);font-size:12.5px}
.seg{display:inline-flex;border:1px solid var(--border-strong);border-radius:var(--r);overflow:hidden}
.seg button{height:28px;padding:0 13px;font-size:12.5px;color:var(--muted);background:var(--surface);border:none;border-right:1px solid var(--border)}
.seg button:last-child{border-right:none}
.seg button:hover{color:var(--fg)}
.seg button.on{background:var(--accent-weak);color:var(--accent-ink);font-weight:600}
select.mini{appearance:none;height:28px;border:1px solid var(--border-strong);border-radius:var(--r);padding:0 30px 0 10px;font:inherit;font-size:12.5px;color:var(--fg);cursor:pointer;
  background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a919e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center}
.src-note{font-size:12px;color:var(--faint)}
.sec-cap{font-size:12px;font-weight:600;color:var(--muted);margin-bottom:10px}
.drop{display:flex;align-items:center;gap:14px;border:1px dashed var(--border-strong);border-radius:var(--r);background:var(--surface-2);padding:18px 18px;cursor:pointer;transition:border-color .12s,background .12s}
.drop:hover,.drop.hot{border-color:var(--accent);background:var(--accent-weak)}
.drop .di{width:36px;height:36px;border-radius:var(--r);display:grid;place-items:center;background:var(--surface);border:1px solid var(--border);color:var(--muted)}
.drop .di .i{width:18px;height:18px}
.drop b{font-size:13px;font-weight:600}
.drop p{margin:2px 0 0;color:var(--faint);font-size:12px}
.filecard{margin-top:10px;display:flex;align-items:center;gap:11px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface)}
.filecard .i{width:18px;height:18px;color:var(--muted)}
.filecard b{font-size:13px;font-weight:600}
.filecard .sub{font-size:11.5px;color:var(--faint)}
.badge-ok{margin-left:auto;display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:600;color:var(--ok)}
.scard-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:14px 24px;background:var(--panel);border-radius:0 0 var(--r-l) var(--r-l)}
.scard-foot .hint{flex:1;min-width:160px;color:var(--faint);font-size:12px}

/* ---------- ワークベンチ骨格 ---------- */
.ide{height:100%;display:flex;flex-direction:column}
.titlebar{height:var(--h-title);flex:none;display:flex;align-items:center;gap:10px;padding:0 12px 0 14px;background:var(--surface);border-bottom:1px solid var(--border)}
.crumb{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--muted);min-width:0;margin-left:6px;padding-left:14px;border-left:1px solid var(--border)}
.crumb b{color:var(--fg);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crumb .i{width:13px;height:13px;color:var(--faint)}
.tb-spacer{flex:1}
.ai-pill{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);white-space:nowrap}
.ai-pill .dot{width:7px;height:7px;border-radius:50%;background:var(--ok)}
.tb-count{font-family:var(--font-mono);font-size:11.5px;color:var(--faint);white-space:nowrap}
.tb-btn{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 11px;border-radius:var(--r);border:1px solid var(--border-strong);
  background:var(--surface);font-size:12.5px;font-weight:600;color:var(--fg);white-space:nowrap}
.tb-btn:hover{border-color:var(--faint)}
.tb-btn:disabled{opacity:.42;cursor:not-allowed}
.tb-btn.run{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.tb-btn.run.go{background:var(--ok);border-color:var(--ok)}
.tb-btn.run:disabled{opacity:.7}
.tb-btn.run .spin{border-color:color-mix(in srgb,var(--on-accent) 35%,transparent);border-top-color:var(--on-accent)}
.body-row{flex:1;display:flex;min-height:0}

/* 左: 分析エクスプローラー */
.side{width:264px;flex:none;background:var(--panel);border-right:1px solid var(--border);display:flex;flex-direction:column;min-width:0;min-height:0}
.side-head{flex:none;padding:12px 16px 6px;font-size:11.5px;font-weight:600;color:var(--faint)}
.side-body{flex:1;overflow:auto;padding:2px 8px 12px}
.n2,.n2-h{display:flex;align-items:center;gap:8px;height:30px;padding:0 8px;border-radius:var(--r-s);font-size:13px;font-weight:600;color:var(--fg);cursor:pointer}
.n2 .i,.n2-h .i{color:var(--muted)}
.n2:hover,.n2-h:hover{background:var(--surface-3)}
.n2.active{background:var(--accent-weak);color:var(--accent-ink)}
.n2.active .i{color:var(--accent-ink)}
.n2grp{margin-top:6px}
.caret,.caret2{display:inline-grid;place-items:center;width:14px;flex:none;color:var(--faint);transition:transform .12s}
.caret .i,.caret2 .i{width:12px;height:12px}
.n2grp.collapsed>.n2-h .caret,.n2sub.collapsed .caret2{transform:rotate(-90deg)}
.n2grp.collapsed>.n2-ch,.n2sub.collapsed>.n2sub-ch{display:none}
.cnt{margin-left:auto;font-family:var(--font-mono);font-size:11px;font-weight:500;color:var(--faint)}
.n2-sub,.n2-leaf,.n2-h2,.n2-leaf2{display:flex;align-items:center;gap:8px;border-radius:var(--r-s);cursor:pointer;color:var(--muted);font-size:12.5px;white-space:nowrap;overflow:hidden}
.n2-sub{height:28px;padding:0 8px 0 30px;font-weight:600}
.n2-leaf{height:26px;padding:0 8px 0 40px;font-family:var(--font-mono);font-size:12px}
.n2-leaf .i{width:13px;height:13px;color:var(--faint)}
.n2-h2{height:28px;padding:0 8px 0 22px;color:var(--fg);font-weight:600}
.n2-leaf2{height:26px;padding:0 8px 0 52px}
.n2-sub:hover,.n2-leaf:hover,.n2-h2:hover,.n2-leaf2:hover{background:var(--surface-3);color:var(--fg)}
.n2-sub.active,.n2-leaf.active,.n2-h2.active,.n2-leaf2.active{background:var(--accent-weak);color:var(--accent-ink)}
.n2-mod{display:flex;align-items:center;gap:7px;padding:8px 8px 3px 30px;font-size:11.5px;color:var(--faint)}
.n2-mod .mono-badge{width:16px;height:16px}
.n2-note{padding:6px 8px 6px 30px;font-size:12px;color:var(--faint)}
.nlock{margin-left:auto;font-size:10.5px;color:var(--faint);font-weight:500}
.lbl-txt{min-width:0;overflow:hidden;text-overflow:ellipsis}

.side-foot{flex:none;border-top:1px solid var(--border);max-height:45%;overflow:auto}
.gear{width:100%;display:flex;align-items:center;gap:8px;height:36px;padding:0 16px;background:none;border:none;font-size:12px;font-weight:600;color:var(--muted)}
.gear:hover{color:var(--fg)}
.gear .g-cnt{margin-left:auto;font-family:var(--font-mono);font-size:11px;color:var(--faint)}
.md-tree{padding:0 8px 10px}
.md-tree .row{display:flex;align-items:center;gap:7px;height:26px;padding:0 8px;border-radius:var(--r-s);font-size:12px;color:var(--muted)}
.md-tree .row .i{width:13px;height:13px;color:var(--faint)}
.md-tree .tree-folder>.row{color:var(--fg);font-weight:600}
.md-tree .row.file{padding-left:24px;cursor:pointer}
.md-tree .row.file:hover{background:var(--surface-3);color:var(--fg)}
.md-tree .row.file.active{background:var(--accent-weak);color:var(--accent-ink)}
.md-tree .row.file.locked{opacity:.45;cursor:default}
.md-tree .row.file.locked:hover{background:none;color:var(--muted)}
.md-tree .fn{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* 中央 */
.main{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--surface)}
.tabsbar{height:36px;flex:none;display:flex;align-items:stretch;background:var(--panel);border-bottom:1px solid var(--border);overflow-x:auto}
.etab{display:flex;align-items:center;gap:7px;padding:0 12px;font-size:12.5px;color:var(--muted);border-right:1px solid var(--border);white-space:nowrap;cursor:pointer;border-top:2px solid transparent}
.etab .i{width:13px;height:13px}
.etab:hover{color:var(--fg)}
.etab.active{background:var(--surface);color:var(--fg);border-top-color:var(--accent)}
.etab .x{display:grid;place-items:center;width:18px;height:18px;border-radius:var(--r-s);color:var(--faint)}
.etab .x .i{width:12px;height:12px}
.etab .x:hover{background:var(--surface-3);color:var(--fg)}
.main-split{flex:1;display:flex;min-height:0}
.editor{flex:1;overflow:auto;min-width:0}
.md-drawer{flex:none;width:50%;min-width:0;border-left:1px solid var(--border);background:var(--surface);display:flex;flex-direction:column}
.md-drawer[hidden]{display:none}
.md-dr-head{flex:none;display:flex;align-items:center;gap:6px;height:40px;padding:0 10px 0 14px;border-bottom:1px solid var(--border);background:var(--panel)}
.md-dr-head .t{flex:1;min-width:0;display:flex;align-items:center;gap:7px;font-size:12.5px;font-weight:600;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.md-dr-head .t .i{color:var(--faint)}
.md-dr-body{flex:1;overflow:auto;padding:20px 24px 40px}

/* ---------- ビュー ---------- */
.doc{padding:20px clamp(20px,2.4vw,36px) 56px}
.vh{margin-bottom:20px}
.vh-crumb{font-family:var(--font-mono);font-size:11.5px;color:var(--faint);margin-bottom:6px}
.vh-row{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap}
.vh-main{min-width:0;flex:1}
.vh-title{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:700;line-height:1.35}
.vh-meta{margin:4px 0 0;color:var(--muted);font-size:12.5px}
.vh-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.sec{margin-top:28px}
.vh+.sec{margin-top:4px}
.vh-title .i{width:17px;height:17px;color:var(--faint);vertical-align:0}
.sec-h{display:flex;align-items:baseline;gap:10px;font-size:13px;font-weight:700;padding-bottom:8px;margin-bottom:12px;border-bottom:1px solid var(--border)}
.sec-h .aux{font-size:12px;font-weight:400;color:var(--faint)}

.tbl-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--r)}
.tbl-wrap table{width:100%;border-collapse:collapse;font-size:12.5px;min-width:440px}
.tbl-wrap th{text-align:left;padding:7px 12px;background:var(--surface-2);color:var(--muted);font-weight:600;font-size:12px;border-bottom:1px solid var(--border);white-space:nowrap}
.tbl-wrap td{padding:8px 12px;border-bottom:1px solid var(--border);vertical-align:top}
.tbl-wrap tr:last-child td{border-bottom:none}
.tbl-wrap td.mono{font-size:12px}
.tbl-wrap .num{text-align:right;font-variant-numeric:tabular-nums}
.tbl-wrap tr.clk{cursor:pointer}
.tbl-wrap tr.clk:hover td{background:var(--surface-2)}

.kpis{display:flex;flex-wrap:wrap;gap:0;margin:2px 0 0}
.kpi{padding:2px 28px 2px 0;margin-right:28px;border-right:1px solid var(--border)}
.kpi:last-child{border-right:none;margin-right:0;padding-right:0}
.kpi .n{font-size:22px;font-weight:600;line-height:1.2;font-variant-numeric:tabular-nums}
.kpi .l{font-size:12px;color:var(--muted)}

.mod-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px}
.mod-card{display:flex;flex-direction:column;gap:8px;text-align:left;padding:12px 14px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);transition:border-color .12s}
.mod-card:hover{border-color:var(--accent)}
.mc-top{display:flex;align-items:center;gap:9px}
.mc-name{font-size:14px;font-weight:700;flex:1;min-width:0}
.mc-meta{font-size:12px;color:var(--muted)}
.cx{font-size:11px;font-weight:600;color:var(--muted)}
.cx.hi{color:var(--warn)}

.banner{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 14px;margin:0 0 20px;border:1px solid color-mix(in srgb,var(--ok) 30%,var(--border));border-radius:var(--r);background:var(--ok-weak)}
.banner>.i{width:18px;height:18px;color:var(--ok)}
.banner .bt{flex:1;min-width:200px}
.banner .bt b{font-size:13px}
.banner .bt p{margin:1px 0 0;font-size:12.5px;color:var(--muted)}

.steps{display:flex;flex-direction:column}
.st-row{display:flex;align-items:center;gap:12px;height:32px;border-bottom:1px solid var(--border);font-size:13px}
.st-row:last-child{border-bottom:none}
.st-mark{width:18px;height:18px;flex:none;display:grid;place-items:center;border-radius:50%;border:1px solid var(--border-strong);font-family:var(--font-mono);font-size:10px;color:var(--faint)}
.st-row.fin .st-mark{border-color:var(--ok);background:var(--ok);color:var(--on-accent)}
.st-row.fin .st-mark .i{width:11px;height:11px;stroke-width:2.5}
.st-row.run .st-mark{border:none}
.st-row .st-l{flex:1}
.st-row.wait .st-l{color:var(--muted)}
.st-row .st-v{font-family:var(--font-mono);font-size:11.5px;color:var(--faint)}
.st-row.run .st-v{color:var(--accent)}

.note{display:flex;gap:10px;padding:11px 14px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface-2);font-size:12.5px;line-height:1.7;max-width:86ch}
.note .i{color:var(--faint);margin-top:2px}
.io-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.io-box{border:1px solid var(--border);border-radius:var(--r);padding:12px 14px}
.io-box h4{font-size:12px;font-weight:700;color:var(--muted);margin:0 0 6px}
.io-box ul{margin:0;padding-left:18px}.io-box li{margin:3px 0;font-size:12.5px}
.prose{max-width:76ch;margin:0 0 12px;font-size:13px}
.doc-links{display:flex;flex-wrap:wrap;gap:8px}
.doc-link{display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 12px;border:1px solid var(--border-strong);border-radius:var(--r);background:var(--surface);font-size:12.5px;color:var(--fg)}
.doc-link .i{color:var(--faint)}
.doc-link:hover{border-color:var(--accent);color:var(--accent-ink)}
.doc-link.off{opacity:.45;cursor:default}
.docs-acc{margin-top:28px;border:1px solid var(--border);border-radius:var(--r)}
.docs-acc>summary{display:flex;align-items:center;gap:8px;cursor:pointer;list-style:none;padding:10px 14px;font-size:12.5px;font-weight:600;color:var(--muted)}
.docs-acc>summary::-webkit-details-marker{display:none}
.docs-acc>summary .caret{transform:rotate(-90deg)}
.docs-acc[open]>summary .caret{transform:none}
.docs-acc .doc-links{padding:0 14px 14px}
.scr-link{color:var(--accent-ink);cursor:pointer;font-weight:600;text-decoration:none}
.scr-link:hover{text-decoration:underline}
.empty-txt{color:var(--faint);font-size:12.5px}
.env-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--ok);margin-right:8px;vertical-align:1px}
.env-dot.off{background:var(--crit)}

/* ---------- ER図（モジュール級） ---------- */
.erd{border:1px solid var(--border);border-radius:var(--r);overflow:hidden;background:var(--surface-2)}
.erd-ctrl{display:flex;align-items:center;gap:4px;height:36px;padding:0 8px;border-bottom:1px solid var(--border);background:var(--surface)}
.erd-ctrl button{width:26px;height:26px;display:grid;place-items:center;border-radius:var(--r-s);border:1px solid var(--border);background:var(--surface);color:var(--muted)}
.erd-ctrl button:hover{color:var(--fg);border-color:var(--border-strong)}
.erd-ctrl button .i{width:13px;height:13px}
.erd-hint{font-size:11.5px;color:var(--faint);margin-left:8px}
.erd-svg{display:block;width:100%;height:clamp(320px,46vh,460px);cursor:grab;
  background-image:radial-gradient(circle,color-mix(in srgb,var(--border-strong) 70%,transparent) 1px,transparent 1px);background-size:20px 20px}
.erd-edge{stroke:var(--border-strong);stroke-width:1.5}
.erd-elbg{fill:var(--surface);stroke:var(--border)}
.erd-el{fill:var(--muted);font-size:11px;text-anchor:middle;font-family:var(--font-ui)}
.erd-node{cursor:pointer}
.erd-box{fill:var(--surface);stroke:var(--border-strong);stroke-width:1.25}
.erd-node:hover .erd-box{stroke:var(--accent);stroke-width:1.75}
.erd-mono-bg{fill:var(--surface-3)}
.erd-mono{fill:var(--fg);font-size:13px;font-weight:700;text-anchor:middle;font-family:var(--font-ui)}
.erd-nt{fill:var(--fg);font-size:13px;font-weight:700;font-family:var(--font-ui)}
.erd-ns{fill:var(--muted);font-size:11px;font-family:var(--font-ui)}

/* ---------- Markdown（成果物ビュー） ---------- */
.md{font-size:13px}
.md h1{font-size:19px;font-weight:700;margin:0 0 14px}
.md h2{font-size:13.5px;font-weight:700;margin:26px 0 10px;padding-bottom:7px;border-bottom:1px solid var(--border)}
.md h3{font-size:13px;font-weight:700;margin:18px 0 8px}
.md p{margin:8px 0;max-width:76ch}
.md ul,.md ol{margin:8px 0;padding-left:22px}.md li{margin:4px 0;max-width:76ch}
.md code{font-family:var(--font-mono);font-size:12px;background:var(--surface-3);padding:1px 5px;border-radius:var(--r-s)}
.md pre{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r);padding:12px 14px;overflow-x:auto}
.md pre code{background:none;padding:0}
.md .tbl-wrap{margin:12px 0}
.md strong{font-weight:700}

/* ---------- 下部: AIアシスタント（セクション別セッション） ---------- */
.dock{flex:none;height:min(40vh,300px);display:flex;flex-direction:column;border-top:1px solid var(--border);background:var(--surface)}
.dock[hidden]{display:none}
.chat-head{flex:none;display:flex;align-items:center;gap:10px;height:38px;padding:0 8px 0 14px;border-bottom:1px solid var(--border);background:var(--panel)}
.ch-title{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--muted);white-space:nowrap;min-width:0}
.ch-title .i{color:var(--faint)}
.ch-title b{color:var(--fg);font-weight:700;overflow:hidden;text-overflow:ellipsis}
.ch-actions{display:flex;gap:6px;flex-wrap:nowrap;overflow:hidden}
.chip-act{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 9px;border-radius:var(--r-s);border:1px solid var(--border);background:var(--surface);font-size:11.5px;font-weight:600;color:var(--muted);white-space:nowrap}
.chip-act .i{width:12px;height:12px}
.chip-act:hover{color:var(--accent-ink);border-color:var(--accent)}
.chip-act:disabled{opacity:.42;cursor:not-allowed}
.chip-act:disabled:hover{color:var(--muted);border-color:var(--border)}
.chat-head .sp{flex:1}
.chat-head .tc{width:26px;height:26px;display:grid;place-items:center;border-radius:var(--r-s);border:none;background:none;color:var(--faint)}
.chat-head .tc:hover{color:var(--fg);background:var(--surface-3)}
.chat-log{flex:1;min-height:0;overflow:auto;padding:14px 18px;display:flex;flex-direction:column;gap:10px;background:var(--bg)}
.chat-hello{margin:auto;max-width:520px;text-align:center;color:var(--muted);font-size:12.5px;line-height:1.8}
.chat-hello .eg{color:var(--faint)}
.cmsg{display:flex;max-width:72%}
.cmsg.user{align-self:flex-end}
.cmsg.ai{align-self:flex-start}
.cmsg .bub{padding:8px 12px;border-radius:var(--r-l);font-size:13px;line-height:1.65;white-space:pre-wrap}
.cmsg.user .bub{background:var(--accent);color:var(--on-accent);border-bottom-right-radius:var(--r-s)}
.cmsg.ai .bub{background:var(--surface);color:var(--fg);border:1px solid var(--border);border-bottom-left-radius:var(--r-s)}
.cmsg-sys{align-self:center;font-size:11.5px;color:var(--faint)}
.chat-bar{flex:none;display:flex;align-items:center;gap:8px;padding:9px 12px;border-top:1px solid var(--border);background:var(--surface)}
.chat-bar input{flex:1;min-width:0;height:32px;border:1px solid var(--border-strong);border-radius:var(--r);padding:0 12px;font:inherit;font-size:13px;background:var(--surface);color:var(--fg)}
.chat-bar input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}

.statusbar{flex:none;height:26px;display:flex;align-items:center;gap:8px;padding:0 10px 0 14px;background:var(--panel);border-top:1px solid var(--border)}
.sb-phase{font-size:11.5px;color:var(--muted)}
.sb-sp{flex:1}
.sb-btn{display:inline-flex;align-items:center;gap:5px;height:20px;padding:0 8px;border-radius:var(--r-s);border:none;background:none;font-size:11.5px;font-weight:600;color:var(--muted)}
.sb-btn .i{width:12px;height:12px}
.sb-btn:hover{color:var(--fg);background:var(--surface-3)}
.sb-btn.on{color:var(--accent-ink);background:var(--accent-weak)}

/* ---------- レスポンシブ / モーション ---------- */
@media (max-width:860px){
  body{overflow:auto}.ide{height:auto;min-height:100%}
  .side{display:none}.crumb{display:none}
  .cfg-row .lbl{width:100%}
  .md-drawer{width:100%}
  .io-grid{grid-template-columns:1fr}
  .vh-row{align-items:flex-start}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ===== AI 会話（工作台・画面対比で共通。web/chat.js が描画） ===== */
.cm{display:flex;flex-direction:column;gap:4px;max-width:78%}
.cm.user{align-self:flex-end;align-items:flex-end}
.cm.ai{align-self:flex-start;align-items:flex-start}
.cm-bub{padding:8px 12px;border-radius:var(--r-l);font-size:13px;line-height:1.65;word-break:break-word}
.cm.user .cm-bub{background:var(--accent);color:var(--on-accent);border-bottom-right-radius:var(--r-s);white-space:pre-wrap}
.cm.ai .cm-bub{background:var(--surface);color:var(--fg);border:1px solid var(--border);border-bottom-left-radius:var(--r-s);min-width:220px}
.cm.ai.error .cm-bub{border-color:color-mix(in srgb,var(--crit) 45%,var(--border))}
.cm.ai.cancelled .cm-bub{opacity:.75}
.cm img{display:block;width:240px;max-width:100%;border-radius:var(--r);border:1px solid var(--border);cursor:zoom-in;background:#fff}
.cm-meta{font-size:10.5px;color:var(--faint);font-family:var(--font-mono)}
.cm-sys{align-self:center;font-size:11.5px;color:var(--faint);text-align:center}
.cm-notes{display:flex;flex-direction:column;gap:3px;font-size:12px;line-height:1.5;color:var(--fg);background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:6px 9px}
.cm-notes > div{display:flex;align-items:flex-start;gap:6px}
.cm-notes .nb,.nb{flex:none;display:inline-grid;place-items:center;width:17px;height:17px;border-radius:50%;color:#fff;font-size:10.5px;font-weight:700;margin-top:1px}
.cm-text p{margin:0 0 6px}.cm-text p:last-child{margin-bottom:0}
.cm-text .h{font-weight:700;margin:8px 0 4px}
.cm-text .li{position:relative;padding-left:14px;margin:2px 0}
.cm-text .li::before{content:"";position:absolute;left:4px;top:.72em;width:4px;height:4px;border-radius:50%;background:var(--faint)}
.cm-text code,.cm-files code{font-family:var(--font-mono);font-size:11.5px;background:var(--surface-3);padding:1px 4px;border-radius:3px}
.cm-text pre{font-family:var(--font-mono);font-size:11.5px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-s);padding:8px 10px;overflow:auto;margin:6px 0;white-space:pre}
.cm-text table{border-collapse:collapse;font-size:12px;margin:6px 0}
.cm-text th,.cm-text td{border:1px solid var(--border);padding:3px 8px;text-align:left;vertical-align:top}
.cm-text th{background:var(--surface-2);font-weight:600}
.cm-act{margin:-2px 0 6px;font-size:12px;color:var(--muted)}
.cm-act summary{display:flex;align-items:center;gap:7px;cursor:pointer;list-style:none;color:var(--muted)}
.cm-act summary::-webkit-details-marker{display:none}
.cm-act summary::after{content:"▸";font-size:10px;color:var(--faint)}
.cm-act[open] summary::after{content:"▾"}
.cm-act ol{margin:6px 0 0;padding:6px 8px 6px 26px;max-height:180px;overflow:auto;background:var(--surface-2);border-radius:var(--r-s);font-family:var(--font-mono);font-size:11px;line-height:1.7}
.cm-act li.k-edit,.cm-act li.k-write{color:var(--accent-ink);font-weight:500}
.cm-act li.k-build,.cm-act li.k-app{color:var(--ok)}
.cm-act li.k-say{font-family:var(--font-sans,inherit);color:var(--fg);white-space:pre-wrap}
.cm-wait{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12.5px}
.cm-files{margin-top:6px;font-size:11.5px;color:var(--muted)}
.cm-app{margin-top:6px;font-size:12px;font-weight:500;padding:4px 8px;border-radius:var(--r-s)}
.cm-app.ok{background:var(--ok-weak);color:var(--ok)}
.cm-app.ng{background:var(--crit-weak);color:var(--crit)}
.btn.stop{background:var(--crit);border-color:var(--crit);color:#fff}
.cm.user.other .cm-bub{background:color-mix(in srgb,var(--uc,#888) 12%,var(--surface));color:var(--fg);border:1px solid color-mix(in srgb,var(--uc,#888) 35%,var(--border))}
.cm-who{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;color:var(--muted)}
.cm-who .av{width:18px;height:18px;font-size:9px}

/* ===== ユーザー（アバター・メニュー・ログイン・管理） ===== */
.av{display:inline-grid;place-items:center;flex:none;width:22px;height:22px;border-radius:50%;background:var(--av,#2a52be);color:#fff;font-size:10px;font-weight:700;letter-spacing:-.02em;line-height:1;box-shadow:0 0 0 2px var(--surface);user-select:none}
.av.lg{width:48px;height:48px;font-size:18px}
.user-slot{display:inline-flex}
.user-btn{border:none;background:none;padding:2px;border-radius:50%;cursor:pointer;display:grid;place-items:center}
.user-btn:hover .av{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--border-strong)}
.user-btn .av{width:28px;height:28px;font-size:11.5px}
.user-menu{position:fixed;z-index:60;min-width:230px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);box-shadow:0 10px 30px rgba(15,23,42,.18);padding:6px;display:flex;flex-direction:column}
.um-head{display:flex;align-items:center;gap:10px;padding:8px 8px 10px;border-bottom:1px solid var(--border);margin-bottom:4px}
.um-head .av{width:34px;height:34px;font-size:13px}
.um-head b{display:block;font-size:13px}
.um-head span{font-size:11.5px;color:var(--muted)}
.user-menu button{border:none;background:none;text-align:left;padding:8px 10px;border-radius:var(--r-s);font:inherit;font-size:13px;color:var(--fg);cursor:pointer}
.user-menu button:hover{background:var(--surface-3)}
.login-wrap{position:fixed;inset:0;z-index:80;display:grid;place-items:center;background:var(--bg);padding:16px}
.login-card{width:min(380px,100%);background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:28px 28px 22px;display:flex;flex-direction:column;gap:14px;box-shadow:0 12px 40px rgba(15,23,42,.08)}
.login-brand{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:700}
.login-brand .mark{width:30px;height:30px;border-radius:var(--r);background:var(--fg);color:var(--bg);display:grid;place-items:center;font-size:15px}
.login-sub{margin:-6px 0 4px;color:var(--muted);font-size:12.5px}
.login-card label,.dlg-form label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;color:var(--muted)}
.login-card input,.dlg-form input,.dlg-form select{height:36px;border:1px solid var(--border-strong);border-radius:var(--r);padding:0 11px;font:inherit;font-size:13.5px;font-weight:400;background:var(--surface);color:var(--fg);outline:none}
.login-card input:focus,.dlg-form input:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
.login-card .btn{height:38px;justify-content:center;margin-top:4px}
.login-err,.dlg-err{color:var(--crit);font-size:12.5px}
.login-msg{background:var(--warn-weak);color:var(--warn);border-radius:var(--r);padding:8px 10px;font-size:12.5px}
.login-hint{margin:0;font-size:11.5px;color:var(--faint);line-height:1.7}
.login-hint code{font-family:var(--font-mono);background:var(--surface-3);padding:1px 5px;border-radius:3px;color:var(--fg)}
.dlg-wrap{position:fixed;inset:0;z-index:70;background:rgba(10,12,16,.45);display:grid;place-items:center;padding:16px}
.dlg{width:min(640px,100%);max-height:88vh;overflow:auto;background:var(--surface);border-radius:12px;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.dlg-h{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--border);font-size:14px}
.dlg-x{border:none;background:none;font-size:20px;line-height:1;color:var(--faint);cursor:pointer}
.dlg-b{padding:16px 18px 18px}
.dlg-form{display:flex;flex-direction:column;gap:14px}
.dlg-ft{display:flex;justify-content:flex-end}
/* 入力・確認のダイアログ（MigaiAuth.ask。prompt() / confirm() の代わり） */
.dlg.dlg-ask{width:min(520px,100%)}
.dlg-ask .dlg-ft{gap:8px;margin-top:2px}
.dlg-ask .dlg-form{gap:12px}
.dlg-ask textarea{width:100%;min-height:84px;border:1px solid var(--border-strong);border-radius:var(--r);padding:8px 11px;font:inherit;font-size:13.5px;font-weight:400;line-height:1.6;background:var(--surface);color:var(--fg);outline:none;resize:vertical}
.dlg-ask textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
.dlg-ask .dlg-note{margin-top:-6px}
.ask-msg{font-size:13px;line-height:1.7;color:var(--fg)}
.ask-msg p{margin:0 0 6px}
.ask-msg p:last-child{margin-bottom:0}
.ask-msg .aux{font-size:12px;color:var(--faint)}
.ask-msg ul{margin:6px 0;padding-left:18px;max-height:240px;overflow:auto}
.ask-msg li{margin:2px 0}
.ask-msg .ask-warn{margin:8px 0 0;padding:8px 10px;border-radius:var(--r);background:var(--warn-weak);color:var(--warn);font-size:12.5px;line-height:1.6}
.ask-msg .ask-warn+.ask-warn{margin-top:6px}
.ask-req,.ask-opt{margin-left:6px;font-size:10.5px;font-weight:600;padding:0 6px;border-radius:999px;vertical-align:1px}
.ask-req{background:var(--crit-weak);color:var(--crit)}
.ask-opt{background:var(--surface-3);color:var(--faint)}
.pf-av{display:flex;justify-content:center}
.sws{display:flex;gap:8px;flex-wrap:wrap}
.sw-c{width:24px;height:24px;border-radius:50%;border:none;cursor:pointer}
.sw-c.on{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--fg)}
.ul-t{width:100%;border-collapse:collapse;font-size:13px;margin-bottom:18px}
.ul-t th{text-align:left;font-size:11.5px;color:var(--faint);font-weight:600;padding:6px 8px;border-bottom:1px solid var(--border)}
.ul-t td{padding:8px;border-bottom:1px solid var(--border);vertical-align:middle}
.ul-act{text-align:right;white-space:nowrap}
.ul-act .btn{margin-left:4px}
.btn.danger{color:var(--crit)}
.tag-warn{font-size:10.5px;background:var(--warn-weak);color:var(--warn);padding:1px 6px;border-radius:999px;margin-left:4px}
.ul-add{border-top:1px solid var(--border);padding-top:14px}
.ul-add-h{font-size:12.5px;font-weight:700}
.ul-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.ul-grid select,.ul-grid .btn{height:36px}
@media (max-width:640px){.ul-grid{grid-template-columns:1fr}}

/* ===== プロジェクト一覧（開始画面） ===== */
.proj-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);min-width:0}
.pc-head{padding:20px 24px 14px;border-bottom:1px solid var(--border)}
.pc-head h1{font-size:17px;font-weight:700}
.pc-sub{display:block;margin-top:4px;color:var(--muted);font-size:12.5px}
.pc-list{max-height:calc(100vh - 220px);overflow:auto}
.pc-empty{padding:24px;color:var(--faint);font-size:13px;display:flex;align-items:center;gap:8px}
.pc-row{display:grid;grid-template-columns:minmax(0,1fr) auto 28px 76px auto;align-items:center;gap:14px;padding:11px 24px;border-bottom:1px solid var(--border);cursor:pointer}
.pc-row:hover{background:var(--surface-2)}
.pc-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.pc-main{min-width:0;display:flex;flex-direction:column;gap:2px}
.pc-main b{font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pc-meta{font-size:11.5px;color:var(--faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pc-run{color:var(--ok);font-weight:600}
.pc-st{font-size:11.5px;font-weight:600;padding:2px 8px;border-radius:999px;background:var(--surface-3);color:var(--muted);white-space:nowrap}
.pc-st.st-review{background:var(--warn-weak);color:var(--warn)}
.pc-st.st-done{background:var(--accent-weak);color:var(--accent-ink)}
.pc-st.st-generated{background:var(--ok-weak);color:var(--ok)}
.pc-ago{font-size:11.5px;color:var(--faint);text-align:right;white-space:nowrap}
.pc-del{width:24px;height:24px;opacity:0;color:var(--faint)}
.pc-row:hover .pc-del{opacity:1}
.name-in{flex:1;min-width:200px;height:30px;border:1px solid var(--border-strong);border-radius:var(--r);padding:0 10px;font:inherit;font-size:13px;background:var(--surface);color:var(--fg)}

/* ===== 在席（誰がどこを見ているか） ===== */
.pres{display:inline-flex;align-items:center;margin-left:auto;flex:none;padding-left:4px}
.pres .av{width:18px;height:18px;font-size:8.5px;box-shadow:0 0 0 1.5px var(--panel)}
.pres .av+.av{margin-left:-5px}
.pres+.cnt{margin-left:6px}
.pres-more,.pres-head .pres-more{font-size:10px;color:var(--faint);margin-left:3px;font-family:var(--font-mono)}
.pres-head{display:inline-flex;align-items:center;margin-right:2px}
.pres-head .av{width:26px;height:26px;font-size:10.5px;box-shadow:0 0 0 2px var(--surface)}
.pres-head .av+.av{margin-left:-6px}
.presence-slot:empty{display:none}
.scr .pres .av{box-shadow:0 0 0 1.5px var(--surface)}

/* ===== チームの進捗（Summary） ===== */
.team{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px}
@media (max-width:1100px){.team{grid-template-columns:1fr}}
.tm-col{min-width:0}
.tm-h{display:flex;align-items:baseline;gap:10px;font-size:12.5px;font-weight:700;margin-bottom:8px}
.tm-h.sm{margin-top:16px;font-size:12px}
.tm-sum{font-weight:500;color:var(--muted);font-size:12px}
.ng{color:var(--ng)}
.pbar{display:flex;flex:1;height:6px;border-radius:999px;background:var(--surface-3);overflow:hidden;min-width:60px}
.pbar.big{height:10px;margin-bottom:12px}
.pbar i{display:block;height:100%}
.pbar i.ok{background:var(--ok)}
.pbar i.ng{background:var(--ng)}
.tm-rows{display:flex;flex-direction:column;gap:2px}
.tm-row{display:flex;align-items:center;gap:10px;padding:5px 6px;border-radius:var(--r-s);cursor:pointer;font-size:12.5px}
.tm-row:hover{background:var(--surface-2)}
.tm-n{width:90px;flex:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-c{width:120px;flex:none;font-family:var(--font-mono);font-size:11.5px;color:var(--muted)}
.tm-ng{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid color-mix(in srgb,var(--ng) 30%,var(--border));background:var(--ng-weak);border-radius:var(--r-s);margin-top:4px;font-size:12px;cursor:pointer}
.tm-ng .i{width:13px;height:13px;color:var(--ng)}
.tm-ng .nt{flex:1;min-width:0;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-feed{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.tm-feed li{display:flex;align-items:flex-start;gap:9px;padding:7px 2px;border-bottom:1px solid var(--border);font-size:12.5px;line-height:1.5}
.tm-feed .av{margin-top:1px}
.av.sys{background:var(--surface-3);color:var(--muted)}
.av.sys .i{width:12px;height:12px}
.tf-t{flex:1;min-width:0;color:var(--fg)}
.tf-ago{flex:none;font-size:11px;color:var(--faint);white-space:nowrap}
.cm-undo{display:flex;align-items:center;gap:8px;margin-top:6px;font-size:11.5px;color:var(--faint)}
.cm-undo .btn{height:24px;padding:0 9px;font-size:11.5px}
.cm-undo.done{color:var(--muted)}
.tm-mem{display:flex;align-items:center;gap:10px;padding:4px 6px;font-size:12.5px}
.tm-sess{display:flex;align-items:center;gap:8px;padding:6px 6px;border-bottom:1px solid var(--border);font-size:12.5px;cursor:pointer}
.tm-sess:hover{background:var(--surface-2)}
.tm-sess .i{width:13px;height:13px;color:var(--accent)}
.tm-sess b{flex:none;max-width:42%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-sess .nt{flex:1;min-width:0;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-c.r{text-align:right;width:56px}

/* ===== 通知（右下） ===== */
.toasts{position:fixed;right:16px;top:56px;z-index:90;display:flex;flex-direction:column;gap:8px;max-width:min(380px,calc(100vw - 32px))}
.toast{display:flex;align-items:flex-start;gap:9px;padding:10px 10px 10px 12px;background:var(--surface);border:1px solid var(--border);border-left:3px solid var(--accent);border-radius:var(--r-l);box-shadow:0 10px 30px rgba(15,23,42,.16);font-size:12.5px;line-height:1.5;transition:opacity .4s,transform .4s}
.toast.k-check_ok,.toast.k-phase_done{border-left-color:var(--ok)}
.toast.k-check_ng,.toast.k-error{border-left-color:var(--ng)}
.toast.k-ai_fix,.toast.k-ai_doc{border-left-color:#7c3aed}
.toast > span:not(.av){flex:1;min-width:0}
.toast button{border:none;background:none;color:var(--faint);font-size:16px;line-height:1;cursor:pointer;padding:0 2px}
.toast.out{opacity:0;transform:translateY(6px)}
.toast .av.sys{font-size:8.5px}
.opt-list{display:flex;flex-direction:column;gap:6px;margin-top:4px}
.opt{flex-direction:row !important;align-items:center;gap:10px !important;padding:8px 10px;border:1px solid var(--border);border-radius:var(--r);cursor:pointer;font-weight:400 !important;color:var(--fg) !important}
.opt:has(input:checked){border-color:var(--accent);background:var(--accent-weak)}
.opt b{width:120px;flex:none;font-size:13px}
.opt span{font-size:12px;color:var(--muted)}
.dlg-note{margin:0;font-size:11.5px;color:var(--faint)}
.av.self{background:var(--surface);color:var(--av);box-shadow:inset 0 0 0 1.5px var(--av),0 0 0 1.5px var(--panel)}
.n2-h .pres,.mod-h .pres{margin-left:auto}
.n2-h .pres+.cnt,.mod-h .pres+.frac{margin-left:6px}

/* ===================== プロジェクト進行（flow.html / flow.js）: 部品 ===================== */
.chip{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 7px;border-radius:999px;font-size:11px;font-weight:600;background:var(--accent-weak);color:var(--accent-ink);border:1px solid transparent;white-space:nowrap;vertical-align:middle;cursor:default}
.chip .i{width:11px;height:11px}
.chip.ghost{background:transparent;border-color:var(--border);color:var(--muted)}
.chip.ok{background:var(--ok-weak);color:var(--ok)}
.chip.ngc{background:var(--ng-weak);color:var(--ng)}
button.chip{cursor:pointer}
button.chip:hover{border-color:var(--accent)}
.chip.jk{font-family:var(--font-mono);background:var(--accent-weak);color:var(--accent-ink)}
.chip.jk.demo{background:var(--warn-weak);color:var(--warn)}

.tb-phase{text-decoration:none;display:inline-flex;align-items:center;gap:7px;height:26px;padding:0 10px;border-radius:999px;border:1px solid color-mix(in srgb,var(--accent) 35%,var(--border));background:var(--accent-weak);color:var(--accent-ink);font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap}
.tb-phase .pc-dot{width:7px;height:7px;border-radius:50%;background:var(--accent)}
.tb-phase .i{width:13px;height:13px}
.tb-phase:hover{border-color:var(--accent)}
.tb-phase[hidden]{display:none}

.fl .aux,.dlg .aux{font-size:12px;color:var(--faint);font-weight:400}

.psd-act{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0 2px}
.ps-job{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.ps-job.err{color:var(--crit)}
.ps-job.ok{color:var(--ok)}
.ps-job .i{width:13px;height:13px}
.tk{border-bottom:1px solid var(--border)}
.tk:last-child{border-bottom:none}
.tk-row{display:flex;align-items:center;gap:10px;min-height:38px;padding:4px 2px;font-size:12.5px}
.tk-row[data-ps-open]{cursor:pointer}
.tk-row[data-ps-open]:hover{background:var(--surface-2)}
.tk-st{display:grid;place-items:center;width:18px;height:18px;border-radius:50%;border:1.5px solid var(--border-strong);flex:none}
.tk-st .i{width:11px;height:11px}
.tk-st.ok{background:var(--ok);border-color:var(--ok);color:#fff}
.tk-st.ng{background:var(--ng);border-color:var(--ng);color:#fff}
.tk-t{font-weight:600;display:inline-flex;align-items:center;gap:4px;min-width:0}
.tk-caret .i{width:12px;height:12px;color:var(--faint)}
.tk-d{flex:1;color:var(--muted);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tk.done .tk-t{color:var(--muted)}
.tk-ctl{display:flex;gap:6px;flex:none}
.tk-note{font-size:11.5px;color:var(--faint)}
.ps-t{width:100%;border-collapse:collapse;font-size:12px;margin:4px 0 12px}
.ps-t th{text-align:left;font-weight:600;color:var(--faint);font-size:11px;padding:5px 6px;border-bottom:1px solid var(--border)}
.ps-t td{padding:7px 6px;border-bottom:1px solid var(--border);vertical-align:top}
.ps-t tr.off td{opacity:.5}
.ps-t .cr{color:var(--muted);margin-top:2px}
.ps-t .arr{color:var(--accent);font-weight:700}
.ps-t .src{font-size:11px;color:var(--faint);max-width:180px;word-break:break-all}
.ps-t td.mono{white-space:nowrap}
.ps-t .why{color:var(--muted);min-width:180px;max-width:280px}
.ps-t .dec{white-space:nowrap}
.ps-t .dec .btn{margin:4px 4px 0 0}
.st{font-size:11.5px;font-weight:600;color:var(--muted)}
.st.ok{color:var(--ok)}
.st.ng{color:var(--ng)}
.scn{padding:2px 0 12px 28px;font-size:12.5px}
.scn-p{margin:0 0 6px;color:var(--muted)}
.scn-scr{margin-bottom:8px;color:var(--muted);font-size:12px}
.scn-cols{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.scn-cols ol,.scn-cols ul{margin:4px 0 0;padding-left:18px}
.scn-cols li{margin:2px 0}
.scn-act{display:flex;gap:6px;align-items:center;margin-top:10px;flex-wrap:wrap}
.fl .sp,.dlg .sp{flex:1}
.btn.ok-b{color:var(--ok);border-color:color-mix(in srgb,var(--ok) 45%,var(--border))}
.btn.ng-b{color:var(--ng);border-color:color-mix(in srgb,var(--ng) 45%,var(--border))}

/* 6 切替準備: 移行リハーサル（所要時間の推移・履歴・内訳）と切替・切り戻し手順書 */
.rh{padding:2px 0 12px 28px;font-size:12.5px}
.rh-lead{margin:0 0 10px;color:var(--muted);max-width:760px}
.rh-chart{border:1px solid var(--border);border-radius:var(--r);background:var(--surface-2);padding:10px 12px 8px;margin-bottom:10px}
.rh-ch{display:flex;align-items:baseline;gap:10px;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:4px}
.rh-row{position:relative;display:grid;grid-template-columns:34px minmax(0,1fr) 72px 86px;align-items:center;gap:10px;width:100%;min-height:26px;
  border:none;background:transparent;padding:0 4px;border-radius:var(--r-s);font:inherit;text-align:left}
.rh-row:hover,.rh-row.on{background:var(--surface)}
.rh-no{font-family:var(--font-mono);font-size:11.5px;color:var(--muted)}
.rh-track{height:10px;display:block}
.rh-track i{display:block;height:100%;background:var(--faint);border-radius:0 4px 4px 0}
.rh-row.on .rh-track i{background:var(--accent)}
.rh-row.bad .rh-track i{background:var(--ng)}
.rh-v{font-family:var(--font-mono);font-size:11.5px;text-align:right;color:var(--fg)}
.rh-st{display:inline-flex;align-items:center;gap:3px;font-size:11px;font-weight:600;color:var(--ok)}
.rh-st .i{width:11px;height:11px}
.rh-row.bad .rh-st{color:var(--ng)}
.rh-tip{display:none;position:absolute;z-index:5;left:44px;top:calc(100% + 2px);min-width:230px;padding:8px 10px;border:1px solid var(--border-strong);
  border-radius:var(--r);background:var(--surface);box-shadow:var(--shadow);grid-template-columns:1fr auto;gap:2px 14px;font-size:11.5px;color:var(--muted)}
.rh-tip em{grid-column:1/-1;font-style:normal;font-weight:600;color:var(--fg);margin-bottom:2px}
.rh-tip b{font-family:var(--font-mono);font-weight:500;color:var(--fg);text-align:right}
.rh-row:hover .rh-tip,.rh-row:focus-visible .rh-tip{display:grid}
.rh-tw{overflow-x:auto}
.rh-t tr[data-ps-rh]{cursor:pointer}
.rh-t tr[data-ps-rh]:hover td{background:var(--surface-2)}
.rh-t tr.sel td{background:var(--accent-weak)}
.ps-t th.num,.ps-t td.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.ps-t td.grow{color:var(--warn);font-weight:600}
.ps-t tr.tot td{font-weight:600}
.ps-t tr.aft td{color:var(--muted);border-bottom:none}
.st.warn{color:var(--warn)}
.rh-dh{display:flex;align-items:baseline;gap:10px;margin:6px 0 4px}
.rh-cols{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:18px;align-items:start}
.rh-err,.rh-warn{display:flex;gap:6px;align-items:flex-start;padding:7px 10px;border-radius:var(--r-s);margin:4px 0 8px;font-size:12px}
.rh-err{background:var(--ng-weak);color:var(--ng)}
.rh-warn{background:var(--warn-weak);color:var(--warn)}
.rh-err .i,.rh-warn .i{width:13px;height:13px;flex:none;margin-top:3px}
.rh-foot{font-size:11.5px;color:var(--faint)}
.rb{padding:2px 0 12px 28px;font-size:12.5px}
.rb-docs{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px;margin-bottom:8px}
.rb-doc{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);font:inherit;text-align:left}
.rb-doc:hover:not(:disabled){border-color:var(--accent)}
.rb-doc>.i{width:18px;height:18px;color:var(--accent);flex:none}
.rb-t{display:flex;flex-direction:column;min-width:0;flex:1}
.rb-t .aux{font-size:11px;color:var(--faint)}
.rb-n{font-size:11.5px;color:var(--muted);white-space:nowrap}
.rb-meta{font-size:11.5px;color:var(--faint)}
.rb-stale{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px;padding:7px 10px;border-radius:var(--r-s);background:var(--warn-weak);color:var(--warn);font-size:12px}
.rb-stale>.i{width:13px;height:13px;flex:none}
.rb-stale span{flex:1;min-width:200px}
@media (max-width:760px){.rh,.rb{padding-left:0}.rh-cols{grid-template-columns:1fr}.rh-row{grid-template-columns:30px minmax(0,1fr) 64px}.rh-st{display:none}}

.ps-ch{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.ps-ch b{font-size:13.5px}
.jira-b{font-size:11px;font-weight:600;padding:2px 8px;border-radius:999px;white-space:nowrap}
.jira-b.demo{background:var(--warn-weak);color:var(--warn);cursor:help}
.jira-b.real{background:var(--accent-weak);color:var(--accent-ink)}
.iss-bar{display:flex;gap:6px;align-items:center;margin-bottom:8px;flex-wrap:wrap}
.iss-list{display:flex;flex-direction:column}
.iss-row{display:flex;align-items:center;gap:8px;padding:7px 4px;border-top:1px solid var(--border);font-size:12.5px;cursor:pointer;min-width:0}
.iss-row:hover{background:var(--surface-2)}
.iss-row .iid{font-size:11.5px;color:var(--faint);flex:none}
.iss-row .it{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
.iss-row.done .it{color:var(--faint);text-decoration:line-through}
.ist{font-size:11px;font-weight:600;padding:1px 7px;border-radius:999px;background:var(--surface-3);color:var(--muted);flex:none}
.ist.doing{background:var(--accent-weak);color:var(--accent-ink)}
.ist.done{background:var(--ok-weak);color:var(--ok)}
.mem-list{display:flex;flex-direction:column}
.mem{border-top:1px solid var(--border)}
.mem-row{display:flex;align-items:center;gap:10px;padding:8px 4px;cursor:pointer;font-size:12.5px}
.mem-row:hover{background:var(--surface-2)}
.mem:not(.on) .mem-row>.av{opacity:.55}
.mem-main{display:flex;flex-direction:column;min-width:0;flex:1}
.mem-now{font-size:11.5px;color:var(--faint);display:flex;align-items:center;gap:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mem.on .mem-now{color:var(--ok)}
.mem-now .dot{width:6px;height:6px;border-radius:50%;background:var(--ok);flex:none}
.mem-stat{font-size:11.5px;color:var(--muted);white-space:nowrap}
.mem-stat .ng{color:var(--ng)}
.mem-x{display:flex;flex-direction:column;gap:6px;padding:2px 4px 12px 40px;font-size:12px}
.mem-x>div{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.mem-x .aux{min-width:72px}

.dlg:has(.iss-f),.dlg:has(#pullBox){width:min(820px,100%)}
.iss-g{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.iss-f .links{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:4px}
.iss-f .links select{width:auto}
.iss-x{margin-top:16px;border-top:1px solid var(--border);display:flex;flex-direction:column}
.ix-sec{padding:12px 0;border-bottom:1px solid var(--border)}
.ix-sec:last-child{border-bottom:none}
.ix-h{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700;flex-wrap:wrap}
.ix-h>.i{width:15px;height:15px;color:var(--accent)}
.ix-chat{margin-top:8px;max-height:340px;overflow:auto;font-size:12.5px}
.ix-chat .cm{max-width:100%}
.ix-cm{margin-top:8px;display:flex;flex-direction:column;gap:6px}
.ix-c pre{margin:3px 0 0;white-space:pre-wrap;font-size:12px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-s);padding:6px 8px;font-family:var(--font-ui)}
.ix-done{display:flex;align-items:center;gap:8px;margin-top:8px;flex-wrap:wrap}

/* ===================== プロジェクト進行（flow.html）: ページと縦のタイムライン ===================== */
.fl-page{height:100%;display:flex;flex-direction:column}
.fl-title{font-size:12.5px;font-weight:600;color:var(--fg);padding-left:12px;margin-left:2px;border-left:1px solid var(--border)}
a.tb-btn{text-decoration:none;color:inherit}
.fl-scroll{flex:1;overflow:auto;min-height:0}
.fl{max-width:1320px;margin:0 auto;padding:26px 28px 60px;display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:28px;align-items:start}
.fl-head{margin-bottom:22px}
.fl-head h1{font-size:20px;font-weight:700}
.fl-sub{margin:4px 0 0;font-size:13px;color:var(--muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.fl-sub b{color:var(--fg)}
.fl-sub .ok{color:var(--ok);display:inline-flex;align-items:center;gap:4px}
.fl-sub .warn{color:var(--warn);font-weight:600;display:inline-flex;align-items:center;gap:4px}
.fl-sub .i{width:14px;height:14px}
.fl-sub .sep{color:var(--faint)}
.fl-side{position:sticky;top:20px;display:flex;flex-direction:column;gap:14px}
.fl-card{border:1px solid var(--border);border-radius:var(--r-l);background:var(--surface);padding:12px 14px;min-width:0}

/* 縦のタイムライン: 各項目の左に線。上半分は「前から来た流れ」、下半分は「次へ行く流れ」。通過済みは実線、まだ先は点線 */
.tl{list-style:none;margin:0;padding:0;position:relative}
.tl-i{position:relative;padding:0 0 22px 52px;min-height:34px}
.tl-i::before,.tl-i::after{content:"";position:absolute;left:16px;width:0;border-left:2px dashed var(--border-strong)}
.tl-i::before{top:0;height:17px}
.tl-i::after{top:17px;bottom:0}
.tl-i:first-child::before,.tl-i.end::after{display:none}
.tl-i.in-pass::before,.tl-i.out-pass::after{border-left-style:solid;border-left-color:var(--ok)}
.tl-dot{position:absolute;left:0;top:0;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;z-index:1;
  font-size:13px;font-weight:700;background:var(--surface);border:2px solid var(--border-strong);color:var(--faint)}
.tl-dot .i{width:16px;height:16px}
.tl-i.ph.done .tl-dot{background:var(--ok);border-color:var(--ok);color:#fff}
.tl-i.ph.current .tl-dot{background:var(--accent);border-color:var(--accent);color:var(--on-accent);animation:tl-pulse 2s ease-out infinite}
.tl-i.ph.leftover .tl-dot{background:var(--warn-weak);border-color:var(--warn);color:var(--warn);font-size:16px}
.tl-dot.fin{width:26px;height:26px;left:4px;top:4px}
.tl-i.end.done .tl-dot{background:var(--ok);border-color:var(--ok);color:#fff}
@keyframes tl-pulse{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 45%,transparent)}70%{box-shadow:0 0 0 10px transparent}100%{box-shadow:0 0 0 0 transparent}}
@media (prefers-reduced-motion:reduce){.tl-i.ph.current .tl-dot{animation:none}}

.tl-c{min-width:0}
.tl-h{display:flex;align-items:center;gap:10px;width:100%;min-height:34px;padding:4px 10px;margin-left:-10px;border:none;border-radius:var(--r);background:transparent;text-align:left;font:inherit}
.tl-h:hover{background:var(--surface-2)}
.tl-n{display:flex;align-items:baseline;gap:8px;min-width:0}
.tl-n b{font-size:15px}
.tl-n .en{font-size:11.5px;color:var(--faint)}
.tl-i.ph.todo .tl-n b{color:var(--muted)}
.tl-b{font-size:11px;font-weight:700;padding:2px 8px;border-radius:999px;white-space:nowrap;display:inline-flex;align-items:center;gap:3px}
.tl-b .i{width:11px;height:11px}
.tl-b.cur{background:var(--accent);color:var(--on-accent)}
.tl-b.left{background:var(--warn-weak);color:var(--warn)}
.tl-b.ok{background:var(--ok-weak);color:var(--ok)}
.tl-cnt{font-family:var(--font-mono);font-size:12px;color:var(--muted);white-space:nowrap}
.tl-bar{width:90px;height:5px;border-radius:999px;background:var(--surface-3);overflow:hidden;flex:none}
.tl-bar i{display:block;height:100%;background:var(--accent)}
.tl-i.ph.done .tl-bar i{background:var(--ok)}
.tl-i.ph.leftover .tl-bar i{background:var(--warn)}
.tl-caret .i{width:14px;height:14px;color:var(--faint)}
.tl-peek{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--warn);margin:2px 0 0}
.tl-peek .i{width:13px;height:13px}
.tl-desc{margin:4px 0 0;font-size:12.5px;color:var(--muted)}
.tl-tasks{margin-top:8px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);padding:2px 12px}
.tl-c .psd-act{margin:10px 0 0}

/* 人の承認（◆）: 線の上の菱形 */
.tl-i.gate{padding-bottom:18px}
.tl-dia{position:absolute;left:9px;top:8px;width:18px;height:18px;transform:rotate(45deg);background:var(--surface);border:2px solid var(--border-strong);z-index:1;border-radius:3px}
.tl-i.gate.ok .tl-dia{background:var(--ok);border-color:var(--ok)}
.tl-i.gate.skip .tl-dia{background:var(--warn-weak);border-color:var(--warn)}
.tl-g{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-height:34px;font-size:12.5px}
.tl-gl{font-size:10.5px;font-weight:700;color:var(--muted);border:1px solid var(--border-strong);border-radius:var(--r-s);padding:0 5px}
.tl-gs{color:var(--faint)}
.tl-gs.ok{color:var(--ok)}
.tl-gs.skip{color:var(--warn);font-weight:600}

/* 戻りの流れ（差異 → 課題 → AI 修正 → 再確認） */
.tl-i.loop{padding-bottom:18px}
.tl-loop{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:7px 10px;border:1px dashed color-mix(in srgb,var(--accent) 45%,var(--border));border-radius:var(--r-l);background:color-mix(in srgb,var(--accent-weak) 55%,transparent);font-size:12px}
.lp-ic .i{width:15px;height:15px;color:var(--accent)}
.lp-s{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 9px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--muted);font:inherit;font-size:12px}
.lp-s b{color:var(--fg);font-family:var(--font-mono)}
.lp-s span{font-size:11px;color:var(--ng)}
button.lp-s:hover{border-color:var(--accent)}
.lp-s.hot{border-color:color-mix(in srgb,var(--ng) 50%,var(--border))}
.lp-s.hot b{color:var(--ng)}
.lp-a{color:var(--faint)}
.lp-back{font-size:11.5px;color:var(--accent-ink);font-weight:600;margin-left:2px}
.tl-end{min-height:34px;display:flex;align-items:center;font-size:13px;font-weight:600;color:var(--muted)}

/* 今やること */
.nx{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.nx-i{display:flex;gap:10px;padding:9px 0;border-top:1px solid var(--border)}
.nx-ph{flex:none;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:700;background:var(--accent-weak);color:var(--accent-ink);margin-top:1px}
.nx-ph .i{width:12px;height:12px}
.nx-i.left .nx-ph{background:var(--warn-weak);color:var(--warn)}
.nx-i.hot .nx-ph{background:var(--ng-weak);color:var(--ng)}
.nx-m{flex:1;min-width:0}
.nx-t{font-size:12.5px;font-weight:600;line-height:1.45}
.nx-tag{font-size:10.5px;font-weight:700;color:var(--warn);background:var(--warn-weak);border-radius:var(--r-s);padding:0 5px;margin-right:5px}
.nx-d{font-size:11.5px;color:var(--faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nx-f{display:flex;align-items:center;gap:6px;margin-top:5px}
.nx-who{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;color:var(--muted)}
.nx-none{font-size:11px;color:var(--faint);border:1px dashed var(--border-strong);border-radius:999px;padding:0 7px}
.nx-more{margin-top:6px;border:none;background:transparent;color:var(--accent-ink);font-size:12px;padding:4px 0}

@media (max-width:1100px){.fl{grid-template-columns:1fr}.fl-side{position:static}}
@media (max-width:640px){.fl{padding:18px 16px 40px}.tl-bar{display:none}.fl-title{display:none}}

/* 工作台 Summary から「プロジェクト進行」への入口 */
.flow-entry{display:flex;align-items:center;gap:12px;padding:11px 14px;margin:0 0 20px;border:1px solid color-mix(in srgb,var(--accent) 30%,var(--border));border-radius:var(--r);background:var(--accent-weak);color:var(--fg);text-decoration:none}
.flow-entry>.i{width:18px;height:18px;color:var(--accent)}
.flow-entry:hover{border-color:var(--accent)}
.fe-t{flex:1;min-width:0;display:flex;flex-direction:column}
.fe-t b{font-size:13px}
.fe-t span{font-size:12.5px;color:var(--muted)}
.fe-go{display:inline-flex;align-items:center;gap:4px;font-size:12.5px;font-weight:600;color:var(--accent-ink)}
.fe-go .i{width:14px;height:14px}

/* ===================== プロジェクトナレッジ（web/knowledge.js） ===================== */
.kb-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--warn);margin-right:4px;vertical-align:middle}
.kb-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:16px 0 10px}
.kb-q{flex:1;min-width:200px;height:32px;padding:0 10px;border:1px solid var(--border-strong);border-radius:var(--r);background:var(--surface);color:var(--fg);font:inherit}
.kb-q:focus{outline:none;border-color:var(--accent)}
.kb-mod{height:32px;border:1px solid var(--border-strong);border-radius:var(--r);background:var(--surface);color:var(--fg);font:inherit;padding:0 8px}
.kb-only{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--muted);cursor:pointer}
.kb-types{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.kb-tc{height:26px;padding:0 10px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--muted);font:inherit;font-size:12px}
.kb-tc.on{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.kb-list{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.kb-it{border:1px solid var(--border);border-radius:var(--r);background:var(--surface);padding:9px 12px;transition:box-shadow .3s}
.kb-it.pr{border-left:3px solid var(--warn)}
.kb-it.off{opacity:.6}
.kb-it.flash{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 40%,transparent)}
.kb-h{display:flex;align-items:center;gap:8px;cursor:pointer;min-width:0}
.kb-h .kid{font-size:11.5px;color:var(--faint);flex:none}
.kb-tt{font-size:13px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kb-ty{flex:none;font-size:10.5px;font-weight:700;padding:1px 7px;border-radius:var(--r-s);background:var(--surface-3);color:var(--muted)}
.kb-ty.t-rule{background:var(--accent-weak);color:var(--accent-ink)}
.kb-ty.t-batch,.kb-ty.t-interface{background:var(--ok-weak);color:var(--ok)}
.kb-ty.t-bug{background:var(--ng-weak);color:var(--ng)}
.kb-ty.t-data,.kb-ty.t-term{background:var(--warn-weak);color:var(--warn)}
.kb-st{flex:none;font-size:10.5px;font-weight:700;padding:1px 7px;border-radius:999px;white-space:nowrap}
.kb-st.ok{background:var(--ok-weak);color:var(--ok)}
.kb-st.pr{background:var(--warn-weak);color:var(--warn)}
/* 要再確認: 確認したあとに根拠のファイルが変わった */
.kb-st.rc{background:var(--crit-weak);color:var(--crit)}
.kb-only.rc{color:var(--crit)}
.kb-rc{display:flex;align-items:flex-start;gap:10px;padding:9px 12px;border:1px solid color-mix(in srgb,var(--crit) 35%,var(--border));border-radius:var(--r-s);background:var(--crit-weak)}
.kb-rc>.i{width:15px;height:15px;flex:none;color:var(--crit);margin-top:2px}
.kb-rc-t{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--muted)}
.kb-rc-t b{color:var(--fg);font-size:12.5px}
.kb-rc-f{display:flex;flex-wrap:wrap;gap:4px}
.kb-rc-f code,.cm-sug-r code{font-family:var(--font-mono);font-size:11px;background:var(--surface);border:1px solid var(--border);border-radius:4px;padding:0 4px}
.kb-caret .i{width:13px;height:13px;color:var(--faint)}
.kb-sum{font-size:12px;color:var(--muted);margin-top:3px;padding-left:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kb-b{margin-top:8px;display:flex;flex-direction:column;gap:8px;font-size:12.5px}
.kb-cr{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.kb-cr>div{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-s);padding:6px 8px}
.kb-cr .aux,.kb-ev .aux{display:block;font-size:11px;color:var(--faint)}
.kb-md{font-size:12.5px}
.kb-md p{margin:2px 0}
.kb-meta{display:flex;flex-wrap:wrap;gap:5px}
.kb-ev{font-size:12px;word-break:break-all}
.kb-hist{display:flex;flex-direction:column;font-size:11px;color:var(--faint)}
.kb-act{display:flex;gap:6px;align-items:center}
.kb-act .sp{flex:1}
.kb-wait{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);padding:8px 0}
.kb-f .kb-g2{display:grid;grid-template-columns:160px 1fr;gap:10px}
.kb-f .kb-rule{display:grid;grid-template-columns:140px 1fr 1fr;gap:10px}
.kb-f .kb-rule[hidden]{display:none}
.kb-tags{display:flex;gap:10px;align-items:flex-start}
.kb-tags>.aux{flex:none;width:64px;font-size:12px;color:var(--muted);padding-top:3px}
.kb-tags>div{display:flex;flex-wrap:wrap;gap:5px;max-height:120px;overflow:auto}
.kb-tg{height:24px;padding:0 9px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--muted);font:inherit;font-size:11.5px}
.kb-tg.on{background:var(--accent-weak);border-color:var(--accent);color:var(--accent-ink);font-weight:600}
.dlg:has(.kb-f){width:min(760px,100%)}
.kb-f [hidden]{display:none}
/* 会話: 参照したナレッジ・ナレッジに追加 */
a.kref{font-family:var(--font-mono);font-size:.92em;font-weight:600;color:var(--accent-ink);background:var(--accent-weak);border-radius:var(--r-s);padding:0 4px;text-decoration:none}
a.kref:hover{text-decoration:underline}
.cm-kadd{margin-left:8px;border:none;background:transparent;color:var(--accent-ink);font:inherit;font-size:11px;font-weight:600;padding:0;cursor:pointer;opacity:.75}
.cm-kadd:hover{opacity:1;text-decoration:underline}
/* 会話: この会話で新しく分かったこと（ナレッジに追加しますか？） */
.cm-sug{margin-top:8px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface-2);padding:10px 12px;display:flex;flex-direction:column;gap:8px;max-width:100%}
.cm-sug-h{display:flex;align-items:center;gap:7px;font-size:12.5px}
.cm-sug-h .i{width:14px;height:14px;color:var(--warn)}
.cm-sug-h span{color:var(--muted)}
.cm-sug-it{display:flex;flex-direction:column;gap:4px;padding:8px 10px;border:1px solid var(--border);border-radius:var(--r-s);background:var(--surface)}
.cm-sug-it.done{opacity:.75}
.cm-sug-t{display:flex;align-items:center;gap:7px;font-size:12.5px}
.cm-sug-b{font-size:12px;color:var(--muted)}
.cm-sug-b p,.cm-sug-b .li{margin:1px 0}
.cm-sug-r{font-size:11px;color:var(--faint);display:flex;flex-wrap:wrap;gap:4px;align-items:center}
.cm-sug-a{display:flex;align-items:center;gap:6px;margin-top:2px}
@media (max-width:640px){.kb-f .kb-g2,.kb-f .kb-rule,.kb-cr{grid-template-columns:1fr}}

/* ===================== プロジェクト百科（map.html / map.js） ===================== */
.mp-page{height:100%;display:flex;flex-direction:column}
.mp-search{width:min(300px,30vw);height:28px;margin-left:14px;padding:0 10px;border:1px solid var(--border-strong);border-radius:999px;background:var(--surface-2);color:var(--fg);font:inherit;font-size:12.5px}
.mp-search:focus{outline:none;border-color:var(--accent);background:var(--surface)}
.mp-body{flex:1;display:flex;min-height:0}
.mp-main{flex:1;display:flex;flex-direction:column;min-width:0;position:relative}
.mp-tools{flex:none;display:flex;align-items:center;gap:10px;padding:8px 14px;border-bottom:1px solid var(--border);background:var(--surface);min-height:40px}
.mp-tools[hidden]{display:none}
.mp-tools .aux{font-size:12px;color:var(--faint)}
.mp-tools .sp{flex:1}
.mp-canvas{flex:1;position:relative;overflow:hidden;min-height:0;
  background-color:var(--bg);background-image:radial-gradient(color-mix(in srgb,var(--border-strong) 70%,transparent) 1px,transparent 1px);background-size:22px 22px}
.mp-canvas[hidden]{display:none}
#mpSvg{width:100%;height:100%;display:block;cursor:grab;user-select:none}
#mpSvg.grab{cursor:grabbing}
.mp-zoom{position:absolute;left:14px;bottom:14px;display:flex;gap:6px;align-items:center}
.mp-zoom .icon-btn{background:var(--surface);font-size:15px;font-weight:600}
.mp-legend{pointer-events:none;position:absolute;right:14px;bottom:14px;display:flex;gap:12px;font-size:11.5px;color:var(--muted);background:color-mix(in srgb,var(--surface) 90%,transparent);border:1px solid var(--border);border-radius:var(--r);padding:5px 10px}
.mp-legend span,.mp-hint li{display:inline-flex;align-items:center;gap:5px}
.lg{display:inline-block;width:14px;height:10px;border-radius:3px;border:1.5px solid var(--border-strong);background:var(--surface)}
.lg.pr{border-style:dashed;border-color:var(--warn)}
.lg.rel{border-color:var(--ok);background:var(--ok-weak)}

/* 地図のノードと線 */
.mp-l{fill:none;stroke:var(--border-strong);stroke-width:1.4}
.mp-l.hot{stroke:var(--accent);stroke-width:2}
.mp-n{cursor:pointer}
.mp-n rect{fill:var(--surface);stroke:var(--border-strong);stroke-width:1;transition:opacity .15s}
.mp-n text{font-family:var(--font-ui);font-size:12.5px;font-weight:500;fill:var(--fg)}
.mp-n:hover rect{stroke:var(--accent)}
.mp-n.k-root rect{fill:var(--fg);stroke:var(--fg)}
.mp-n.k-root text{fill:var(--bg);font-weight:700}
.mp-n.k-branch rect{fill:var(--accent);stroke:var(--accent)}
.mp-n.k-branch text{fill:var(--on-accent);font-weight:700}
.mp-n.k-domain rect{fill:var(--accent-weak);stroke:color-mix(in srgb,var(--accent) 45%,var(--border))}
.mp-n.k-domain text{fill:var(--accent-ink);font-weight:600}
.mp-n.k-flow rect{stroke:var(--accent)}
.mp-n.k-flow text{font-weight:600}
.mp-n .mp-fi{fill:var(--accent)}
.mp-n.k-cat rect,.mp-n.k-group rect{fill:var(--surface-2)}
.mp-n.k-cat text{font-weight:600;fill:var(--muted)}
.mp-n.k-empty rect{fill:transparent;stroke-dasharray:3 3}
.mp-n.k-empty text{fill:var(--faint)}
.mp-n.pr rect{stroke:var(--warn);stroke-dasharray:4 3}
.mp-n.sel rect{stroke:var(--accent);stroke-width:2.5;stroke-dasharray:none}
.mp-n.rel rect{stroke:var(--ok);stroke-width:2;fill:var(--ok-weak)}
.mp-n.dim{opacity:.28}
.mp-cnt{font-family:var(--font-mono) !important;font-size:11px !important;fill:var(--faint) !important}
.mp-tg circle{fill:var(--surface);stroke:var(--border-strong)}
.mp-tg text{font-size:12px !important;font-weight:700 !important;fill:var(--muted) !important}
.mp-tg:hover circle{stroke:var(--accent)}

/* プロジェクトWiki: 共通 */
.mp-side{width:420px;flex:none;border-left:1px solid var(--border);background:var(--surface);overflow:auto;padding:14px 16px 30px;font-size:12.5px}
.mp-side[hidden]{display:none}
.mp-crumb{display:flex;align-items:center;gap:4px;flex-wrap:wrap;font-size:11.5px;color:var(--faint);margin-bottom:6px}
.mp-crumb button{border:none;background:transparent;color:var(--accent-ink);font:inherit;font-size:11.5px;padding:0}
.mp-crumb button:hover{text-decoration:underline}
.mp-sh{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.mp-sh .kid{font-size:11.5px;color:var(--faint)}
.mp-sh b{font-size:14px}
.mp-title{font-size:16px;font-weight:700;margin:4px 0 8px;line-height:1.4}
.mp-open{margin:0 0 12px}
.mp-h3{display:flex;align-items:center;gap:6px;font-size:12.5px;font-weight:700;margin:18px 0 8px;padding-top:12px;border-top:1px solid var(--border)}
.mp-h3 .i{width:14px;height:14px;color:var(--accent)}
.mp-rg{display:flex;flex-direction:column;gap:4px;margin-bottom:10px}
.mp-rg>.aux{font-size:11px;color:var(--faint);font-weight:600}
.mp-rg>div{display:flex;flex-wrap:wrap;gap:5px}
.mp-rg .chip{height:auto;min-height:22px;white-space:normal;text-align:left;text-decoration:none;font-weight:500}
.mp-kv{display:flex;gap:10px;padding:3px 0}
.mp-kv .aux{width:64px;flex:none;color:var(--faint)}
.mp-meta{font-size:11.5px;color:var(--faint);margin:6px 0}
.mp-intro{color:var(--muted);margin:0 0 10px}
.mp-side .kb-act{margin-top:8px;flex-wrap:wrap}
.mp-side .kb-md{max-height:340px;overflow:auto}
@media (max-width:1000px){.mp-side{width:340px}}
@media (max-width:760px){.mp-body{flex-direction:column}.mp-side{width:auto;border-left:none;border-top:1px solid var(--border);max-height:45vh}}
.chip.pr{background:transparent;border:1px dashed var(--warn);color:var(--warn)}
.mp-hint{margin:0 0 12px;padding-left:0;list-style:none;display:flex;flex-direction:column;gap:6px;color:var(--muted)}
.mp-hint .i{width:13px;height:13px;color:var(--accent)}
.mp-gen{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
.mp-acts{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
/* Wiki: クラウドの設定を取り込む（gcloud・Terraform） */
.dlg:has(.ci){width:min(860px,100%)}
.ci{display:flex;flex-direction:column;gap:12px}
.ci-lead{margin:0;font-size:13px;line-height:1.7}
.ci-cmds{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:4px;font-size:12px}
.ci-cmds li{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
.ci-cmds code{font-family:var(--font-mono);font-size:11.5px;background:var(--surface-3);border-radius:var(--r-s);padding:1px 6px;color:var(--fg)}
.ci-cmds span{color:var(--faint)}
.ci-drop{display:flex;align-items:center;justify-content:center;gap:8px;padding:16px;border:1.5px dashed var(--border-strong);border-radius:var(--r-l);background:var(--surface-2);color:var(--muted);font-size:13px;cursor:pointer}
.ci-drop:hover,.ci-drop.on{border-color:var(--accent);background:var(--accent-weak);color:var(--accent-ink)}
.ci-drop input{display:none}
.ci-drop span{font-size:12px;color:var(--faint)}
.ci-sum{display:flex;align-items:center;gap:8px;font-size:13px}
.ci-sum .aux{font-size:12px;color:var(--faint)}
.ci-cnt{margin:0;font-size:12.5px;color:var(--muted)}
.ci-tw{max-height:46vh;overflow:auto;border:1px solid var(--border);border-radius:var(--r)}
.ci-t{width:100%;border-collapse:collapse;font-size:12.5px}
.ci-t th{position:sticky;top:0;background:var(--surface-2);text-align:left;font-size:11px;color:var(--faint);font-weight:600;padding:6px 10px;border-bottom:1px solid var(--border);white-space:nowrap}
.ci.picked .ci-cmds{display:none}
.ci.picked .ci-drop{padding:10px}
.ci-t td{padding:7px 10px;border-bottom:1px solid var(--border);vertical-align:top}
.ci-t td:first-child,.ci-t td:nth-child(2){white-space:nowrap}
.ci-t tr.dup td{color:var(--faint)}
.ci-t tr.dup b{font-weight:500}
.ci-at{margin-top:2px;font-size:11.5px;color:var(--muted);line-height:1.5;word-break:break-all}
.ci-st{font-size:11px;font-weight:700;border-radius:999px;padding:1px 8px}
.ci-st.new{background:var(--ok-weak);color:var(--ok)}
.ci-st.dup{background:var(--surface-3);color:var(--faint)}
.ci-skip{margin:0;font-size:12px;color:var(--faint);line-height:1.6}
.ci .dlg-ft{gap:8px}
.mp-ask{display:flex;gap:6px;align-items:flex-end}
.mp-ask textarea{flex:1;resize:vertical;border:1px solid var(--border-strong);border-radius:var(--r);padding:6px 8px;background:var(--surface);color:var(--fg);font:inherit}
.mp-ans{margin-top:8px}
.mp-ans .cm{max-width:100%}

/* 業務フローのステップ図（記事の「流れ」） */
.fv-steps{display:flex;flex-wrap:wrap;align-items:stretch;row-gap:18px}
.fv-st{width:250px;border:1px solid var(--border);border-top:3px solid var(--accent);border-radius:var(--r);background:var(--surface);padding:10px 12px;display:flex;flex-direction:column;gap:6px}
.fv-st.k-screen{border-top-color:var(--accent)}
.fv-st.k-process{border-top-color:var(--muted)}
.fv-st.k-data{border-top-color:var(--ok)}
.fv-st.k-batch,.fv-st.k-external{border-top-color:var(--warn)}
.fv-st.k-report{border-top-color:var(--ng)}
.fv-sh{display:flex;align-items:center;gap:6px}
.fv-sh .no{width:22px;height:22px;flex:none;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:var(--on-accent);font-size:11.5px;font-weight:700}
.fv-sh b{flex:1;font-size:13px;line-height:1.35}
.fv-sh .icon-btn{width:24px;height:24px;border-color:transparent}
.fv-k{font-size:10.5px;font-weight:700;color:var(--muted);background:var(--surface-3);border-radius:var(--r-s);padding:0 5px;white-space:nowrap}
.fv-st p{margin:0;font-size:12px;color:var(--muted);flex:1}
.fv-refs{display:flex;flex-wrap:wrap;gap:4px}
.fv-refs .chip{height:auto;min-height:20px;white-space:normal;font-weight:500}
.chip .ck{font-size:9.5px;font-weight:700;opacity:.7;margin-right:3px}
.fv-arrow{width:36px;flex:none;display:grid;place-items:center;color:var(--accent)}
.fv-arrow .i{width:18px;height:18px}

/* ナレッジ一覧: 業務フローのステップ */
.kb-steps{margin:0;padding-left:20px;font-size:12px;color:var(--muted)}
.kb-steps li{margin:2px 0}
.kb-steps b{color:var(--fg)}
.kb-ty.t-domain,.kb-ty.t-flow{background:var(--accent);color:var(--on-accent)}
.kb-ty.t-dbobj,.kb-ty.t-config,.kb-ty.t-lib,.kb-ty.t-script{background:var(--surface-3);color:var(--fg)}

/* ===================== 会話の履歴（chat.js）・個人の質問の会話 ===================== */
.ch-own{margin-left:8px;font-size:10.5px;font-weight:700;color:var(--accent-ink);background:var(--accent-weak);border-radius:999px;padding:1px 8px}
.ch-own[hidden]{display:none}
.dlg:has(.th-tabs){width:min(860px,100%)}
.th-tabs{display:flex;gap:4px;margin-bottom:10px;border-bottom:1px solid var(--border)}
.th-tabs button{border:none;background:transparent;padding:6px 12px;font:inherit;font-size:12.5px;color:var(--muted);border-bottom:2px solid transparent;margin-bottom:-1px}
.th-tabs button.on{color:var(--accent-ink);border-bottom-color:var(--accent);font-weight:600}
.th-list{display:flex;flex-direction:column;gap:4px}
.th-it{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);padding:8px 10px;font:inherit;color:var(--fg)}
.th-it:hover{border-color:var(--accent)}
.th-w{flex:none;width:30px;display:grid;place-items:center}
.th-sh{font-size:10px;font-weight:700;color:var(--muted);background:var(--surface-3);border-radius:var(--r-s);padding:1px 5px}
.th-m{flex:1;min-width:0;display:flex;flex-direction:column}
.th-m b{font-size:12.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.th-s{font-size:11.5px;color:var(--faint)}
.th-tag{flex:none;font-size:10.5px;font-weight:700;color:var(--muted);background:var(--surface-3);border-radius:999px;padding:1px 8px}
.th-tag.live{background:var(--ok-weak);color:var(--ok)}
.th-hd{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.th-hd .sp{flex:1}
.th-msgs{max-height:60vh;overflow:auto;border:1px solid var(--border);border-radius:var(--r);padding:8px;background:var(--surface-2)}
.mp-ctx{display:flex;align-items:flex-start;gap:5px;font-size:11.5px;color:var(--muted);background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-s);padding:5px 8px;margin-bottom:8px}
.mp-ctx .i{width:13px;height:13px;flex:none;margin-top:2px;color:var(--accent)}
.mp-ans{max-height:420px;overflow:auto;margin-bottom:8px}

/* ===================== データの変更履歴（history.js） ===================== */
.dlg:has(.hx),.dlg:has(.hp){width:min(1000px,100%)}
.hx-cols{display:grid;grid-template-columns:300px minmax(0,1fr);gap:14px;min-height:300px}
.hx-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;max-height:62vh;overflow:auto}
.hx-c{width:100%;text-align:left;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);padding:6px 9px;font:inherit;color:var(--fg);display:flex;flex-direction:column;gap:2px}
.hx-c b{font-size:12px;font-weight:600;line-height:1.35}
.hx-c span{font-size:11px;color:var(--faint)}
.hx-c.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.hx-tag,.hp-tag{display:flex;width:fit-content;align-items:center;gap:4px;font-size:11px;font-weight:700;color:var(--ok)}
.hx-tag .i,.hp-tag .i{width:12px;height:12px}
.hx-view{min-width:0;max-height:62vh;overflow:auto}
.hx-vh{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:4px}
.hx-vh b{font-size:13px}
.hx-vh .btn{margin-left:auto}
.hf{display:grid;grid-template-columns:90px minmax(0,1fr);gap:8px;padding:6px 0;border-bottom:1px solid var(--border);font-size:12.5px}
.hf-k{color:var(--faint);font-weight:600}
.hf.hf-it{grid-template-columns:minmax(0,1fr);gap:3px}
.hf-it>div:first-child{display:flex;align-items:center;gap:6px}
.hf-it b{font-weight:600}
.hf-it .hf-v{line-height:1.7}
.hf-names{margin:4px 0 0;padding-left:18px;font-size:12.5px;line-height:1.7}
.hf-names .aux{margin-left:8px}
.hf-v del{background:var(--crit-weak);color:var(--crit);text-decoration:line-through;border-radius:3px;padding:0 3px}
.hf-v ins{background:var(--ok-weak);color:var(--ok);text-decoration:none;border-radius:3px;padding:0 3px}
.hd{font-family:var(--font-mono);font-size:11.5px;line-height:1.55;border:1px solid var(--border);border-radius:var(--r-s);background:var(--surface-2);overflow:auto;max-height:50vh}
.hd-l{display:flex;gap:6px;padding:0 8px;white-space:pre-wrap;word-break:break-all}
.hd-l span{flex:none;width:10px;color:var(--faint)}
.hd-l.add{background:var(--ok-weak);color:var(--ok)}
.hd-l.del{background:var(--crit-weak);color:var(--crit)}
.hd-skip{padding:2px 8px;color:var(--faint);font-family:var(--font-ui);font-size:11px;background:var(--surface-3)}
.hd-gone{display:flex;align-items:center;gap:5px;color:var(--crit);font-weight:600}
.hp-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.hp-bar .sp{flex:1}
.hp{max-height:62vh;overflow:auto;margin-top:8px}
.hp-list{list-style:none;margin:0;padding:0;border-left:2px solid var(--border-strong);margin-left:6px}
.hp-list>li{position:relative;padding:4px 0 6px 16px}
.hp-list>li::before{content:"";position:absolute;left:-6px;top:11px;width:10px;height:10px;border-radius:50%;background:var(--surface);border:2px solid var(--border-strong)}
.hp-list>li.tagged::before{background:var(--ok);border-color:var(--ok)}
.hp-tag{flex-wrap:wrap;margin-bottom:3px;font-size:12px}
.hp-tag span{font-weight:400;color:var(--muted)}
.hp-list summary{cursor:pointer;display:flex;gap:10px;align-items:baseline;flex-wrap:wrap;list-style:none}
.hp-m{font-size:12.5px;font-weight:600}
.hp-s{font-size:11.5px;color:var(--faint)}
.hp-files{list-style:none;margin:6px 0 4px;padding:0;display:flex;flex-direction:column;gap:3px;font-size:12px}
.hp-files li{display:flex;align-items:center;gap:8px}
.hp-st{font-size:10.5px;font-weight:700;border-radius:var(--r-s);padding:0 6px;background:var(--surface-3);color:var(--muted)}
.hp-st.s-A{background:var(--ok-weak);color:var(--ok)}
.hp-st.s-D{background:var(--crit-weak);color:var(--crit)}
.hp-h{margin:10px 0 4px;font-size:12.5px}
button.lnk{border:none;background:transparent;color:var(--accent-ink);font:inherit;padding:0;text-align:left;cursor:pointer}
button.lnk:hover{text-decoration:underline}
@media (max-width:760px){.hx-cols{grid-template-columns:1fr}}

/* ===================== 外枠（shell.js）: 全ページ共通の左ナビ ===================== */
.app-shell{height:100%;display:flex;min-height:0;background:var(--surface)}
.app-main{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0;background:var(--surface)}
.sh{width:232px;flex:none;display:flex;flex-direction:column;background:var(--panel);border-right:1px solid var(--border);padding:12px 10px 10px;min-height:0}
.sh-top{padding:2px 0 10px}
.sh-proj{display:flex;align-items:center;gap:9px;width:100%;padding:7px 8px;border:none;border-radius:var(--r);background:transparent;font:inherit;font-weight:600;font-size:13.5px;color:var(--fg);text-align:left}
.sh-proj:hover{background:var(--surface-3)}
.sh-proj .mark,.mark.sm{width:24px;height:24px;flex:none;border-radius:7px;background:var(--fg);color:var(--bg);display:grid;place-items:center;font-size:12px;font-weight:700}
.mark.sm{width:20px;height:20px;font-size:11px;border-radius:6px}
.sh-pn{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sh-proj .i{width:14px;height:14px;color:var(--faint);flex:none}
.sh-nav{flex:1;overflow:auto;display:flex;flex-direction:column;gap:1px;margin:0 -2px;padding:0 2px}
.sh-grp{font-size:11.5px;font-weight:600;color:var(--faint);padding:16px 10px 5px}
.sh-it{display:flex;align-items:center;gap:10px;height:34px;padding:0 10px;border-radius:var(--r);color:var(--muted);text-decoration:none;font-size:13.5px;border:1px solid transparent}
.sh-it .i{width:16px;height:16px;flex:none}
.sh-it:hover{background:var(--surface-3);color:var(--fg)}
.sh-it.on{background:var(--surface);color:var(--fg);border-color:var(--border);box-shadow:0 1px 2px rgba(29,28,26,.05);font-weight:500}
.sh-l{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sh-ext .i{width:12px;height:12px;color:var(--faint)}
.sh-cnt{font-size:11px;font-weight:700;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--fg);color:var(--bg);display:grid;place-items:center}
.sh-sub{font-size:10.5px;font-weight:700;width:18px;height:18px;border-radius:50%;border:1.5px solid var(--border-strong);display:grid;place-items:center;color:var(--muted)}
.sh-pres{display:inline-flex;align-items:center}
.sh-pres .av{width:18px;height:18px;font-size:8.5px;margin-left:-5px;box-shadow:0 0 0 1.5px var(--panel)}
.sh-pres i{font-size:10px;font-style:normal;color:var(--faint);margin-left:2px}
.sh-foot{display:flex;align-items:center;gap:6px;padding:10px 4px 0;border-top:1px solid var(--border);margin-top:8px}
.sh-foot .sp{flex:1}
.sh-me{font-size:12.5px;font-weight:500;color:var(--fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:90px}
.sh-ib{width:28px;height:28px;border:none;border-radius:var(--r);background:transparent;display:grid;place-items:center;color:var(--muted)}
.sh-ib:hover{background:var(--surface-3);color:var(--fg)}
.sh-ib .i{width:15px;height:15px}
/* アイコンだけの細い表示 */
.sh.rail{width:56px;padding:12px 8px 10px}
.sh.rail .sh-pn,.sh.rail .sh-proj>.i,.sh.rail .sh-l,.sh.rail .sh-ext,.sh.rail .sh-grp,.sh.rail .sh-me,.sh.rail .sh-pres,.sh.rail .sh-sub,.sh.rail [data-sh=theme],.sh.rail .sh-foot .sp{display:none}
.sh.rail .sh-proj{padding:6px;justify-content:center}
.sh.rail .sh-it{justify-content:center;padding:0;position:relative}
.sh.rail .sh-cnt{position:absolute;top:2px;right:2px;min-width:14px;height:14px;font-size:9px}
.sh.rail .sh-nav{gap:3px}
.sh.rail .sh-foot{flex-direction:column;gap:8px}
.sh-menu{position:fixed;z-index:80;width:280px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);box-shadow:var(--shadow);padding:6px}
.sh-mh{font-size:11.5px;font-weight:600;color:var(--faint);padding:6px 8px 4px}
.sh-ml{max-height:320px;overflow:auto;border-bottom:1px solid var(--border);margin-bottom:4px;padding-bottom:4px}
.sh-mi{display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:var(--r);color:var(--fg);text-decoration:none;font-size:13px}
.sh-mi:hover{background:var(--surface-3)}
.sh-mi .i{width:14px;height:14px;color:var(--muted)}
.sh-mt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sh-mi.on .sh-mt{font-weight:600}
/* ページ上部の帯（重要なお知らせ） */
.pg-banner{flex:none;display:flex;align-items:center;gap:10px;padding:10px 18px;background:var(--banner);color:var(--banner-ink);font-size:13.5px;border-bottom:1px solid color-mix(in srgb,var(--banner-ink) 18%,transparent)}
.pg-banner .i{width:16px;height:16px;flex:none}
.pg-banner b{font-weight:700}
.pg-banner .sp{flex:1}
.pg-banner .btn{background:var(--fg);color:var(--bg);border-color:var(--fg)}
/* AI の返答の「次の一手」 */
a.go-link{display:inline-flex;align-items:center;gap:4px;margin:2px 4px 2px 0;padding:3px 10px;border:1px solid var(--border-strong);border-radius:999px;background:var(--surface);color:var(--fg);font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap}
a.go-link:hover{border-color:var(--fg)}
a.go-link span{color:var(--faint);font-weight:400}

/* ===================== ホーム（home.html / home.js） ===================== */
.hm-col{width:300px;flex:none;border-right:1px solid var(--border);display:flex;flex-direction:column;min-height:0;background:var(--surface)}
.hm-ch{display:flex;align-items:center;gap:8px;height:52px;padding:0 16px;border-bottom:1px solid var(--border);font-size:13.5px;font-weight:600}
.hm-ch .sp{flex:1}
.hm-tg{display:inline-flex;border:1px solid var(--border);border-radius:999px;padding:2px}
.hm-tg button{border:none;background:transparent;font:inherit;font-size:11.5px;padding:2px 9px;border-radius:999px;color:var(--muted)}
.hm-tg button.on{background:var(--fg);color:var(--bg)}
.hm-acts{padding:10px 8px 4px;display:flex;flex-direction:column;gap:1px}
.hm-act{display:flex;align-items:center;gap:10px;height:36px;padding:0 10px;border:none;border-radius:var(--r);background:transparent;font:inherit;font-size:13px;color:var(--fg);text-align:left}
.hm-act:hover,.hm-act.on{background:var(--surface-3)}
.hm-act .i{width:16px;height:16px;color:var(--muted)}
.hm-list{flex:1;overflow:auto;padding:4px 8px 16px}
.hm-day{font-size:11px;font-weight:600;letter-spacing:.08em;color:var(--faint);padding:14px 10px 6px}
.hm-th{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;border:none;border-radius:var(--r);background:transparent;font:inherit;font-size:12.5px;color:var(--fg);text-align:left}
.hm-th:hover,.hm-th.on{background:var(--surface-3)}
.hm-th .t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hm-th .k{flex:none;font-size:10.5px;color:var(--faint)}
.hm-th .dot{width:7px;height:7px;border-radius:50%;background:var(--ok);flex:none}
.hm-th .dot.run{animation:hm-blink 1.2s ease-in-out infinite}
@keyframes hm-blink{50%{opacity:.25}}
.hm-main{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0}
.hm-scroll{flex:1;overflow:auto;min-height:0}
.hm-wrap{max-width:820px;margin:0 auto;padding:72px 32px 80px}
.hm-hello{font-family:var(--font-display);font-weight:500;font-size:34px;letter-spacing:.01em;line-height:1.3;margin:0}
.hm-stats{margin:10px 0 0;font-size:15px;color:var(--faint)}
.hm-stats b{color:var(--fg);font-weight:600}
.hm-ask{margin:28px 0 0;display:flex;align-items:center;gap:12px;padding:10px 10px 10px 16px;border:1px solid var(--border);border-radius:14px;background:var(--surface);box-shadow:0 1px 2px rgba(29,28,26,.04),0 4px 14px rgba(29,28,26,.05)}
.hm-ask:focus-within{border-color:var(--border-strong)}
.hm-ask .ai{width:26px;height:26px;flex:none;border-radius:8px;background:var(--fg);color:var(--bg);display:grid;place-items:center;font-size:12px;font-weight:700}
.hm-ask textarea{flex:1;border:none;outline:none;resize:none;background:transparent;color:var(--fg);font:inherit;font-size:15px;line-height:1.5;padding:6px 0;max-height:200px}
.hm-ask textarea::placeholder{color:var(--faint)}
.hm-kbd{font-size:11.5px;color:var(--faint);white-space:nowrap}
.hm-send{width:36px;height:36px;flex:none;border-radius:50%;border:none;background:var(--fg);color:var(--bg);display:grid;place-items:center}
.hm-send .i{width:16px;height:16px}
.hm-send:disabled{opacity:.35}
.hm-sec{margin:48px 0 14px;font-size:12px;font-weight:600;letter-spacing:.12em;color:var(--faint)}
.hm-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.hm-card{position:relative;display:flex;flex-direction:column;gap:6px;min-height:178px;padding:22px 22px 20px;border:1px solid var(--border);border-radius:var(--r-l);background:linear-gradient(180deg,var(--tint,var(--surface-2)) 0%,var(--surface) 46%);text-align:left;font:inherit;color:var(--fg);cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s}
.hm-card:hover{border-color:var(--border-strong);box-shadow:var(--shadow);transform:translateY(-1px)}
.hm-card .px{width:30px;height:30px;margin-bottom:14px;image-rendering:pixelated}
.hm-card b{font-size:15px;font-weight:600}
.hm-card p{margin:0;font-size:13px;line-height:1.6;color:var(--muted)}
.hm-card .hint{margin-top:auto;padding-top:10px;font-size:11.5px;font-weight:600;color:var(--faint)}
.hm-card .hint.hot{color:var(--ng)}
:root[data-theme="dark"] .hm-card{background:linear-gradient(180deg,color-mix(in srgb,var(--tint,var(--surface-2)) 14%,var(--surface)) 0%,var(--surface) 50%)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .hm-card{background:linear-gradient(180deg,color-mix(in srgb,var(--tint,var(--surface-2)) 14%,var(--surface)) 0%,var(--surface) 50%)}}
/* ホームの会話 */
.hm-chat{display:flex;flex-direction:column;gap:14px}
.hm-chat-h{display:flex;align-items:center;gap:10px}
.hm-chat-h .sp{flex:1}
.hm-chat-t{font-family:var(--font-display);font-size:22px;font-weight:500;margin:6px 0 0}
.hm-msgs .cm{max-width:100%}
.hm-note{font-size:12px;color:var(--faint)}
/* 会話の再利用（チームの会話に近い質問があります） */
.hm-reuse{margin-left:6px;color:var(--faint);text-decoration:none;border-bottom:1px dotted var(--border-strong);white-space:nowrap}
.hm-reuse:hover{color:var(--fg)}
.ru-box{margin-top:22px}
.ru-box[hidden]{display:none}
.ru-box+.hm-ask{margin-top:10px}
.ru-box.dock{margin:0;padding:8px 12px 0;border-top:1px solid var(--border);background:var(--surface)}
.ru-card{border:1px solid var(--border-strong);border-radius:var(--r-l);background:var(--surface);padding:12px 14px;display:flex;flex-direction:column;gap:6px;box-shadow:0 1px 2px rgba(29,28,26,.04)}
.ru-h{display:flex;align-items:center;gap:8px;font-size:13px}
.ru-h .i{width:15px;height:15px;color:var(--link)}
.ru-h .sp{flex:1}
.ru-x{border:none;background:transparent;color:var(--faint);padding:2px;display:grid;place-items:center;border-radius:var(--r-s)}
.ru-x:hover{background:var(--surface-3);color:var(--fg)}
.ru-x .i{width:13px;height:13px}
.ru-q{display:flex;flex-direction:column;gap:2px}
.ru-who{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--faint)}
.ru-who b{color:var(--muted);font-weight:600}
.ru-qt{font-size:13.5px;font-weight:600}
.ru-a{margin:0;font-size:12.5px;line-height:1.6;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ru-f{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:2px}
.ru-f .aux{font-size:11.5px;color:var(--faint)}
.ru-view{display:flex;flex-direction:column;gap:10px}
.ru-chip{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:var(--ok-weak);color:var(--ok);font-size:12px;font-weight:700}
.ru-chip .i{width:13px;height:13px}
.ru-src{margin:0;font-size:12px;color:var(--faint);line-height:1.6}
.ru-msgs .cm{max-width:100%}
.ru-dlg .ru-msgs{max-height:58vh;overflow:auto;border:1px solid var(--border);border-radius:var(--r);padding:8px;background:var(--surface-2)}
.ru-dlg .dlg-ft{gap:8px;margin-top:12px}
.ru-th .th-hd{gap:8px}
/* 会話の分析（usage.html） */
.us{max-width:1180px;margin:0 auto;padding:26px 28px 60px}
.us-days{display:inline-flex;border:1px solid var(--border);border-radius:999px;padding:2px}
.us-days button{border:none;background:transparent;font:inherit;font-size:12px;padding:3px 11px;border-radius:999px;color:var(--muted)}
.us-days button.on{background:var(--fg);color:var(--bg)}
.us-kpis{margin-top:4px;row-gap:12px}
.us-kpis .n{font-variant-numeric:normal}
.us-kpis .aux{font-size:11.5px;color:var(--faint)}
.us-hints{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.us-hint{border:1px solid var(--border);border-radius:var(--r-l);padding:12px 14px;background:var(--surface);display:flex;flex-direction:column;gap:6px}
.us-hint p{margin:0;font-size:12.5px;line-height:1.65;color:var(--muted)}
.us-hh{display:flex;align-items:center;gap:8px;font-size:13.5px}
.us-hh .sp{flex:1}
.us-hh>.i{width:16px;height:16px;color:var(--faint);flex:none}
.us-hint.act .us-hh>.i{color:var(--link)}
.us-hint.warn .us-hh>.i{color:var(--warn)}
.us-hint.ok .us-hh>.i{color:var(--ok)}
.us-hl{list-style:none;margin:2px 0 0;padding:0;display:flex;flex-direction:column;gap:2px}
.us-hl li{display:flex;align-items:center;gap:8px;padding:5px 0;border-top:1px solid var(--border)}
.us-hq{flex:1;min-width:0;display:flex;flex-direction:column;font-size:12.5px}
.us-hq b{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.us-hq .aux{font-size:11px;color:var(--faint)}
.us-ha{flex:none;display:flex;gap:4px}
.us-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.us-bd{border:1px solid var(--border);border-radius:var(--r-l);padding:10px 14px 8px;background:var(--surface)}
.us-bdh{font-size:12.5px;font-weight:700;margin-bottom:4px}
.us-mt{width:100%;border-collapse:collapse;font-size:12.5px}
.us-mt th{text-align:left;font-size:11px;font-weight:600;color:var(--faint);padding:4px 6px;border-bottom:1px solid var(--border)}
.us-mt td{padding:6px;border-bottom:1px solid var(--border);vertical-align:middle}
.us-mt tr:last-child td{border-bottom:none}
.us-mt .num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.us-mt td.nm{display:flex;align-items:center;gap:6px;min-width:0}
.us-mt td.nm span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}
.us-mt .bar{width:32%}
.us-track{display:block;height:8px;border-radius:999px;background:var(--surface-3)}
.us-track i{display:block;height:8px;border-radius:0 4px 4px 0;background:var(--link)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.us-cq{max-width:340px}
.us-cq b{font-weight:500;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.us-cq .chip{margin:3px 4px 0 0}
.us-where{font-size:12px;color:var(--muted)}
.us-who{white-space:nowrap}
.us-who .av{vertical-align:middle;margin-right:4px}
.us-all{margin-top:22px}
.us-all summary{cursor:pointer;font-size:13px;font-weight:600;margin-bottom:10px}
@media (max-width:900px){.us-hints,.us-grid{grid-template-columns:minmax(0,1fr)}.us{padding:20px 16px 48px}.us-bd{overflow-x:auto}.us-mt td.nm span{max-width:110px}}
@media (max-width:1180px){.hm-col{display:none}}
@media (max-width:900px){.hm-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.sh:not(.rail){width:200px}}
@media (max-width:640px){.hm-cards{grid-template-columns:1fr}.hm-wrap{padding:40px 16px 60px}.sh{display:none}}

/* ===================== 外枠の中のページ（見出し・既存部品の調整） ===================== */
.pg-head{flex:none;display:flex;align-items:center;gap:10px;height:52px;padding:0 20px;border-bottom:1px solid var(--border);background:var(--surface)}
.pg-head .sp{flex:1}
.pg-t{font-size:14px;font-weight:600;color:var(--fg);white-space:nowrap}
.app-main.ide{height:auto;flex:1}
.app-main .titlebar{height:52px;padding:0 16px 0 20px;background:var(--surface)}
.app-main .titlebar .crumb{margin-left:0}
.app-main > .cmp{flex:1;min-height:0;height:auto}
.cmp-bar .pg-t{margin-right:6px}
.fl-page .fl-scroll{background:var(--surface)}
.fl-head h1,.vh-title,.mp-title,.fv-t h2{font-family:var(--font-display);font-weight:600;letter-spacing:.01em}
.fl-head h1{font-size:28px}
.mp-page .mp-search{margin-left:8px}
.side{background:var(--surface)}
.btn{border-radius:var(--r)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.dlg{border-radius:14px}
.toast{border-radius:var(--r-l)}
.tb-phase{background:var(--surface-3);border-color:var(--border);color:var(--fg)}
.tb-phase .pc-dot{background:var(--ok)}
a.btn,a.tb-btn,a.sh-it,a.sh-mi{text-decoration:none}

/* ===================== AI の入力欄（全ページ共通の形）と「AI に頼む」 ===================== */
.ask{display:flex;align-items:flex-end;gap:10px;padding:8px 8px 8px 12px;border:1px solid var(--border);border-radius:14px;background:var(--surface);
  box-shadow:0 1px 2px rgba(29,28,26,.04),0 4px 14px rgba(29,28,26,.05)}
.ask:focus-within{border-color:var(--border-strong)}
.ask textarea,.ask input{flex:1;min-width:0;border:none;outline:none;background:transparent;color:var(--fg);font:inherit;font-size:14px;line-height:1.5;padding:5px 0;resize:none}
.ask input{height:34px;padding:0}
.ai-badge{width:24px;height:24px;flex:none;border-radius:7px;background:var(--fg);color:var(--bg);display:grid;place-items:center;font-size:11px;font-weight:700;margin-bottom:5px}
.ask-send{width:34px;height:34px;flex:none;border-radius:50%;border:none;background:var(--fg);color:var(--bg);display:grid;place-items:center;cursor:pointer}
.ask-send .i{width:16px;height:16px}
.ask-send:disabled{opacity:.3;cursor:default}
.ask-send.stop{background:var(--crit);color:#fff}
.chat-bar{padding:10px 12px;border-top:1px solid var(--border)}
.chat-bar .ask{flex:1}
.chat-bar .ask input{border:none !important;box-shadow:none !important}
.mp-ask{align-items:flex-end}
.mp-ask textarea{border:none !important;padding:5px 0 !important;background:transparent !important}
/* 左ナビの「AI に頼む」 */
.sh-ai{display:flex;align-items:center;gap:9px;width:100%;margin-top:8px;height:36px;padding:0 10px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);
  font:inherit;font-size:13px;color:var(--fg);text-align:left;box-shadow:0 1px 2px rgba(29,28,26,.04)}
.sh-ai:hover{border-color:var(--border-strong)}
.sh-ai .i{width:15px;height:15px;color:var(--fg)}
.sh-ai kbd{margin-left:auto;font-family:var(--font-ui);font-size:11px;color:var(--faint);border:1px solid var(--border);border-radius:5px;padding:0 5px;background:var(--surface-2)}
.sh.rail .sh-ai{justify-content:center;padding:0}
.sh.rail .sh-ai kbd{display:none}
/* 右から開く AI の会話 */
.ai-drawer{position:fixed;top:10px;right:10px;bottom:10px;width:min(460px,calc(100vw - 20px));z-index:60;display:flex;flex-direction:column;background:var(--surface);
  border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow),0 20px 60px rgba(29,28,26,.18);overflow:hidden}
.ai-drawer[hidden]{display:none}
.ad-h{display:flex;align-items:center;gap:8px;height:52px;padding:0 10px 0 14px;border-bottom:1px solid var(--border)}
.ad-h b{font-size:14px}
.ad-h .aux{font-size:12px;color:var(--faint)}
.ad-h .sp{flex:1}
.ad-h .ai-badge{margin:0}
.ad-where{display:flex;align-items:flex-start;gap:6px;padding:8px 14px;font-size:12px;color:var(--muted);background:var(--surface-2);border-bottom:1px solid var(--border)}
.ad-where .i{width:13px;height:13px;flex:none;margin-top:2px}
.ad-msgs{flex:1;overflow:auto;padding:12px 14px}
.ad-msgs .cm{max-width:100%}
.ad-hello b{font-family:var(--font-display);font-size:18px;font-weight:600}
.ad-hello p{color:var(--muted);font-size:13px}
.ad-ask{margin:0 12px 12px}

/* ===================== プロジェクトWiki: 記事（Wikipedia のような 1 ページ） ===================== */
.mp-article{flex:1;overflow:auto;background:var(--bg);min-height:0}
.mp-article[hidden]{display:none}
.wk-top{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:12px;padding:8px 22px;border-bottom:1px solid var(--border);background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(6px)}
.wk-top .sp{flex:1}
.wk-crumb{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px;color:var(--faint)}
.wk-crumb a{color:var(--link);text-decoration:none}
.wk-crumb a:hover{text-decoration:underline}
.wk{max-width:1180px;margin:0 auto;padding:22px 28px 60px}
.wk-h{padding-bottom:12px;border-bottom:1px solid var(--border-strong);margin-bottom:16px}
.wk-kind{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--faint)}
.wk-h h1{font-family:var(--font-display);font-size:30px;font-weight:600;line-height:1.3;margin:8px 0 0;letter-spacing:.01em}
.wk-notice{display:flex;align-items:center;gap:12px;padding:10px 14px;margin:0 0 18px;border:1px solid color-mix(in srgb,var(--warn) 40%,var(--border));border-left:4px solid var(--warn);border-radius:var(--r);background:var(--warn-weak);font-size:13px;line-height:1.6}
.wk-notice>.i{width:18px;height:18px;flex:none;color:var(--warn)}
.wk-notice>div{flex:1}
.wk-cols{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:32px;align-items:start}
.wk-main{font-size:14.5px;line-height:1.85;min-width:0}
.wk-lead>p{margin:0 0 12px}
.wk-main code{font-family:var(--font-mono);font-size:12.5px;background:var(--surface-3);padding:1px 5px;border-radius:var(--r-s)}
.wk-body.md{font-size:14.5px;line-height:1.85}
.wk-body.md p,.wk-body.md li{max-width:none}
.wk-cr{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0 0 14px}
.wk-cr>div{border:1px solid var(--border);border-radius:var(--r);background:var(--surface);padding:12px 14px}
.wk-cr span{display:block;font-size:11.5px;font-weight:700;color:var(--faint);margin-bottom:4px}
.wk-cr p{margin:0}
.wk-toc{display:inline-block;min-width:240px;margin:6px 0 10px;padding:10px 18px 10px 14px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface-2);font-size:13px;line-height:1.7}
.wk-toc b{display:block;font-size:12.5px;margin-bottom:2px}
.wk-toc ol{margin:0;padding-left:20px}
.wk-toc a{color:var(--link);text-decoration:none}
.wk-toc a:hover{text-decoration:underline}
.wk-sec{margin-top:26px;scroll-margin-top:60px}
.wk-sec>h2{font-family:var(--font-display);font-size:21px;font-weight:600;margin:0 0 12px;padding-bottom:6px;border-bottom:1px solid var(--border)}
.wk-list{list-style:none;margin:0 0 10px;padding:0;display:flex;flex-direction:column;gap:2px}
.wk-list li{display:flex;align-items:baseline;gap:8px;font-size:13.5px;line-height:1.6;break-inside:avoid}
.wk-list a{color:var(--link);text-decoration:none}
.wk-list a:hover{text-decoration:underline}
.wk-list a .mono{font-size:11.5px;color:var(--faint);margin-right:6px}
.wk-n{font-family:var(--font-mono);font-size:11px;color:var(--faint)}
.wk-pr{font-size:10.5px;font-weight:700;color:var(--warn);border:1px dashed var(--warn);border-radius:999px;padding:0 6px;white-space:nowrap}
.wk-cols2{display:block;columns:2 260px;column-gap:28px}
.wk-cols2 li{margin-bottom:2px}
.wk-rgs{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:6px 28px}
.wk-rg h3{display:flex;align-items:baseline;gap:6px;font-size:12.5px;font-weight:700;color:var(--muted);margin:6px 0 4px}
.wk-rg h3 span{font-family:var(--font-mono);font-size:11px;color:var(--faint);font-weight:500}
.wk-info{position:sticky;top:62px;border:1px solid var(--border);border-radius:var(--r-l);background:var(--surface);overflow:hidden;font-size:12.5px}
.wk-ib-h{padding:9px 14px;font-weight:700;font-size:13px;text-align:center;background:var(--surface-3);border-bottom:1px solid var(--border)}
.wk-ib-h.t-flow,.wk-ib-h.t-domain{background:var(--accent);color:var(--on-accent)}
.wk-info table{width:100%;border-collapse:collapse}
.wk-info th,.wk-info td{text-align:left;vertical-align:top;padding:7px 12px;border-bottom:1px solid var(--border);line-height:1.5}
.wk-info th{width:84px;color:var(--faint);font-weight:600;white-space:nowrap}
.wk-info td{word-break:break-word}
.wk-info td a{color:var(--link)}
.wk-ib-act{display:flex;flex-wrap:wrap;gap:6px;padding:10px 12px}
.kb-st.ng{background:var(--ng-weak);color:var(--ng)}
.wk .fv-steps{margin-bottom:12px}
.wk .fv-st{width:226px}
.wk .fv-st p{font-size:12.5px;line-height:1.6;overflow-wrap:anywhere}
a.chip{text-decoration:none}
.wk .mp-gen{margin:10px 0}
.wk .mp-hint{font-size:13.5px}
.wk-askbar{display:flex;align-items:flex-start;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.wk-askbar .mp-ctx{flex:1 1 360px;margin:0}
.wk .mp-ans{max-height:none;overflow:visible}
.wk .mp-ask{margin-top:6px}
@media (max-width:1100px){.wk-cols{grid-template-columns:minmax(0,1fr)}.wk-info{position:static;order:-1}}
@media (max-width:760px){.wk{padding:16px}.wk-cr{grid-template-columns:1fr}.mp-search{display:none}.wk-crumb{display:none}}
/* 詞条のリンク（本文の中の名前）とプレビュー */
.wk-term{color:var(--link);text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--link) 30%,transparent)}
.wk-term:hover{border-bottom-color:var(--link)}
.wk-term.pr{border-bottom-style:dashed}
.wk .fv-st .wk-term{border-bottom:none}
.wk-note{margin:0 0 8px;font-size:12.5px;color:var(--muted)}
.wk-pop{position:fixed;z-index:80;width:340px;max-width:calc(100vw - 24px);padding:12px 14px;border:1px solid var(--border);border-radius:var(--r-l);background:var(--surface);
  box-shadow:var(--shadow),0 12px 32px rgba(29,28,26,.16);font-size:12.5px;line-height:1.6;pointer-events:none}
.wk-pop[hidden]{display:none}
.wk-pop .wk-kind{margin-bottom:6px}
.wk-pop b{display:block;font-family:var(--font-display);font-size:16px;font-weight:600;line-height:1.4;margin-bottom:4px}
.wk-pop p{margin:0;color:var(--muted)}
.wk-pop .aux{display:block;margin-top:8px;font-size:11px;color:var(--faint)}

/* MigraQ のロゴ（icons.js の migaiLogo）。文字の「M」の台は使わない */
.mark.logo{background:none !important;overflow:hidden;box-shadow:0 0 0 1px color-mix(in srgb,var(--fg) 12%,transparent)}
.mark.logo svg{display:block;width:100%;height:100%}

/* ===================== 更新一覧（updates.html。地図と記事はプロジェクトWiki と同じ部品） ===================== */
.up-ver{margin-left:10px;font-size:12px;color:var(--faint)}
.up-st{display:inline-block;flex:none;font-size:10.5px;font-weight:700;padding:1px 7px;border-radius:999px;white-space:nowrap}
.up-st.ok{background:var(--ok-weak);color:var(--ok)}
.up-st.part{background:var(--warn-weak);color:var(--warn)}
.up-st.demo{background:color-mix(in srgb,var(--link) 14%,transparent);color:var(--link)}
.up-st.pr{background:transparent;color:var(--warn);border:1px dashed var(--warn)}
.mp-n.part rect{stroke:var(--warn);stroke-width:1.5}
.mp-n.demo rect{stroke:var(--link);stroke-dasharray:4 3}
.lg.part{border:1.5px solid var(--warn)}
.lg.demo{border:1.5px dashed var(--link)}
.up-sum{display:flex;flex-wrap:wrap;gap:10px;margin:4px 0 12px;font-size:12px;color:var(--muted)}
.up-sum span{display:inline-flex;align-items:center;gap:5px}
.up-lead{margin:0 0 8px;color:var(--fg);line-height:1.7}
.up-lead.big{font-size:15.5px;font-weight:500;margin-bottom:12px}
.up-pts{margin:0 0 10px;padding-left:18px;color:var(--muted);line-height:1.7}
.up-pts li{margin:2px 0}
.up-pts.big{font-size:14.5px;color:var(--fg);line-height:1.85}
.up-pts code,.mp-side .up-pts code{font-family:var(--font-mono);font-size:11.5px;background:var(--surface-3);padding:0 4px;border-radius:var(--r-s)}
.wk-list .up-st{margin-left:2px}
/* 6 段階の移行フローの図 */
.up-fd{margin:8px 0 12px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);padding:6px}
.up-fd.big{padding:10px}
.fd{display:block;width:100%;height:auto;font-family:var(--font-ui)}
.fd-n{cursor:pointer}
.fd-n rect{fill:var(--surface);stroke:var(--border-strong);stroke-width:1.3}
.fd-n.gate rect{stroke:var(--link);stroke-width:2}
.fd-n.auto rect{fill:var(--surface-2)}
.fd-n.on rect{fill:color-mix(in srgb,var(--link) 14%,var(--surface));stroke:var(--link);stroke-width:3}
.fd-n:hover rect{stroke:var(--fg)}
.fd-t{font-size:15px;font-weight:700;fill:var(--fg)}
.fd-s{font-size:12px;fill:var(--muted)}
.fd-a{fill:none;stroke:var(--faint);stroke-width:1.6}
.fd-a.loop{stroke:var(--warn);stroke-dasharray:5 4;stroke-width:2}
.fd-ah{fill:var(--faint)}
.fd-l{font-size:12.5px;fill:var(--warn);font-weight:600}
.fd-k{font-size:11.5px;fill:var(--faint)}
.up-tbl{width:100%;border-collapse:collapse;margin:4px 0 14px;font-size:13.5px;line-height:1.6}
.up-tbl th{text-align:left;font-size:12px;color:var(--faint);font-weight:600;padding:6px 10px;border-bottom:1px solid var(--border-strong)}
.up-tbl td{padding:8px 10px;border-bottom:1px solid var(--border);vertical-align:top}
.up-tbl td:first-child{width:34%;font-weight:600}
.up-tbl td:nth-child(2){width:96px}
.up-tbl a{color:var(--link);text-decoration:none}
.up-tbl a:hover{text-decoration:underline}
.up-h3{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:700;margin:18px 0 2px}
.up-h3 a{color:var(--fg);text-decoration:none}
.up-h3 a:hover{text-decoration:underline}

/* ===================== 課題（issues.html）: 課題のメニュー・一覧 / ボード・詳細・Jira ===================== */
.is-page{height:100%;display:flex;flex-direction:column}
.is-page .pg-head{gap:10px}
.is-body{flex:1;min-height:0;display:flex}
.is-nav{width:224px;flex:none;overflow:auto;padding:12px 10px 24px;border-right:1px solid var(--border);background:var(--surface-2)}
.is-new{width:100%;justify-content:center;margin-bottom:10px}
.is-g{display:flex;align-items:center;gap:6px;margin:14px 8px 4px;font-size:11px;font-weight:700;color:var(--faint);letter-spacing:.04em}
.is-demo{font-size:10px;font-weight:700;color:var(--warn);background:var(--warn-weak);border-radius:999px;padding:0 6px}
.is-it{display:flex;align-items:center;gap:8px;height:30px;padding:0 8px;border-radius:var(--r);color:var(--muted);text-decoration:none;font-size:13px}
.is-it:hover{background:var(--surface-3);color:var(--fg)}
.is-it.on{background:var(--surface);color:var(--fg);font-weight:600;box-shadow:0 0 0 1px var(--border),0 1px 2px rgba(29,28,26,.05)}
.is-it>.i{width:15px;height:15px;flex:none}
.is-it .mono-badge{width:16px;height:16px}
.is-l{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.is-n{font-size:11.5px;font-family:var(--font-mono);color:var(--muted)}
.is-n.z{color:var(--faint);opacity:.6}
.is-dot{display:inline-block;width:9px;height:9px;border-radius:50%;flex:none;margin:0 3px;background:var(--faint)}
.is-dot.doing{background:var(--link)}
.is-dot.done{background:var(--ok)}
.is-ph{width:16px;height:16px;flex:none;display:grid;place-items:center;border-radius:5px;background:var(--surface-3);font-size:10px;font-weight:700;font-style:normal;color:var(--muted)}
.is-warn{width:7px;height:7px;border-radius:50%;background:var(--ng);flex:none}
.is-st{width:8px;height:8px;border-radius:50%;background:var(--border-strong);flex:none}
.is-st.on{background:var(--ok)}
.is-me{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--border);border-radius:999px;background:var(--surface);font:inherit;font-size:12px;color:var(--muted);cursor:pointer}
.is-me .i{width:13px;height:13px}
.is-me.on{color:var(--ok);border-color:color-mix(in srgb,var(--ok) 40%,var(--border))}
.is-main{flex:1;min-width:0;overflow:auto;padding:18px 22px 40px;background:var(--bg)}
.is-top{display:flex;align-items:center;gap:8px;margin-bottom:14px;flex-wrap:wrap}
.is-top h2{display:flex;align-items:baseline;gap:10px;margin:0;font-family:var(--font-display);font-size:22px;font-weight:600}
.is-top h2 .aux{font-family:var(--font-ui);font-size:12.5px;font-weight:400}
.is-top .sp{flex:1}
.is-q{width:min(300px,34vw);height:32px;padding:0 12px;border:1px solid var(--border-strong);border-radius:999px;background:var(--surface);color:var(--fg);font:inherit;font-size:12.5px}
.is-sort{height:32px;border:1px solid var(--border-strong);border-radius:var(--r);background:var(--surface);color:var(--fg);font:inherit;font-size:12.5px;padding:0 8px}
.is-seg{display:inline-flex;border:1px solid var(--border-strong);border-radius:var(--r);overflow:hidden;background:var(--surface)}
.is-seg button{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 10px;border:none;background:none;font:inherit;font-size:12.5px;color:var(--muted);cursor:pointer}
.is-seg button+button{border-left:1px solid var(--border)}
.is-seg button.on{background:var(--fg);color:var(--bg)}
.is-seg .i{width:14px;height:14px}
.is-tw{border:1px solid var(--border);border-radius:var(--r-l);background:var(--surface);overflow:auto}
.is-t{width:100%;border-collapse:collapse;font-size:13px}
.is-t th{position:sticky;top:0;background:var(--surface-2);text-align:left;font-size:11.5px;color:var(--faint);font-weight:600;padding:8px 12px;border-bottom:1px solid var(--border);white-space:nowrap}
.is-t td{padding:9px 12px;border-bottom:1px solid var(--border);vertical-align:middle;white-space:nowrap}
.is-t tr:last-child td{border-bottom:none}
.is-t tbody tr{cursor:pointer}
.is-t tbody tr:hover{background:var(--surface-2)}
.is-t tbody tr.sel{background:var(--accent-weak)}
.is-t tr.done .is-ttl b{color:var(--faint);text-decoration:line-through}
.is-id{font-size:11.5px;color:var(--faint)}
.is-ttl{white-space:normal !important;min-width:240px}
.is-ttl b{font-weight:600}
.is-sub{display:flex;flex-wrap:wrap;gap:5px;margin-top:3px}
.is-sub .chip{height:20px;font-size:11px}
.is-pht{font-size:11px;color:var(--faint)}
.is-pr{display:inline-block;font-size:11px;font-weight:700;padding:1px 8px;border-radius:999px;background:var(--surface-3);color:var(--muted)}
.is-pr.high{background:var(--ng-weak);color:var(--ng)}
.is-pr.low{background:transparent;color:var(--faint);border:1px solid var(--border)}
.is-as{display:inline-flex;align-items:center;gap:6px;font-size:12.5px}
.is-as .av{width:20px;height:20px;font-size:9px}
.is-js{margin-left:6px;font-size:11.5px;color:var(--muted)}
.is-empty{display:flex;flex-direction:column;align-items:center;gap:6px;padding:48px 16px;border:1px dashed var(--border-strong);border-radius:var(--r-l);color:var(--muted);text-align:center}
.is-empty>.i{width:26px;height:26px;color:var(--ok)}
.is-empty b{font-size:15px;color:var(--fg)}
.is-empty p{margin:0 0 8px}
.is-hint,.is-note{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);margin:10px 0}
.is-note{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:8px 12px}
.is-hint .i,.is-note .i{width:14px;height:14px;flex:none;color:var(--link)}
/* ボード */
.is-board{display:grid;grid-template-columns:repeat(3,minmax(170px,1fr));gap:12px;align-items:start}
.is-col{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-l);padding:10px;min-height:240px;transition:background .12s,box-shadow .12s}
.is-col.over{background:color-mix(in srgb,var(--link) 8%,var(--surface-2));box-shadow:0 0 0 2px color-mix(in srgb,var(--link) 50%,transparent)}
.is-colh{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:700;margin:2px 4px 10px}
.is-colh .is-n{margin-left:auto}
.is-cards{display:flex;flex-direction:column;gap:8px}
.is-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:10px 12px;cursor:grab;box-shadow:0 1px 2px rgba(29,28,26,.05);display:flex;flex-direction:column;gap:6px;font-size:13px}
.is-card:hover{border-color:var(--border-strong)}
.is-card.sel{box-shadow:0 0 0 2px var(--link)}
.is-card.drag{opacity:.4}
.is-card b{font-weight:600;line-height:1.45}
.is-ch,.is-cf{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.is-cf .sp{flex:1}
.is-cf .chip,.is-ch .chip{height:20px;font-size:11px}
.is-cf .av{width:20px;height:20px;font-size:9px}
.is-drop{border:1px dashed var(--border-strong);border-radius:var(--r);padding:18px;text-align:center;font-size:12px;color:var(--faint)}
/* 詳細 */
.is-detail{width:440px;flex:none;overflow:auto;border-left:1px solid var(--border);background:var(--surface);padding:14px 18px 30px}
.is-detail[hidden],.is-detail [hidden]{display:none !important}
.is-dh{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.is-dh .sp{flex:1}
.is-title{width:100%;border:1px solid transparent;border-radius:var(--r);background:transparent;font-family:var(--font-display);font-size:19px;font-weight:600;color:var(--fg);padding:4px 6px;margin:0 -6px 10px}
.is-title:hover{border-color:var(--border)}
.is-title:focus{outline:none;border-color:var(--link);background:var(--surface-2)}
.is-props{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;margin-bottom:6px}
.is-props label{display:flex;flex-direction:column;gap:3px;font-size:11.5px;color:var(--faint);font-weight:600}
.is-props label.w2{grid-column:1/-1}
.is-props select{height:32px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);color:var(--fg);font:inherit;font-size:13px;padding:0 8px}
.is-sec{border-top:1px solid var(--border);padding:12px 0}
.is-sh{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:700;margin-bottom:8px;flex-wrap:wrap}
.is-sh>.i{width:15px;height:15px;color:var(--link)}
.is-sh .sp{flex:1}
.is-sec textarea{width:100%;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);color:var(--fg);font:inherit;font-size:13px;line-height:1.6;padding:8px 10px;resize:vertical}
.is-meta{margin-top:6px;font-size:11.5px}
.is-chat{max-height:360px;overflow:auto;font-size:12.5px}
.is-chat .cm{max-width:100%}
.is-done{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}
.is-jkv{display:grid;grid-template-columns:90px 1fr;gap:4px 10px;font-size:12.5px;margin-bottom:8px}
.is-jkv span{color:var(--faint)}
.is-jc{display:flex;flex-direction:column;gap:6px}
.is-jcm pre{margin:3px 0 0;white-space:pre-wrap;font-size:12px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-s);padding:6px 8px;font-family:var(--font-ui)}
.is-foot{border-top:1px solid var(--border);padding-top:12px;display:flex;justify-content:flex-end;gap:8px}
.is-nf .is-props{margin:4px 0 8px}
.is-chk{display:flex !important;flex-direction:row !important;align-items:center;gap:8px;font-size:12.5px;color:var(--fg)}
/* 同期状況 */
.is-kpi{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:4px 0 14px}
.is-kpi>div{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.is-kpi b{font-family:var(--font-display);font-size:26px;font-weight:600}
.is-kpi span{font-size:12px;color:var(--muted)}
.is-kpi .ng b{color:var(--ng)}
.is-kpi .warn b{color:var(--warn)}
.is-sy{display:inline-block;font-size:11px;font-weight:700;padding:1px 8px;border-radius:999px;background:var(--surface-3);color:var(--muted)}
.is-sy.ok{background:var(--ok-weak);color:var(--ok)}
.is-sy.ng{background:var(--ng-weak);color:var(--ng)}
.is-sy.warn{background:var(--warn-weak);color:var(--warn)}
/* 取り込み */
.is-pulls{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:12px}
.is-pc{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);padding:12px 14px;display:flex;flex-direction:column;gap:6px}
.is-pc b{font-size:14px}
.is-pc p{margin:0;font-size:12.5px;color:var(--muted);line-height:1.6}
/* 接続とログイン */
.is-login{display:grid;grid-template-columns:repeat(auto-fit,minmax(360px,1fr));gap:14px;align-items:start}
.is-lc{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);padding:16px 18px}
.is-lh{display:flex;align-items:center;gap:8px;font-size:15px;margin-bottom:6px}
.is-lh>.i{width:17px;height:17px;color:var(--link)}
.is-lp{margin:0 0 12px;font-size:13px;color:var(--muted);line-height:1.7}
.is-ok{font-size:11px;font-weight:700;color:var(--ok);background:var(--ok-weak);border-radius:999px;padding:1px 8px}
.is-acct{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface-2);margin-bottom:10px}
.is-acct div{display:flex;flex-direction:column}
.is-acct .av{width:34px;height:34px;font-size:13px}
.is-lb{display:flex;align-items:center;gap:8px;margin-top:6px}
.is-lb .sp{flex:1}
.is-lf input:disabled{background:var(--surface-2);color:var(--muted)}
.is-how{margin-top:14px}
.is-how ol{margin:6px 0 0;padding-left:20px;font-size:13px;line-height:1.9;color:var(--muted)}
.is-how b{color:var(--fg)}
/* 「migai」ラベルで AI が動く（自動分析）と、Jira 側（デモ） */
.is-bot{margin-top:14px}
.is-lh .is-off,.is-lh .is-ok{margin-left:4px}
.bot-line{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface-2);font-size:12.5px;color:var(--muted);margin-bottom:10px}
.bot-line>.i{width:14px;height:14px;color:var(--ok);flex:none}
.bot-line b{font-family:var(--font-mono);color:var(--fg)}
.bot-set{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin:4px 0 10px;font-size:12.5px}
.bot-set>label{display:flex;align-items:center;gap:8px}
.bot-set select{width:auto}
.bot-items{display:flex;flex-direction:column;margin-top:8px;border-top:1px solid var(--border);padding-top:6px}
.bot-it{display:flex;align-items:center;gap:6px;min-height:30px;font-size:12px;border-bottom:1px solid var(--border)}
.bot-it:last-child{border-bottom:none}
.bot-it .chip{height:20px;font-size:11px}
.bot-it>.aux{white-space:nowrap;font-size:11px}
.bot-sum{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
.bot-st{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:700;white-space:nowrap;padding:1px 8px;border-radius:999px;background:var(--surface-3);color:var(--muted)}
.bot-st .i{width:11px;height:11px}
.bot-st .spin{width:10px;height:10px}
.bot-st.ok{background:var(--ok-weak);color:var(--ok)}
.bot-st.ng{background:var(--ng-weak);color:var(--ng)}
.bot-st.run{background:var(--accent-weak);color:var(--accent-ink)}
.jd{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:14px;align-items:start}
.jd-f label{font-size:12.5px}
.jd-h{display:flex;align-items:baseline;gap:10px;font-size:14px;margin:18px 0 8px}
.jd-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(360px,1fr));gap:12px}
.jd-c{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);padding:12px 14px;display:flex;flex-direction:column;gap:6px}
.jd-c.lab{border-color:color-mix(in srgb,var(--link) 45%,var(--border))}
.jd-c.done{opacity:.6}
.jd-c b{font-size:14px}
.jd-c p{margin:0;font-size:12.5px;color:var(--muted);line-height:1.6}
.jd-lab{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px}
.jd-lab .sp{flex:1}
.jd-l{font-family:var(--font-mono);font-size:11px;padding:1px 7px;border-radius:var(--r-s);background:var(--surface-3);color:var(--muted)}
.jd-l.on{background:color-mix(in srgb,var(--link) 14%,var(--surface));color:var(--link);font-weight:600}
.jd-cm{display:flex;flex-direction:column;gap:6px}
.jd-cm .is-link{display:inline-flex;align-items:center;gap:3px;align-self:flex-start}
.jd-cm .is-link .i{width:12px;height:12px}
.is-jcm.bot pre{border-color:color-mix(in srgb,var(--link) 35%,var(--border));background:color-mix(in srgb,var(--link) 5%,var(--surface))}
.is-jcm pre a{color:var(--link);word-break:break-all}
.is-botl{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--link);margin-bottom:8px}
.is-botl .i{width:13px;height:13px;flex:none}
@media (max-width:1100px){.jd{grid-template-columns:1fr}}
/* メンバー */
.is-mems{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:12px}
.is-mem{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-l);padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.is-mem.on{border-color:color-mix(in srgb,var(--ok) 35%,var(--border))}
.is-mh{display:flex;align-items:center;gap:10px}
.is-mh .av{width:36px;height:36px;font-size:13px}
.is-mh>div{display:flex;flex-direction:column;gap:2px}
.is-mh .sp{flex:1}
.is-now{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--muted)}
.is-mk{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.is-mk>div{background:var(--surface-2);border-radius:var(--r);padding:6px 8px;display:flex;flex-direction:column}
.is-mk b{font-size:17px}
.is-mk span{font-size:11px;color:var(--faint)}
.is-mk .ng b{color:var(--ng)}
.is-mx{display:flex;flex-wrap:wrap;align-items:center;gap:5px;font-size:12.5px}
.is-mx>.aux:first-child{width:72px;flex:none;font-size:11.5px}
@media (max-width:1200px){.is-detail{width:380px}.is-board{grid-template-columns:repeat(3,minmax(180px,1fr))}}
@media (max-width:900px){.is-nav{display:none}.is-detail{position:fixed;right:0;top:0;bottom:0;z-index:40;box-shadow:var(--shadow)}}
.is-off{font-size:11px;font-weight:600;color:var(--muted);background:var(--surface-3);border-radius:999px;padding:1px 8px}
.jira-b .is-st{display:inline-block;margin-right:5px;vertical-align:1px}
/* ワークベンチ: 完了した後の状態の印（押せないボタンに見えないように） */
.tb-done{display:inline-flex;align-items:center;gap:5px;height:26px;padding:0 10px;border:none;border-radius:999px;background:var(--ok-weak);color:var(--ok);font:inherit;font-size:12px;font-weight:600;cursor:default}
.tb-done .i{width:13px;height:13px}
/* 課題: AI と相談して修正方針を決める */
.is-detail .is-chat{max-height:420px;overflow:auto;padding-right:2px}
.is-ask{margin-top:10px}
.is-ask textarea{font-size:13px}
.is-plan{display:flex;align-items:center;gap:8px;margin-top:8px;flex-wrap:wrap}
.is-plan .aux{flex:1;min-width:180px;font-size:11.5px}
.is-fixl{display:flex;flex-direction:column;gap:4px;font-size:11.5px;color:var(--faint);font-weight:600}
.is-fixl>span{display:flex;align-items:center;gap:8px}
.is-fixl textarea{width:100%;border:1px solid var(--border);border-radius:var(--r);background:var(--surface-2);color:var(--fg);font:inherit;font-size:13px;font-weight:400;line-height:1.6;padding:8px 10px;resize:vertical}
.is-fixl textarea:focus{outline:none;border-color:var(--link);background:var(--surface)}
.is-fixb{display:flex;gap:8px;margin-top:8px}
.is-link{border:none;background:none;padding:0;font:inherit;font-size:11.5px;color:var(--link);cursor:pointer;font-weight:500}
.is-link:hover{text-decoration:underline}

/* ===================== 自動検証（verify.html） ===================== */
.vf .fl-head{margin-bottom:14px}
.vf .fl-head .fl-sub{max-width:900px}
.vf-tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin-bottom:14px}
.vf-tab{border:none;background:none;padding:8px 12px;font:inherit;font-size:13px;font-weight:600;color:var(--muted);border-bottom:2px solid transparent;cursor:pointer;margin-bottom:-1px}
.vf-tab i{font-style:normal;font-size:11px;color:var(--faint);margin-left:4px}
.vf-tab.on{color:var(--fg);border-bottom-color:var(--accent)}
.vf-bar{display:flex;align-items:center;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.vf-bar .aux,.vf .aux{font-size:12px;color:var(--faint)}
.vf-empty{padding:28px;text-align:center;color:var(--muted);border:1px dashed var(--border-strong);border-radius:var(--r-l)}
.vf-empty .btn{margin-top:10px}
.vf-list,.vf-pre{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.vf-row{border:1px solid var(--border);border-radius:var(--r-l);background:var(--surface)}
.vf-row.open{border-color:var(--border-strong)}
.vf-row-h{display:flex;align-items:center;gap:12px;padding:10px 12px;cursor:pointer}
.vf-arrow .i{width:14px;height:14px;color:var(--faint)}
.vf-row-t{flex:1;min-width:0}
.vf-row-t b{font-size:13.5px}
.vf-scr{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.vf-row-st{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end;max-width:46%}
.spin.sm{width:9px;height:9px;border-width:1.5px}
.vf-det{border-top:1px solid var(--border);padding:12px 14px 16px;display:flex;flex-direction:column;gap:12px}
.vf-det h4{font-size:12px;font-weight:700;color:var(--muted);margin:0 0 4px}
.vf-meta{display:grid;grid-template-columns:1fr 1fr;gap:16px;font-size:12.5px}
.vf-meta ol,.vf-meta ul{margin:0;padding-left:18px;color:var(--fg)}
.vf-script{font-size:12.5px;color:var(--muted);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.vf-note{margin:0;font-size:12.5px;display:flex;gap:6px;align-items:flex-start}
.vf-note.warn{color:var(--warn)}
.vf-note .i{width:14px;height:14px;flex:none;margin-top:2px}
.vf-judge{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border-radius:var(--r);border:1px solid var(--border)}
.vf-judge.ok{background:var(--ok-weak);border-color:color-mix(in srgb,var(--ok) 35%,var(--border))}
.vf-judge.ng{background:var(--ng-weak);border-color:color-mix(in srgb,var(--ng) 35%,var(--border))}
.vf-judge>.i{width:18px;height:18px;flex:none;margin-top:1px}
.vf-judge.ok>.i{color:var(--ok)}.vf-judge.ng>.i{color:var(--ng)}
.vf-judge p{margin:3px 0 0;font-size:12.5px}
.vf-judge .sp{flex:1}
.vf-cps{display:flex;flex-direction:column;gap:12px}
.vf-cp{border:1px solid var(--border);border-radius:var(--r);padding:10px}
.vf-cp-h{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.vf-cp p{margin:6px 0 0;font-size:12.5px}
.vf-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
.vf-pair figure{margin:0;border:1px solid var(--border);border-radius:var(--r-s);overflow:hidden;background:var(--surface-2);cursor:zoom-in}
.vf-pair figure img,.vf-pair video{display:block;width:100%;height:auto}
.vf-pair figure.none{cursor:default;display:flex;flex-direction:column}
.vf-pair figure.none div{flex:1;display:grid;place-items:center;min-height:120px;color:var(--faint);font-size:12px}
.vf-pair figcaption{font-size:11px;color:var(--muted);padding:3px 8px;border-top:1px solid var(--border);background:var(--surface)}
.vf-pair.sm{max-width:720px}
.vf-pair.vid figure{cursor:default}
.vf-db{width:100%;border-collapse:collapse;font-size:12px}
.vf-db th,.vf-db td{border-bottom:1px solid var(--border);padding:5px 8px;text-align:left;vertical-align:top}
.vf-db th{color:var(--muted);font-weight:600}
.vf-db tr.ng td{background:var(--ng-weak)}
.vf-db .i{width:13px;height:13px}
.vf-fixes{margin:0;padding-left:0;list-style:none;font-size:12.5px;display:flex;flex-direction:column;gap:4px}
.vf-fixes .i{width:13px;height:13px;vertical-align:-2px}
.vf-pre-r{border:1px solid var(--border);border-radius:var(--r-l);background:var(--surface);padding:10px 12px}
.vf-pre-r.check{border-color:color-mix(in srgb,var(--ng) 40%,var(--border))}
.vf-pre-h{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.vf-pre-h .sp{flex:1}
.vf-pre-r p{margin:6px 0 0;font-size:12.5px}
.vf-diffs{margin:6px 0 0;padding-left:18px;font-size:12px;color:var(--muted)}
.vf-diffs li.error{color:var(--crit)}.vf-diffs li.diff{color:var(--fg)}
.vf-job{border-color:var(--border-strong)}
.vf-job.on{border-color:var(--accent)}
.vf-job-h{display:flex;align-items:center;gap:8px;font-size:13px;flex-wrap:wrap}
.vf-job-h .i{width:15px;height:15px}
.vf-job-h .sp{flex:1}
.vf-job-t{margin-top:6px;font-size:12.5px;color:var(--muted);word-break:break-word}
.vf-set h3,.vf-how h3{font-size:13px;margin:0 0 8px}
.vf-ck{display:flex;align-items:center;gap:6px;font-size:12.5px;margin:6px 0}
.vf-ck select{font:inherit;font-size:12px;padding:1px 4px}
.vf-how ol{margin:0;padding-left:18px;font-size:12.5px;color:var(--muted);display:flex;flex-direction:column;gap:4px}
.vf-how p{margin:8px 0 0}
.dlg.vf-wide{width:min(1200px,100%)}
.vf-zoom{display:block;width:100%;height:auto}
.vf-steps{display:grid;grid-template-columns:1fr 1fr;gap:16px;font-size:12px}
.vf-steps ol{padding-left:20px;margin:0;display:flex;flex-direction:column;gap:3px}
.vf-steps code{font-size:11px;background:var(--surface-2);padding:0 4px;border-radius:4px;word-break:break-all}
@media (max-width:1100px){.vf-meta,.vf-steps{grid-template-columns:1fr}.vf-row-st{max-width:none}}

/* ===================== 規約・移行プレイブック（playbook.html） ===================== */
.pb .fl-head .fl-sub{max-width:900px}
.pb-add{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.pb-add select,.pb-ed-h select,.pb-prop-f select{font:inherit;font-size:12.5px;height:28px;border:1px solid var(--border-strong);border-radius:var(--r-s);background:var(--surface);color:var(--fg);padding:0 6px}
.pb-docs{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.pb-doc{display:flex;align-items:center;gap:8px;flex-wrap:wrap;text-align:left;font:inherit;font-size:13px;border:1px solid var(--border);border-radius:var(--r);background:var(--surface);padding:8px 12px;cursor:pointer;color:var(--fg)}
.pb-doc .sp{flex:1}
.pb-doc .aux{font-size:11.5px;color:var(--faint);width:100%}
.pb-doc.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.pb-ed{border:1px solid var(--border);border-radius:var(--r-l);background:var(--surface);padding:12px;display:flex;flex-direction:column;gap:10px}
.pb-ed-h{display:flex;align-items:center;gap:8px}
.pb-ed-h .sp{flex:1}
.pb-title{flex:1;max-width:520px;font:inherit;font-size:15px;font-weight:600;border:1px solid var(--border-strong);border-radius:var(--r-s);padding:5px 9px;background:var(--surface);color:var(--fg)}
.pb-text{width:100%;min-height:460px;resize:vertical;font-family:var(--font-mono);font-size:12.5px;line-height:1.6;border:1px solid var(--border-strong);border-radius:var(--r-s);padding:10px 12px;background:var(--surface-2);color:var(--fg)}
.pb-prev{border:1px solid var(--border);border-radius:var(--r-s);padding:4px 16px 12px;max-height:620px;overflow:auto;font-size:13px;line-height:1.7}
.pb-prev h2{font-size:17px;margin:14px 0 6px}.pb-prev h3{font-size:14.5px;margin:12px 0 4px}.pb-prev h4,.pb-prev h5{font-size:13px;margin:10px 0 4px}
.pb-prev pre{background:var(--surface-2);padding:8px;border-radius:var(--r-s);overflow:auto;font-size:12px}
.pb-prev code{font-family:var(--font-mono);font-size:12px;background:var(--surface-2);padding:0 4px;border-radius:4px}
.pb-ed-f{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pb-ed-f .aux{font-size:12px;color:var(--faint)}
.pb-props h3{font-size:13px;margin:0 0 6px;display:flex;align-items:center;gap:6px}
.pb-props>.aux,.pb-props .aux{font-size:12px;color:var(--faint)}
.pb-prop{border:1px solid var(--border);border-radius:var(--r);padding:8px 10px;margin-top:8px}
.pb-prop p{margin:0;font-size:12.5px}
.pb-prop-f{display:flex;align-items:center;gap:6px;margin-top:6px;flex-wrap:wrap}
.pb-prop-f .sp{flex:1}
.pb-done{margin-top:10px;font-size:12px}
.pb-done p{margin:4px 0 0}
.flow-entries2{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:-6px;margin-bottom:16px}
.flow-entries2 .flow-entry{margin:0}
@media (max-width:1100px){.flow-entries2{grid-template-columns:1fr}}

/* ===================== 機能単位の移行（units.html） ===================== */
.un .fl-head .fl-sub{max-width:900px}
.un-map{border:1px solid var(--border);border-radius:var(--r-l);background:var(--surface);padding:10px 12px;margin-bottom:12px;overflow:auto}
.un-map-h{display:flex;align-items:center;gap:10px;margin-bottom:6px;font-size:13px}
.un-map-h .aux{font-size:12px;color:var(--faint)}
.un-map svg{display:block}
.un-edge{fill:none;stroke:var(--border-strong);stroke-width:1.5}
.un-arr{fill:var(--border-strong)}
.un-node{cursor:pointer}
.un-node rect{fill:var(--surface);stroke:var(--border-strong);stroke-width:1.2}
.un-node .t{font-size:13px;font-weight:600;fill:var(--fg)}
.un-node .s{font-size:11px;fill:var(--muted)}
.un-node .ck{font-size:15px;font-weight:700;fill:var(--accent)}
.un-node.verified rect{fill:var(--ok-weak);stroke:var(--ok)}
.un-node.migrated rect{fill:var(--accent-weak);stroke:color-mix(in srgb,var(--accent) 50%,var(--border))}
.un-node.running rect,.un-node.queued rect{stroke:var(--accent);stroke-dasharray:4 3}
.un-node.failed rect{fill:var(--ng-weak);stroke:var(--ng)}
.un-node.sel rect{stroke:var(--accent);stroke-width:2.5}
.un-node:hover rect{stroke:var(--accent)}
.un-bar .aux{font-size:12px;color:var(--faint)}
.un-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.un-row .vf-row-h input[type=checkbox]{width:16px;height:16px;flex:none}
.un-last{max-width:320px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.un-files{margin:4px 0 0;padding-left:18px;font-size:11.5px}
.un-sum{white-space:pre-wrap;font-size:12px;margin:4px 0 0}
.un-waves{margin-top:6px;font-size:12px}
.vf-det code{font-family:var(--font-mono);font-size:11.5px;background:var(--surface-2);padding:0 4px;border-radius:4px}
.mark.logo.mq{box-shadow:none !important;border-radius:0 !important;overflow:visible}
/* AI のアイコン（入力欄の左・AI に頼む）も MigraQ のロゴ */
.mqb{background:none !important;border:none !important;color:inherit !important;box-shadow:none !important;display:inline-grid;place-items:center}
.mqb .mark.logo{width:100%;height:100%;background:none;box-shadow:none}
