/* OHC — Our Handless CodeServer
   配色の正本はここの変数だけ。既定はダーク、html[data-theme=light] でライト。
   動きは短く(ボタン 120ms・メニュー 160ms)、ease-out の強い曲線。キーボード操作には動きを付けない。 */
:root {
  color-scheme: dark;
  --bg: #0e0f11; --bg2: #121316; --sf: #16181b; --sf2: #1c1e22; --sf3: #23262b;
  --line: #24272c; --line2: #30343a;
  --fg: #e8eaed; --fg2: #b7bcc4; --dim: #80868f;
  --acc: #8b9cff; --acc2: #a9b6ff; --acc-ink: #0e0f11; --acc-bg: rgb(139 156 255 / .12);
  --ok: #3fb68b; --work: #e5a50a; --ask: #f0883e; --bad: #e5534b; --off: #5c6168;
  --sh: 0 8px 28px rgb(0 0 0 / .45), 0 1px 0 rgb(255 255 255 / .03) inset;
  --r: 10px; --r2: 7px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --font: 'Inter', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Menlo', monospace;
}
html[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f6f8; --bg2: #eef0f3; --sf: #ffffff; --sf2: #f4f5f7; --sf3: #eceef1;
  --line: #e2e5e9; --line2: #d4d8de;
  --fg: #16181b; --fg2: #3c4149; --dim: #6b717a;
  --acc: #4f5fd9; --acc2: #3f4fc9; --acc-ink: #ffffff; --acc-bg: rgb(79 95 217 / .09);
  --sh: 0 10px 30px rgb(16 24 40 / .12), 0 1px 2px rgb(16 24 40 / .06);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 13px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: 'cv11', 'ss01'; }
#app { height: 100%; }
a { color: var(--acc); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; border-radius: 6px; }
.ic { flex: none; display: block; }
.grow { flex: 1 1 auto; min-width: 0; }
.st { color: var(--dim); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 11.5px; }
.pad { padding: 8px 12px; }
.err { display: flex; gap: 6px; align-items: center; color: var(--bad); font-size: 12.5px; }
.loading { display: grid; place-items: center; height: 100%; min-height: 120px; color: var(--dim); font-size: 12.5px; }
.splash { display: grid; place-items: center; height: 100%; opacity: .8; }

/* ---- ボタン ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r2);
  border: 1px solid var(--line2); background: var(--sf2); color: var(--fg); font-weight: 500; white-space: nowrap;
  transition: transform 120ms var(--ease), background-color 120ms ease, border-color 120ms ease; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.acc { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn.wide { width: 100%; height: 38px; }
.ib { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; color: var(--dim); flex: none;
  transition: transform 120ms var(--ease), background-color 120ms ease, color 120ms ease; }
.ib.xs { width: 22px; height: 22px; border-radius: 5px; }
.ib:active:not(:disabled) { transform: scale(.94); }
.ib:disabled { opacity: .4; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { border-color: var(--dim); }
  .btn.acc:hover:not(:disabled) { background: var(--acc2); border-color: var(--acc2); }
  .ib:hover:not(:disabled) { background: var(--sf3); color: var(--fg); }
}
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--sf2); border: 1px solid var(--line); gap: 2px; }
.seg button { min-width: 30px; height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--dim); font-weight: 500; transition: background-color 120ms ease, color 120ms ease; }
.seg button.on { background: var(--sf3); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .25); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

/* ---- 入力 ---- */
input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; min-width: 0; height: 34px; padding: 0 10px; border-radius: var(--r2); border: 1px solid var(--line2); background: var(--bg2); outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease; }
select { width: auto; padding-right: 26px; height: 30px; }
input:focus, select:focus, textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-bg); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fl { font-size: 12px; color: var(--fg2); font-weight: 500; }
.fh { font-size: 11.5px; color: var(--dim); }
.form { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.form .row input { flex: 1; }

/* ---- 小物 ---- */
.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; letter-spacing: 0; }
.av.avimg { display: inline-block; object-fit: cover; background: var(--sf3); }
.tdot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--off); }
.dot.ok { background: var(--ok); }
.dot.wait { background: var(--dim); }
.dot.off { background: var(--off); }
.dot.bad { background: var(--bad); }
.dot.ask { background: var(--ask); box-shadow: 0 0 0 3px rgb(240 136 62 / .18); }
.dot.work { background: var(--work); animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { box-shadow: 0 0 0 0 rgb(229 165 10 / .45); } 50% { box-shadow: 0 0 0 4px rgb(229 165 10 / 0); } }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; font-weight: 500; background: var(--sf3); color: var(--fg2); white-space: nowrap; flex: none; }
.tag.ok { background: rgb(63 182 139 / .14); color: var(--ok); }
.tag.bad { background: rgb(229 83 75 / .14); color: var(--bad); }
.tag.work { background: rgb(229 165 10 / .14); color: var(--work); }
.tag.ask { background: rgb(240 136 62 / .16); color: var(--ask); }
.tag.acc { background: var(--acc-bg); color: var(--acc); }
.tag.ext { gap: 4px; background: rgb(86 182 194 / .14); color: #56b6c2; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.tag.shared { gap: 4px; background: rgb(198 120 221 / .14); color: #c678dd; }
.shr { display: inline-grid; place-items: center; color: #c678dd; flex: none; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--acc); animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { display: flex; gap: 8px; align-items: center; padding: 8px 12px; margin: 0 12px 8px; border-radius: var(--r2); font-size: 12.5px; }
.banner.bad { background: rgb(229 83 75 / .12); color: var(--bad); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--dim); height: 100%; }
.empty b { color: var(--fg2); font-weight: 600; }
.empty .st { max-width: 420px; }

/* ---- 入口 ---- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--acc-bg), transparent 60%), var(--bg); }
.loginBox { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: 14px; background: var(--sf); border: 1px solid var(--line); box-shadow: var(--sh); }
.loginBox h3 { margin: 4px 0 0; font-size: 15px; }
.loginBox .st { margin: -4px 0 4px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); }
.brand b { font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.brand span { color: var(--dim); font-size: 12px; }
.brand.big { gap: 12px; }
.brand.big > div { display: flex; flex-direction: column; line-height: 1.25; }
.brand.big b { font-size: 20px; }
.btn.sso { gap: 10px; text-decoration: none; }
.orline { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; }
.orline::before, .orline::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---- 外枠 ---- */
.shell { display: grid; grid-template-columns: 264px 1fr; grid-template-rows: 48px 1fr; height: 100%; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--line); background: var(--bg2); min-width: 0; }
.navBtn { display: none; }
.scopeBtn { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; margin-left: 8px; border-radius: 8px; border: 1px solid var(--line2); background: var(--sf); min-width: 0;
  transition: transform 120ms var(--ease), border-color 120ms ease; }
.scopeBtn:active { transform: scale(.98); }
.scopeBtn .sl { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.scopeBtn .sr { color: var(--dim); font-size: 12px; }
.pulse { display: flex; gap: 14px; color: var(--dim); font-size: 12px; }
.pulse span { display: inline-flex; align-items: center; gap: 6px; }
.pulse span.on { color: var(--fg2); }
.pulse span.on.ask { color: var(--ask); }
.me { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 4px; border: 0; border-radius: 17px; background: transparent; color: var(--fg2); }
@media (hover: hover) and (pointer: fine) { .me:hover, .scopeBtn:hover { background: var(--sf2); } }

.side { grid-row: 2; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg2); overflow: hidden; }
.nvs { display: flex; flex-direction: column; gap: 1px; padding: 10px 8px; }
.nvs.adm { border-top: 1px solid var(--line); }
.nvH { padding: 4px 8px 6px; font-size: 11px; color: var(--dim); letter-spacing: .06em; font-weight: 600; }
.nv { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 9px; border-radius: 7px; color: var(--fg2); font-weight: 500; transition: background-color 120ms ease, color 120ms ease; }
.nv.on { background: var(--sf3); color: var(--fg); }
.nv .cnt { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; display: grid; place-items: center; background: var(--sf3); }
.nv .cnt.ask { background: var(--ask); color: #1a1208; font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .nv:hover:not(.on) { background: var(--sf2); color: var(--fg); } }
.treeH { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 16px 4px; font-size: 11px; color: var(--dim); letter-spacing: .06em; font-weight: 600; border-top: 1px solid var(--line); }
.treeH .st { font-size: 11px; letter-spacing: 0; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.tree { flex: 1; overflow: auto; padding: 4px 8px 12px; }
.tn { display: flex; align-items: center; gap: 6px; width: 100%; height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--fg2); text-align: left; min-width: 0; }
.tn .tl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn .car { color: var(--dim); }
.tn.t0 { font-weight: 600; color: var(--fg); }
.tn.t1 { padding-left: 16px; }
.tn.t2 { padding-left: 26px; padding-right: 2px; gap: 2px; }
.tn.t3 { padding-left: 50px; height: 26px; font-size: 12.5px; color: var(--fg2); }
.tn.t3.st { color: var(--dim); font-size: 11.5px; }
.tnb { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; height: 28px; padding: 0; border: 0; background: transparent; color: var(--fg); font-weight: 500; text-align: left; }
.tnb .tl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cntS { font-size: 11px; color: var(--dim); padding: 0 4px; }
.inst { box-shadow: inset 2px 0 0 var(--ic, transparent); }
@media (hover: hover) and (pointer: fine) { .tn:hover, .tn.inst:hover { background: var(--sf2); } }
.sideF { padding: 8px 16px 10px; border-top: 1px solid var(--line); font-size: 11px; }
.navScrim { display: none; }
.main { grid-row: 2; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

/* ---- ページ ---- */
.page { flex: 1; overflow: auto; padding: 22px 28px 60px; }
.page.narrow > * { max-width: 760px; }
.pageH { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.pageH h1, .wsT h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.005em; }
.lead { margin: -8px 0 16px; max-width: 760px; }
.sec { margin-bottom: 26px; }
.secH { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.secH h2 { margin: 0; font-size: 13.5px; font-weight: 600; }
.secA { margin-left: auto; }
.secI { margin: 0 0 10px; color: var(--dim); font-size: 12.5px; max-width: 760px; }
.table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--sf); overflow: hidden; }
.tr { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); min-width: 0; }
.tr:first-child { border-top: 0; }
.tc { display: flex; flex-direction: column; min-width: 0; }
.tc b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc .st { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table.log .tr { padding: 7px 14px; gap: 14px; font-size: 12.5px; }
.table.log .tc { flex-direction: row; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.gchip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 4px 0 8px; border-radius: 12px; background: var(--sf3); color: var(--fg2); font-size: 12px; white-space: nowrap; }
.gchip small { color: var(--dim); font-size: 11px; padding-right: 4px; }
.gchip.team { background: var(--acc-bg); color: var(--acc); }
.gchip button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 9px; background: transparent; color: inherit; opacity: .7; }
.gchip button:hover { opacity: 1; background: rgb(127 127 127 / .2); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.steps li { padding-left: 4px; }
.steps li b { display: block; font-weight: 600; }
.swatches { display: flex; gap: 8px; }
.swatches .sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; transition: transform 120ms var(--ease); }
.swatches .sw.on { border-color: var(--fg); }
.swatches .sw:active { transform: scale(.92); }
.secret { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.kv2 { display: flex; align-items: center; gap: 10px; }
.kv2 span { width: 110px; color: var(--dim); font-size: 12px; flex: none; }
.kv2 code { flex: 1; padding: 6px 8px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; user-select: all; word-break: break-all; }

/* 資源と割り当ての木 */
.atree { border: 1px solid var(--line); border-radius: var(--r); background: var(--sf); overflow: hidden; }
.atr { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.atree > .atr:first-child { border-top: 0; }
.atr b { font-weight: 600; }
.atr.d1 { padding-left: 34px; background: color-mix(in srgb, var(--sf) 92%, var(--bg)); }
.atr.d2 { padding-left: 58px; background: color-mix(in srgb, var(--sf) 84%, var(--bg)); }

/* まとめて見る */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; max-width: 900px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--r); background: var(--sf); border: 1px solid var(--line); }
.stat b { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat b small { font-size: 13px; color: var(--dim); font-weight: 500; }
.stat span { color: var(--dim); font-size: 12px; }
.stat.work b { color: var(--work); }
.stat.ask b { color: var(--ask); }
.ovS { margin-bottom: 26px; }
.ovSH { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ovSH b { font-size: 14px; }
.ovSH .lnk { display: inline-flex; align-items: center; gap: 3px; }
.ovC { margin: 0 0 14px 6px; }
.ovCH { display: flex; align-items: center; gap: 6px; color: var(--fg2); font-size: 12.5px; margin-bottom: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.icard { display: flex; flex-direction: column; border-radius: var(--r); background: var(--sf); border: 1px solid var(--line); overflow: hidden; box-shadow: inset 3px 0 0 var(--ic, transparent); }
.icH { display: flex; align-items: center; gap: 8px; padding: 12px 14px 2px; flex-wrap: wrap; }
.icH b { font-size: 13.5px; }
.icM { padding: 0 14px 10px 30px; }
.icE { display: flex; gap: 6px; align-items: center; margin: 0 14px 10px; padding: 6px 8px; border-radius: 6px; background: rgb(229 83 75 / .1); color: var(--bad); font-size: 12px; }
.icT { border-top: 1px solid var(--line); display: flex; flex-direction: column; padding: 4px; }
.row2 { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--fg); text-align: left; min-width: 0; transition: background-color 120ms ease; }
.row2 .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .row2:hover { background: var(--sf2); } }

/* ---- ワークスペース ---- */
.wsp { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.wsBar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; flex-wrap: wrap; }
.wsT { display: flex; align-items: baseline; gap: 10px; }
.wsT h1 { font-size: 15px; }
.grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 10px; padding: 0 12px 12px; }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: 12px; background: var(--sf); border: 1px solid var(--line); overflow: hidden; transition: border-color 160ms ease, box-shadow 160ms ease; }
.pane.focus { border-color: color-mix(in srgb, var(--acc) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--acc) 25%, transparent); }
.paneH { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 10px; border-bottom: 1px solid var(--line); min-width: 0; box-shadow: inset 0 2px 0 var(--ic, transparent); }
.pn { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--sf3); color: var(--dim); font-size: 11px; font-weight: 600; flex: none; }
.pane.focus .pn { background: var(--acc); color: var(--acc-ink); }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); font-size: 12px; white-space: nowrap; flex: none; max-width: 40%; overflow: hidden; }
.crumb .cs { overflow: hidden; text-overflow: ellipsis; }
.crumb .sep { opacity: .6; }
.pt { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt.dim { color: var(--dim); font-weight: 500; }
.who { display: inline-flex; flex: none; }
.picker { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.pkI { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); overflow: hidden; }
.pkH { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pkT { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 12px; border: 0; background: transparent; color: var(--fg); text-align: left; transition: background-color 120ms ease; }
.pkT .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .pkT:hover { background: var(--sf2); } }
.pkN { padding: 10px 12px; }
/* システムを選ぶプルダウン。カバー画像があれば上に敷き、アイコンを下端に重ねる */
.pkSys { flex: none; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); overflow: hidden; }
.pkCv { display: block; width: 100%; aspect-ratio: 3 / 1; max-height: 160px; object-fit: cover; }
.pkSel { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 9px 12px; border: 0; background: transparent; color: var(--fg); text-align: left; transition: background-color 120ms ease; }
.pkSel .nm { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkSel .st, .pkSel .tag { flex: none; white-space: nowrap; }
.pkSel .chev { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--sf3); color: var(--fg2); flex: none; }
.pkSys.cv .pkSel { align-items: flex-end; padding-top: 0; }
.pkSys.cv .pkSel > .sicon { margin-top: -28px; box-shadow: 0 0 0 3px var(--bg2); }
@media (hover: hover) and (pointer: fine) { .pkSel:hover { background: var(--sf2); } .pkSel:hover .chev { color: var(--fg); } }
.sicon { display: inline-grid; place-items: center; flex: none; border-radius: 24%; object-fit: cover; background: var(--sf3); color: #fff; font-weight: 600; letter-spacing: 0; }
.menu.match { max-width: none; }
.mi .tag { margin-left: -3px; }

.sess { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.body { position: relative; flex: 1; min-height: 0; background: var(--doc, #1e1e1e); }
html[data-theme='light'] .body { background: #1e1e1e; }
.body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.body.dim { opacity: .7; }
.body .loading { color: #9aa0a8; }
.prev { position: absolute; left: 0; right: 0; bottom: 0; top: 40%; display: grid; place-items: center; background: linear-gradient(transparent, rgb(20 20 20 / .92) 40%); color: #bbb; font-size: 12.5px; }
.prev p { margin: 0; padding: 8px 12px; }
.jump { position: absolute; right: 14px; bottom: 14px; width: 36px; height: 36px; border-radius: 18px; border: 1px solid #444; background: #2a2a2a; color: #ddd; display: grid; place-items: center; box-shadow: 0 4px 14px rgb(0 0 0 / .4);
  transition: transform 120ms var(--ease); }
.jump:active { transform: scale(.94); }
.tip { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 6px 12px; border-radius: 8px; background: #333; color: #eee; font-size: 12px; pointer-events: none; }
.linkPop { position: absolute; width: 248px; padding: 8px; border-radius: 9px; background: var(--sf); border: 1px solid var(--line2); box-shadow: var(--sh); display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.linkPop .u { font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg2); }
.ovBox { position: absolute; inset: 12px; display: flex; flex-direction: column; border-radius: 10px; background: var(--sf); border: 1px solid var(--line2); box-shadow: var(--sh); overflow: hidden; z-index: 6; }
.ovH { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); }
.ovH .st { flex: 1; }
.ovBox iframe { flex: 1; border: 0; width: 100%; background: #1e1e1e; }
.notices { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px 0; }
.notice { display: flex; gap: 6px; align-items: flex-start; padding: 6px 8px; border-radius: 7px; background: var(--sf2); color: var(--fg2); font-size: 12px; }

/* 確認カード */
.prompt { margin: 8px 10px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--ask) 45%, var(--line)); background: color-mix(in srgb, var(--ask) 7%, var(--sf)); display: flex; flex-direction: column; gap: 8px; max-height: 45vh; overflow: auto; }
.pT { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ask); }
.pd { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; padding: 6px 8px; border-radius: 6px; background: var(--bg2); color: var(--fg2); max-height: 160px; overflow: auto; }
.plan { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.plan .pf { padding: 5px 8px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); border-bottom: 1px solid var(--line); }
.plan pre { margin: 0; padding: 8px; max-height: 220px; overflow: auto; font-size: 12px; white-space: pre-wrap; }
.opts { display: flex; flex-direction: column; gap: 4px; }
.opts button { display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--sf); color: var(--fg); text-align: left; transition: transform 120ms var(--ease), border-color 120ms ease; }
.opts button:active:not(:disabled) { transform: scale(.99); }
.opts button.yes { border-color: color-mix(in srgb, var(--ok) 55%, var(--line2)); }
.opts button.no { color: var(--fg2); }
.opts button.on { border-color: var(--acc); background: var(--acc-bg); }
.opts .num, .opts .ck { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--sf3); font-size: 11px; color: var(--dim); flex: none; margin-top: 1px; }
.opts .lb { display: flex; flex-direction: column; min-width: 0; }
.opts .ds { color: var(--dim); font-size: 12px; }
.qtabs { display: flex; gap: 4px; flex-wrap: wrap; }
.qtabs button { height: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line2); background: var(--sf); display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
.qtabs button.on { border-color: var(--acc); color: var(--acc); }
.pin { display: flex; gap: 6px; }
.roBar { display: flex; align-items: center; gap: 8px; margin: 8px 10px 10px; padding: 9px 12px; border-radius: 10px; border: 1px dashed var(--line2); color: var(--dim); font-size: 12.5px; }

/* 入力欄 */
.cmp { margin: 8px 10px 10px; padding: 8px 8px 6px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2); display: flex; flex-direction: column; gap: 4px; transition: border-color 120ms ease, box-shadow 120ms ease; }
.cmp:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-bg); }
.cmp textarea:focus { border-color: transparent; }
.cmp textarea { height: auto; min-height: 40px; max-height: 40vh; padding: 4px 6px; border: 0; background: transparent; resize: none; line-height: 1.55; box-shadow: none !important; }
.cmpBar { display: flex; align-items: center; gap: 4px; min-width: 0; }
.chip { height: 24px; max-width: 150px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line2); background: transparent; color: var(--fg2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto;
  transition: transform 120ms var(--ease), border-color 120ms ease; }
.chip:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--dim); color: var(--fg); } }
.ctx { font-size: 11px; color: var(--dim); padding: 0 4px; font-variant-numeric: tabular-nums; }
.sendB, .stopB { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 16px; border: 0; flex: none; transition: transform 120ms var(--ease), opacity 120ms ease; }
.sendB { background: var(--acc); color: var(--acc-ink); }
.sendB:disabled { opacity: .35; cursor: default; }
.stopB { background: var(--sf3); color: var(--fg); }
.sendB:active:not(:disabled), .stopB:active { transform: scale(.92); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 2px; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 2px 0 7px; border-radius: 11px; background: var(--sf3); font-size: 11.5px; color: var(--fg2); max-width: 220px; }
.pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 9px; background: transparent; color: var(--dim); }

/* ---- 知らせ・ダイアログ・メニュー ---- */
.toaster { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 8px; max-width: 380px; padding: 10px 14px; border-radius: 10px; background: var(--sf); border: 1px solid var(--line2); box-shadow: var(--sh); font-size: 12.5px; pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms var(--ease); }
@starting-style { .toast { opacity: 0; transform: translateY(8px); } }
.toast.out { opacity: 0; transform: translateY(4px); }
.toast.ok .ic { color: var(--ok); }
.toast.error { border-color: color-mix(in srgb, var(--bad) 50%, var(--line2)); }
.toast.error .ic { color: var(--bad); }
.toast.info .ic { color: var(--acc); }
.dlgBack { position: fixed; inset: 0; background: rgb(0 0 0 / .5); display: grid; place-items: center; padding: 20px; z-index: 90; transition: opacity 160ms ease; }
@starting-style { .dlgBack { opacity: 0; } }
.dlg { width: min(440px, 100%); max-height: calc(100vh - 40px); overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 14px; background: var(--sf); border: 1px solid var(--line2); box-shadow: var(--sh);
  transition: transform 180ms var(--ease), opacity 180ms ease; }
@starting-style { .dlg { transform: scale(.96); opacity: 0; } }
.dlg.wide { width: min(640px, 100%); }
.dlg h3 { margin: 0; font-size: 15px; }
.dlg .dtx { margin: 0; color: var(--fg2); font-size: 12.5px; white-space: pre-wrap; }
.past { display: flex; flex-direction: column; gap: 2px; max-height: 55vh; overflow: auto; margin: 0 -6px; }
.pastI { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; transition: background-color 120ms ease; }
.pastI .t { font-weight: 500; }
.pastI.on { background: var(--acc-bg); }
@media (hover: hover) and (pointer: fine) { .pastI:hover { background: var(--sf2); } }
.menu { position: fixed; min-width: 200px; max-width: 340px; max-height: 70vh; overflow: auto; padding: 4px; border-radius: 10px; background: var(--sf); border: 1px solid var(--line2); box-shadow: var(--sh); z-index: 95;
  opacity: 0; transform: scale(.97); }
.menu.in { opacity: 1; transform: none; transition: opacity 140ms ease, transform 160ms var(--ease); }
.mi { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 30px; padding: 4px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--fg); text-align: left; }
.mi .ml { flex: 1; min-width: 0; }
.mi .mk { color: var(--dim); font-size: 11.5px; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.mi.danger { color: var(--bad); }
.mi.on { color: var(--acc); }
.mi:disabled { opacity: .45; }
.mi .ic { color: var(--dim); }
.mi.danger .ic, .mi.on .ic { color: inherit; }
@media (hover: hover) and (pointer: fine) { .mi:hover:not(:disabled) { background: var(--sf3); } }
.mh { padding: 6px 9px 4px; font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msep { height: 1px; margin: 4px 2px; background: var(--line); }

/* 狭い画面では列を 1 つずつ出し、上のタブで切り替える */
.paneTabs { display: none; }
/* ---- 狭い画面 ---- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .navBtn { display: inline-grid; }
  .side { position: fixed; top: 48px; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-102%); transition: transform 220ms var(--ease); }
  .shell.navOpen .side { transform: none; }
  .shell.navOpen .navScrim { display: block; position: fixed; inset: 48px 0 0 0; background: rgb(0 0 0 / .4); z-index: 40; }
  .hideSm { display: none !important; }
  .grid { grid-template-columns: 1fr; }
  .grid .pane:not(.focus) { display: none; }
  .wsBar .seg { display: none; }
  .paneTabs { display: flex; gap: 6px; padding: 0 12px 8px; overflow-x: auto; }
  .paneTabs button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 6px; border-radius: 8px; border: 1px solid var(--line2); background: var(--sf); color: var(--fg2); max-width: 60vw; flex: none; }
  .paneTabs button.on { border-color: var(--acc); color: var(--fg); }
  .paneTabs .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .paneTabs button.on .pn { background: var(--acc); color: var(--acc-ink); }
  .page { padding: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: 1fr; }
  .scopeBtn .sl { max-width: 40vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
  .dot.work { animation: none; }
}
