/* SPDX-License-Identifier: LicenseRef-genai-craft-proprietary */
/* Copyright (c) 2026 genai-craft (生成AI工房). Kotohako OS */
/* AI Appliance OS desktop shell — 画面図 (アプリセンター) 準拠 */
:root {
  --bg1: #1a2a4a; --bg2: #3c6fa8; --bg3: #b9d3ea; --panel: rgba(255,255,255,.92); --panel-solid: #fff; --text: #1d2433; --muted: #6b7484;
  --line: #e4e8ef; --accent: #2f6bff; --accent-2: #1d8cf8; --ok: #16a34a; --warn: #f59e0b; --err: #e5484d; --radius: 14px; --shadow: 0 18px 50px rgba(10,20,40,.28);
  --font: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); color: var(--text); font-size: 14px; background: #0f1a2e; overflow: hidden; }
button { font-family: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }

/* 壁紙 (外部画像なし) */
#desktop { position: fixed; inset: 0; background: radial-gradient(1200px 600px at 75% 15%, #ffd7a8 0%, rgba(255,215,168,0) 60%), linear-gradient(180deg, #2a4a7a 0%, #5d8fc4 40%, #a9c7e3 62%, #6f93b4 63%, #3f5f86 100%); }
#desktop::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%; background:
  linear-gradient(170deg, transparent 55%, rgba(20,40,70,.55) 56%), linear-gradient(190deg, transparent 60%, rgba(30,55,90,.6) 61%), linear-gradient(180deg, rgba(120,160,200,.25), rgba(30,50,80,.9)); }
#desktop .tagline { position: absolute; right: 36px; bottom: 34px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.4); font-size: 16px; line-height: 1.5; text-align: left; }
#desktop .tagline small { display: block; font-size: 13px; opacity: .85; margin-top: 4px; }

/* topbar */
#topbar { position: fixed; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: rgba(8,16,32,.72); color: #fff; backdrop-filter: blur(10px); z-index: 1000; }
#topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; min-width: 190px; }
#topbar .brand .logo { width: 30px; height: 30px; border-radius: 8px; display: block; object-fit: cover; }
#topbar .search .si { opacity: .65; vertical-align: -3px; margin-right: 2px; }
#topbar .icon-btn img { display: block; margin: 0 auto; opacity: .92; }
#topbar .search { flex: 0 1 360px; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border-radius: 10px; padding: 7px 12px; color: #cfd6e4; }
#topbar .search input { background: transparent; border: 0; color: #fff; outline: 0; width: 100%; font-size: 14px; }
#topbar .spacer { flex: 1; }
#topbar .icon-btn { position: relative; background: transparent; border: 0; color: #e6ebf5; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 17px; }
#topbar .icon-btn:hover { background: rgba(255,255,255,.12); }
#topbar .badge { position: absolute; top: 3px; right: 3px; background: var(--err); color: #fff; font-size: 10px; border-radius: 9px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }
#topbar .clock { font-size: 13px; color: #dbe3f0; padding: 0 10px; border-left: 1px solid rgba(255,255,255,.18); }
#topbar .user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
#topbar .user:hover { background: rgba(255,255,255,.12); }
#topbar .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #818cf8, #2f6bff); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }

/* dock (左) */
#dock { position: fixed; top: 64px; left: 12px; bottom: 12px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, var(--dock-cell-h)); grid-auto-columns: var(--dock-cell-w); align-content: start; gap: 10px 6px; z-index: 100; touch-action: none; --dock-cell-w: 92px; --dock-cell-h: 78px; }  /* 升目に並べる: 行の高さをどの列でもそろえる (前は縦に詰めて折り返していて、1 列目だけ「すべて」の線のぶんずれた)。高さが足りなければ 2 列以上 */
#dock .dock-item, #dock .dock-tail { width: auto; min-width: 0; flex: none; }
#dock .dock-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: calc(var(--dock-cell-w) - 6px); }
/* 2 列以上に折り返したときは少し小さく (画面を取りすぎない) */
#dock.multi { --dock-cell-w: 68px; --dock-cell-h: 68px; } #dock.multi .dock-item, #dock.multi .dock-tail { font-size: 11px; }
#dock.multi .app-icon { width: 40px; height: 40px; font-size: 17px; }
#dock .dock-item { user-select: none; -webkit-user-drag: none; display: flex; flex-direction: column; align-items: center; gap: 5px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); font-size: 12px; cursor: pointer; padding: 4px; border-radius: 10px; border: 0; background: transparent; }
#dock .dock-item:hover { background: rgba(255,255,255,.15); }
#dock .dock-item.trash { grid-column: 1; grid-row: -2 / -1; } /* ゴミ箱は 1 列目のいちばん下 */
.app-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px; box-shadow: 0 6px 16px rgba(0,0,0,.25); position: relative; overflow: hidden; flex: 0 0 auto; }
.app-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.app-icon.sm { width: 34px; height: 34px; border-radius: 9px; font-size: 15px; }
.app-icon.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 26px; }
.app-icon.dim { filter: grayscale(.6); opacity: .8; }

#dock .dock-item.dragging { opacity: .35; } .dock-ghost { position: fixed; z-index: 5000; border: 0; background: transparent; padding: 4px; pointer-events: none; opacity: .92; transform: scale(1.06); filter: drop-shadow(0 8px 16px rgba(0,0,0,.45)); display: flex; flex-direction: column; align-items: center; gap: 5px; color: #fff; font-size: 12px; text-shadow: 0 1px 6px rgba(0,0,0,.6); } #dock .dock-item.trash.dropover { background: rgba(255,80,80,.35); outline: 2px solid #ffb3b3; } #dock .dock-item.dropover { outline: 2px solid #fff; outline-offset: -2px; background: rgba(255,255,255,.2); }
#dock .dock-tail { min-height: 24px; border-radius: 10px; } #dock .dock-tail.dropover { background: rgba(255,255,255,.15); outline: 2px dashed rgba(255,255,255,.6); }
#dock .dock-item.allapps::before { content: ''; position: absolute; left: 14%; right: 14%; bottom: -5px; height: 1px; background: rgba(255,255,255,.3); } /* 線はすき間に描く (高さを変えない) */
.ctx-menu { position: fixed; z-index: 4000; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 6px; min-width: 180px; display: flex; flex-direction: column; }
.ctx-menu button { text-align: left; border: 0; background: transparent; padding: 8px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); } .ctx-menu button:hover { background: #f1f3f8; }

/* 右ウィジェット */
/* 列は画面の高さに収める。はみ出す分は「AI に聞く」の本文を縮めて吸収し (chat.js の fitWidgets、最小 96px)、それでも足りなければ列ごとスクロール (下の混み具合が隠れないように)。
   影が切れないよう左右と下に余白を持たせ、その分 right と width で位置を合わせる */
#widgets { position: fixed; top: 68px; right: 10px; width: 320px; box-sizing: border-box; padding: 4px 10px 18px; max-height: calc(100vh - 68px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; display: flex; flex-direction: column; gap: 14px; z-index: 100; }
#widgets > .widget { flex: 0 0 auto; }
.widget { background: var(--panel); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.widget h3 { margin: 0 0 10px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.widget h3 a { font-size: 12px; font-weight: 400; text-decoration: none; }
.status-line { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 10px; }
.status-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; }
.status-dot.ok { background: var(--ok); } .status-dot.warning { background: var(--warn); } .status-dot.critical { background: var(--err); }
.metric { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.metric .ic img { width: 18px; height: 18px; display: block; }
.metric .ic { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid #c9d2e0; display: grid; place-items: center; font-size: 14px; color: #556; }
.metric .lbl { flex: 1; } .metric .lbl b { display: block; font-size: 13px; } .metric .lbl span { font-size: 12px; color: var(--muted); }
.ring { --p: 0; --c: var(--accent); width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), #e6eaf1 0); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.ring::before { content: attr(data-v); width: 36px; height: 36px; border-radius: 50%; background: var(--panel-solid); display: grid; place-items: center; }
.activity { display: flex; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.activity .app-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.activity small { display: block; color: var(--muted); font-size: 11px; }

/* windows: resize handles */
.window .rs { position: absolute; z-index: 5; }
.window .rs-n { top: -3px; left: 14px; right: 14px; height: 6px; cursor: ns-resize; } .window .rs-s { bottom: -3px; left: 14px; right: 14px; height: 6px; cursor: ns-resize; }
.window .rs-e { right: -3px; top: 14px; bottom: 14px; width: 6px; cursor: ew-resize; } .window .rs-w { left: -3px; top: 14px; bottom: 14px; width: 6px; cursor: ew-resize; }
.window .rs-ne { top: -4px; right: -4px; width: 14px; height: 14px; cursor: nesw-resize; } .window .rs-sw { bottom: -4px; left: -4px; width: 14px; height: 14px; cursor: nesw-resize; }
.window .rs-nw { top: -4px; left: -4px; width: 14px; height: 14px; cursor: nwse-resize; } .window .rs-se { bottom: -4px; right: -4px; width: 14px; height: 14px; cursor: nwse-resize; }
.window.maximized .rs { display: none; }
.window.resizing iframe { pointer-events: none; }  /* iframe 上でも pointer を離さない */
.window .titlebar { user-select: none; }

/* windows */
.window { position: fixed; background: var(--panel-solid); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 420px; min-height: 260px; overflow: hidden; z-index: 500; }
.window.maximized { inset: 60px 12px 12px var(--dock-w, 116px) !important; width: auto !important; height: auto !important; }
.window .titlebar { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px; background: #f3f5f9; border-bottom: 1px solid var(--line); cursor: move; user-select: none; }
.window .titlebar .app-icon { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; box-shadow: none; }
.window .titlebar .title { flex: 1; font-weight: 600; font-size: 14px; }
.window .titlebar button { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; font-size: 15px; color: #445; }
.window .titlebar button:hover { background: #e3e7ee; } .window .titlebar button.close:hover { background: #ffe3e3; color: var(--err); }
.window .body { flex: 1; display: flex; min-height: 0; }
.window .sidebar { width: 200px; border-right: 1px solid var(--line); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; background: #fafbfd; flex-shrink: 0; }
.window .sidebar .sep { height: 1px; background: var(--line); margin: 8px 4px; }
.window .sidebar .side-section { font-size: 11px; font-weight: 700; color: var(--sub); padding: 2px 12px 4px; letter-spacing: .02em; } .window .sidebar.collapsed .side-section { display: none; }
.window .sidebar button { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: #2a3140; display: flex; align-items: center; gap: 8px; }
.window .sidebar button.active { background: #e8efff; color: var(--accent); font-weight: 600; }
.window .sidebar button .pill { margin-left: auto; background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; }
.window .content { flex: 1; overflow: auto; padding: 22px 26px; min-width: 0; }
.content h1 { font-size: 24px; margin: 0 0 4px; } .content .sub { color: var(--muted); margin: 0 0 18px; }
.content h2 { font-size: 16px; margin: 22px 0 10px; } .content h2:first-child { margin-top: 0; }

/* 汎用部品 */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.card.app { display: flex; flex-direction: column; gap: 10px; }
.grid.apps { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card.app .head { display: flex; gap: 12px; align-items: flex-start; }
.card.app .head b { font-size: 15px; display: block; margin-bottom: 3px; } .card.app .head span { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.card.app .foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.btn { border: 1px solid #cfd6e2; background: #fff; color: #1d2433; border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.btn:hover { background: #f3f5f9; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); } .btn.primary:hover { background: #2559d9; }
.btn.soft { background: #e8efff; color: var(--accent); border-color: transparent; }
.btn.danger { background: #fff1f1; color: var(--err); border-color: #f5c2c2; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.tag { display: inline-block; background: #eef1f6; color: #465; border-radius: 6px; padding: 2px 8px; font-size: 11.5px; margin-right: 4px; }
.tag.installed { background: #eef1f6; color: #556; } .tag.p1 { background: #fff4e0; color: #9a5b00; }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 12px; background: #eef1f6; color: #445; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #99a; }
.state.Succeeded { background: #e6f6ea; color: #15803d; } .state.Succeeded::before { background: var(--ok); }
.state.Running, .state.Assigned { background: #e8efff; color: #1d4ed8; } .state.Running::before, .state.Assigned::before { background: var(--accent); animation: pulse 1s infinite; }
.state.Queued, .state.Draft, .state.Paused, .state.RetryWait { background: #f2f4f8; color: #556; }
.state.AwaitingApproval { background: #fff4e0; color: #9a5b00; } .state.AwaitingApproval::before { background: var(--warn); }
.state.Failed { background: #fee; color: #b91c1c; } .state.Failed::before { background: var(--err); }
.state.Partial { background: #fff4e0; color: #9a5b00; } .state.Partial::before { background: var(--warn); }
.state.Cancelled { background: #eee; color: #777; }
@keyframes pulse { 50% { opacity: .3; } }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tr.clickable:hover td { background: #f6f8fc; cursor: pointer; }
input.inp, textarea.inp, select.inp { width: 100%; border: 1px solid #cfd6e2; border-radius: 9px; padding: 9px 12px; font-size: 14px; font-family: inherit; outline: 0; background: #fff; }
input.inp:focus, textarea.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,107,255,.15); }
textarea.inp { min-height: 96px; resize: vertical; }
label.lbl { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 5px; }
.notice { border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 10px 0; border: 1px solid; }
.notice.info { background: #eef4ff; border-color: #c7d7ff; color: #1e3a8a; } .notice.warn { background: #fff7e6; border-color: #fcd9a0; color: #7c4a00; } .notice.err { background: #fff1f1; border-color: #f5c2c2; color: #991b1b; } .notice.ok { background: #ecfdf3; border-color: #b7e4c7; color: #14532d; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.progress { height: 6px; background: #e6eaf1; border-radius: 3px; overflow: hidden; } .progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 12.5px; } .timeline li { padding: 6px 0 6px 18px; border-left: 2px solid var(--line); position: relative; } .timeline li::before { content: ""; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: #c8d0dc; }
.timeline li.ok::before { background: var(--ok); } .timeline li.err::before { background: var(--err); } .timeline li.warn::before { background: var(--warn); }
.timeline time { color: var(--muted); margin-right: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; background: #f6f8fb; border-radius: 8px; padding: 10px 12px; max-height: 360px; overflow: auto; }
.chat { display: flex; gap: 10px; align-items: flex-end; }
.chat textarea { flex: 1; }
.preview-frame { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.dropzone { border: 2px dashed #c9d2e0; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); }
.dropzone.over { border-color: var(--accent); background: #eef4ff; }
.gpu-bar { display: grid; grid-template-columns: 90px 1fr 60px 60px 60px; gap: 8px; align-items: center; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.spark { width: 100%; height: 34px; }

/* modal / toast */
#modal { position: fixed; inset: 0; background: rgba(10,20,40,.45); display: grid; place-items: center; z-index: 2000; }
#modal .dialog { background: #fff; border-radius: 14px; width: min(560px, 92vw); max-height: 86vh; overflow: auto; padding: 22px 24px; box-shadow: var(--shadow); }
#modal h2 { margin: 0 0 8px; font-size: 18px; }
#toasts { position: fixed; right: 20px; bottom: 90px; display: flex; flex-direction: column; gap: 8px; z-index: 3000; }
.toast { background: #1d2433; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: 360px; }
.toast.err { background: #b91c1c; } .toast.ok { background: #15803d; } .toast.warn { background: #b45309; }
#notif-panel { position: fixed; top: 56px; right: 120px; width: 340px; max-height: 70vh; overflow: auto; z-index: 1500; }

/* login / setup */
#login { position: fixed; inset: 0; display: grid; place-items: center; z-index: 1200; background: linear-gradient(180deg, #223d66, #5d8fc4 60%, #a9c7e3); }
#login .box { background: #fff; border-radius: 18px; padding: 30px 32px; width: min(460px, 94vw); box-shadow: var(--shadow); }
#login .box h1 { font-size: 22px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
#login .steps { display: flex; gap: 6px; margin: 14px 0 6px; } #login .steps i { flex: 1; height: 4px; border-radius: 2px; background: #e6eaf1; } #login .steps i.on { background: var(--accent); }

@media (max-width: 900px) {
  #dock { top: auto; bottom: 0; left: 0; right: 0; width: auto; display: flex; flex-direction: row; overflow-x: auto; padding: 6px 8px; background: rgba(8,16,32,.7); gap: 4px; }
  #dock .dock-item { min-width: 64px; } #dock .dock-item.trash { grid-column: auto; grid-row: auto; } #dock .dock-item.allapps::before { display: none; } .app-icon { width: 40px; height: 40px; }
  #widgets { display: none; } #topbar .search { display: none; } #topbar .clock { display: none; }
  .window { inset: 52px 0 74px 0 !important; width: auto !important; height: auto !important; border-radius: 0; min-width: 0; }
  .window .sidebar { width: 56px; padding: 8px 4px; } .window .sidebar button span.txt { display: none; } .window .sidebar .pill { display: none; }
  .window .content { padding: 14px 16px; } .kv { grid-template-columns: 1fr; } #desktop .tagline { display: none; }
}
/* 「オンプレ版」バッジ: アプリ版 (App Store / Google Play) があるアプリに付ける */
.ed-badge { display: inline-block; vertical-align: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; color: #1d4ed8; background: #e8efff; border: 1px solid #c7d7fe; border-radius: 6px; padding: 1px 6px; white-space: nowrap; cursor: help; }
.ed-badge.big { font-size: 12px; padding: 2px 9px; }
/* 遠隔サポート中のバナー: 全画面・全ウィンドウより手前。誰が見ても「いま繋がっている」と分かる */
#support-banner { position: fixed; left: 50%; transform: translateX(-50%); top: 58px; z-index: 5000; display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 12px; border-radius: 12px; background: #fff7ed; border: 1px solid #fdba74; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 13px; color: #7c2d12; max-width: min(96vw, 980px); }
#support-banner.paired { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
#support-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: #f97316; animation: sb-pulse 1.4s ease-in-out infinite; flex: 0 0 auto; } #support-banner.paired .dot { background: #dc2626; }
@keyframes sb-pulse { 0%,100% { opacity: .35 } 50% { opacity: 1 } }
#support-banner b { font-weight: 700 } #support-banner .code { font-family: ui-monospace, Menlo, monospace; font-size: 18px; letter-spacing: 3px; background: #fff; border: 1px solid #fdba74; border-radius: 8px; padding: 2px 10px; color: #9a3412 }
#support-banner .meta { color: #9a3412; opacity: .9 } #support-banner.paired .meta { color: #991b1b }
#support-banner .btn.sm { padding: 4px 10px }
.sup-act { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px } .sup-act div { padding: 3px 6px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis } .sup-act .deny { color: #b91c1c }
.sup-code { font-family: ui-monospace, Menlo, monospace; font-size: 40px; letter-spacing: 8px; font-weight: 700; color: #1e293b; background: #f8fafc; border: 2px dashed #cbd5e1; border-radius: 14px; padding: 12px 22px; display: inline-block }

/* ---- ファイルビューワー: ファイルを大きく、道具は脇に ---- */
#modal .dialog.viewer-dialog { width: min(1280px, 96vw); max-height: 92vh; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.viewer { display: flex; flex-direction: column; height: 92vh; max-height: 92vh; }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.viewer-title { display: flex; align-items: center; gap: 10px; min-width: 0; } .viewer-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-body { display: flex; flex: 1; min-height: 0; }
.viewer-stage { flex: 1; min-width: 0; overflow: auto; display: flex; flex-direction: column; align-items: stretch; background: #fff; }
.viewer-side { width: 360px; flex: 0 0 360px; border-left: 1px solid var(--line); background: #fafbfd; padding: 14px; overflow: auto; }
.viewer-side.hidden { display: none; }
.viewer-media { max-width: 100%; max-height: 100%; margin: auto; display: block; object-fit: contain; background: #111; }
.viewer-stage > img.viewer-media { background: transparent; }
.viewer-frame { width: 100%; height: 100%; border: 0; flex: 1; }
.viewer-out { white-space: pre-wrap; max-height: 40vh; overflow: auto; margin-top: 8px; font-size: 12.5px; }
.viewer-editor { width: 100%; height: calc(92vh - 170px); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.col { display: flex; flex-direction: column; }
/* Markdown / 文書のプレビュー */
article.md { max-width: 860px; width: 100%; margin: 0 auto; padding: 28px 40px 60px; font-size: 15px; line-height: 1.75; color: #1f2937; }
article.md.plain pre { background: none; border: 0; padding: 0; font-size: 13.5px; }
article.md h1 { font-size: 26px; margin: 8px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
article.md h2 { font-size: 21px; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
article.md h3 { font-size: 17px; margin: 20px 0 8px; } article.md h4, article.md h5, article.md h6 { font-size: 15px; margin: 16px 0 6px; }
article.md p { margin: 0 0 12px; } article.md ul, article.md ol { margin: 0 0 12px; padding-left: 26px; } article.md li { margin: 3px 0; }
article.md code { background: #f3f4f6; border-radius: 4px; padding: 1px 5px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
article.md pre { background: #0f172a; color: #e5e7eb; border-radius: 8px; padding: 12px 14px; overflow: auto; margin: 0 0 14px; } article.md pre code { background: none; color: inherit; padding: 0; font-size: 13px; }
article.md blockquote { border-left: 4px solid #c7d2fe; margin: 0 0 12px; padding: 4px 14px; color: #4b5563; background: #f8fafc; }
article.md table { border-collapse: collapse; margin: 0 0 14px; width: auto; max-width: 100%; display: block; overflow: auto; }
article.md th, article.md td { border: 1px solid #e5e7eb; padding: 6px 10px; text-align: left; vertical-align: top; } article.md th { background: #f3f4f6; }
article.md hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
article.md img { max-width: 100%; border-radius: 6px; }
article.md a { color: #2563eb; }
article.md section.slide { border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 0 0 14px; background: #fff; }

/* ---- AI NAS エクスプローラー ---- */
.content.exp-host { padding: 0; display: flex; flex-direction: column; }
.exp { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; }
.exp-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fafbfd; flex-wrap: wrap; }
.exp-crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; min-width: 0; } .exp-crumbs a { color: var(--muted); text-decoration: none; } .exp-crumbs a:hover { color: var(--text); text-decoration: underline; } .exp-crumbs .sep { color: #b6bfcd; } .exp-crumbs b { white-space: nowrap; }
.exp-search { width: 200px; font-size: 13px; padding: 5px 9px; }
.exp-body { display: flex; flex: 1; min-height: 0; }
.exp-tree { width: 200px; flex: 0 0 200px; border-right: 1px solid var(--line); overflow: auto; padding: 8px 6px; background: #fafbfd; font-size: 13px; }
.exp-group { color: var(--muted); font-size: 11px; letter-spacing: .04em; padding: 10px 10px 4px; } .exp-group:first-child { padding-top: 2px; }
.exp-node { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; cursor: pointer; white-space: nowrap; overflow: hidden; } .exp-node:hover { background: #eef1f6; } .exp-node.active { background: #e3ebff; color: #1d4ed8; font-weight: 600; } .exp-node.dim { color: var(--muted); }
.exp-node .lbl { overflow: hidden; text-overflow: ellipsis; } .exp-node .ico { width: 18px; text-align: center; flex: 0 0 18px; }
.exp-main { flex: 1; min-width: 0; overflow: auto; padding: 10px; outline: none; position: relative; } .exp-main.over { background: #eef4ff; box-shadow: inset 0 0 0 2px #2f6bff; }
.exp-main.grid { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; }
.exp-item { width: 104px; height: 118px; display: flex; flex-direction: column; align-items: center; padding: 8px 4px 4px; border-radius: 8px; cursor: default; text-align: center; user-select: none; position: relative; }
.exp-item:hover { background: #f1f3f8; } .exp-item.sel, .exp-table tr.sel { background: #dbe6ff; } .exp-item:focus, .exp-table tr:focus { outline: 1px solid #93b4ff; }
.exp-item .ico { font-size: 40px; line-height: 1; height: 56px; display: flex; align-items: center; justify-content: center; }
.exp-item .thumb { width: 72px; height: 56px; object-fit: cover; border-radius: 5px; background: #eef1f6; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.exp-item .name { font-size: 12px; line-height: 1.3; margin-top: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; width: 100%; }
.exp-item .meta { font-size: 11px; color: var(--muted); } .exp-item .flag, .exp-table .flag { color: #b45309; font-size: 12px; } .exp-item .flag { position: absolute; top: 6px; right: 8px; }
.exp-table { width: 100%; border-collapse: collapse; font-size: 13px; } .exp-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 4px 8px; border-bottom: 1px solid var(--line); position: sticky; top: -10px; background: #fff; user-select: none; }
.exp-table td { padding: 5px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 480px; } .exp-table tr { cursor: default; user-select: none; } .exp-table tbody tr:hover, .exp-table tr:not(:first-child):hover { background: #f1f3f8; }
.exp-table .num { text-align: right; } .exp-table .dim, .exp-status .dim { color: var(--muted); } .exp-table td .ico { display: inline-block; width: 20px; text-align: center; }
.exp-empty { color: var(--muted); padding: 60px 20px; text-align: center; width: 100%; }
.exp-status { display: flex; gap: 4px; align-items: center; padding: 5px 12px; border-top: 1px solid var(--line); font-size: 12px; background: #fafbfd; color: var(--text); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; } .ctx-menu button.danger { color: #b91c1c; }
@media (max-width: 720px) { .exp-tree { display: none; } .exp-search { width: 120px; } }
/* サイドメニューの折りたたみ (アイコンだけのレール) */
.window .sidebar .grow { flex: 1; } .window .sidebar .nav-toggle { color: var(--muted); font-size: 16px; padding: 4px 10px; justify-content: flex-end; }
.window .sidebar.collapsed { width: 46px; padding: 10px 5px; } .window .sidebar.collapsed button { padding: 8px 0; justify-content: center; } .window .sidebar.collapsed button .txt, .window .sidebar.collapsed .pill { display: none; }
.window .sidebar button .ico { width: 18px; text-align: center; flex: 0 0 18px; }
/* エクスプローラーのヘッダーは 1 行に収める */
.exp-toolbar { flex-wrap: nowrap; padding: 6px 10px; gap: 8px; }
.exp-crumbs { flex: 1 1 auto; overflow: hidden; white-space: nowrap; font-size: 13.5px; } .exp-crumbs b, .exp-crumbs a { overflow: hidden; text-overflow: ellipsis; }
.exp-tools { display: flex; align-items: center; gap: 5px; flex: 0 1 auto; min-width: 0; } .exp-tools > * { flex: 0 0 auto; white-space: nowrap; } .exp-tools .btn, .exp-tools label.btn { white-space: nowrap; line-height: 1.4; }
/* 絞り込み欄は input.inp の width:100% より優先して短く。狭い窓では縮む */
.exp-tools input.exp-search { width: 150px; flex: 0 1 150px; min-width: 70px; } .exp-tools select.inp { width: auto; flex: 0 1 auto; min-width: 0; }
.exp { overflow: hidden; } .exp-status > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.exp-tools .inp { padding: 4px 8px; font-size: 12.5px; border-radius: 7px; } .exp-search { width: 150px; } .exp-tools select.inp { width: auto; max-width: 110px; }
.exp-tools .btn.sm { padding: 4px 9px; font-size: 12.5px; }
@media (max-width: 900px) { .exp-tools input.exp-search { width: 100px; flex-basis: 100px; } .exp-tools select.inp { display: none; } }
/* 壁紙を変えたときは既定の丘のシルエットを消す */
#desktop.custom-wall::before { display: none; }
#desktop.custom-wall .tagline { text-shadow: 0 2px 14px rgba(0,0,0,.7); }
/* アプリカードの足元: ボタンの文字を折り返さない (タグが多いカードで「開 / く」と割れていた) */
.card.app .foot .btn { white-space: nowrap; flex: none; }
.card.app .foot { flex-wrap: wrap; gap: 6px; }

/* 上部バーの GPU 用途チップ */
#topbar .gpu-chip { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.12); color: #e6ebf5; border: 0; border-radius: 10px; padding: 6px 10px; font-size: 12.5px; cursor: pointer; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topbar .gpu-chip:hover { background: rgba(255,255,255,.2); }
#topbar .gpu-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
#topbar .gpu-chip.switching .dot { background: transparent; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: gpuspin .9s linear infinite; }
@keyframes gpuspin { to { transform: rotate(360deg); } }
@media (max-width: 900px) { #topbar .gpu-chip .txt { display: none; } #topbar .gpu-chip { padding: 6px 8px; } }

/* ---- AI チャット (ui/chat.js): AI Desk › チャット とデスクトップのウィジェット ---- */
.content.kc-host { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.kc-desk { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr; position: relative; }
.kc-side { border-right: 1px solid var(--line); background: #f7f9fc; display: flex; flex-direction: column; gap: 8px; padding: 12px; min-height: 0; }
.kc-new { width: 100%; }
.kc-q { padding: 6px 10px; font-size: 13px; }
.kc-convs { flex: 1; overflow: auto; margin: 0 -4px; }
.kc-conv { position: relative; padding: 8px 28px 8px 10px; border-radius: 8px; cursor: pointer; margin: 0 4px 2px; }
.kc-conv:hover { background: #eaf0fb; } .kc-conv.active { background: #dfe9ff; }
.kc-conv-t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-conv-p { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-del { position: absolute; right: 4px; top: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; width: 22px; height: 22px; border-radius: 6px; opacity: 0; }
.kc-conv:hover .kc-del { opacity: 1; } .kc-del:hover { background: #fde2e2; color: var(--err); }
.kc-empty-list { padding: 8px 10px; }
.kc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.kc-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); min-height: 46px; }
.kc-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.kc-sidebtn { display: none; }
.kc-scroll { flex: 1; overflow: auto; min-height: 0; }
.kc-thread { max-width: 820px; margin: 0 auto; padding: 18px 22px 8px; display: flex; flex-direction: column; gap: 16px; }
.kc-bottom { border-top: 1px solid var(--line); padding: 10px 18px 14px; }
.kc-bottom > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.kc-desk.narrow { grid-template-columns: 1fr; }
.kc-desk.narrow .kc-side { position: absolute; z-index: 5; left: 0; top: 0; bottom: 0; width: 260px; box-shadow: 6px 0 24px rgba(0,0,0,.15); transform: translateX(-105%); transition: transform .18s; }
.kc-desk.narrow.side-open .kc-side { transform: none; }
.kc-desk.narrow .kc-sidebtn { display: inline-block; }
.kc-desk.narrow .kc-thread { padding: 14px 12px 6px; } .kc-desk.narrow .kc-bottom { padding: 8px 10px 10px; }
.kc-msg.user { display: flex; justify-content: flex-end; }
.kc-bubble { background: #eef3ff; border-radius: 14px 14px 4px 14px; padding: 9px 14px; max-width: 80%; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.kc-msg.ai { display: flex; gap: 10px; align-items: flex-start; }
.kc-av { flex: 0 0 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg,#3b82f6,#2563eb); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.kc-col { flex: 1; min-width: 0; }
.kc-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 5px 0; }
.kc-spin { width: 14px; height: 14px; border: 2px solid #c9d6ef; border-top-color: var(--accent); border-radius: 50%; animation: kc-spin .8s linear infinite; flex: 0 0 auto; }
@keyframes kc-spin { to { transform: rotate(360deg); } }
.kc-note { font-size: 12px; color: #9a5b00; background: #fff7e6; border-radius: 6px; padding: 4px 8px; margin: 6px 0; }
.kc-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.kc-mini { border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 11.5px; padding: 2px 8px; cursor: pointer; color: #556; }
.kc-mini:hover { background: #f2f5fa; }
.kc-meta { font-size: 11.5px; color: var(--muted); }
.kc-srcs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 2px; }
.kc-srcs-h { font-size: 11.5px; color: var(--muted); }
.kc-src { display: inline-flex; gap: 6px; align-items: center; max-width: 100%; font-size: 12px; text-decoration: none; color: #345; background: #f2f5fa; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-src:hover { background: #e8eefb; }
.kc-src b { background: #dfe7f7; color: #2c4a8a; border-radius: 5px; padding: 0 5px; font-size: 11px; }
.kc-cite { display: inline-block; min-width: 16px; padding: 0 4px; margin: 0 1px; font-size: 10.5px; line-height: 15px; text-align: center; vertical-align: 2px; border-radius: 5px; background: #dfe7f7; color: #2c4a8a !important; text-decoration: none; }
.kc-composer { border: 1px solid #cfd6e2; border-radius: 12px; background: #fff; padding: 8px 10px 6px; }
.kc-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.kc-input { width: 100%; border: 0; outline: 0; resize: none; font: inherit; font-size: 14px; line-height: 1.55; background: transparent; max-height: 220px; }
.kc-crow { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.kc-mode { border: 1px solid var(--line); background: #f7f9fc; border-radius: 7px; font-size: 12px; padding: 3px 6px; color: #445; }
.kc-hint { font-size: 11px; color: var(--muted); }
.kc-send { min-width: 64px; }
.kc-webnote { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kc-hello { text-align: center; padding: 48px 10px 10px; }
.kc-hello-t { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.kc-sugg { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.kc-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; color: #334; }
.kc-chip:hover { background: #eef3ff; border-color: #c9d6f5; }
/* Markdown */
.md { line-height: 1.7; word-break: break-word; }
.md p { margin: 0 0 .7em; } .md p:last-child { margin-bottom: 0; }
.md h3, .md h4, .md h5, .md h6 { margin: 1em 0 .4em; font-size: 15px; } .md h3 { font-size: 16.5px; }
.md ul, .md ol { margin: .2em 0 .8em; padding-left: 1.5em; } .md li { margin: .15em 0; }
.md code { background: #f0f2f6; border-radius: 4px; padding: 1px 5px; font-size: 12.5px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.md blockquote { margin: .5em 0; padding: 2px 12px; border-left: 3px solid #cfd6e2; color: #556; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.md a { word-break: break-all; }
.kc-code { margin: .6em 0; border-radius: 10px; overflow: hidden; border: 1px solid #1f2937; }
.kc-code-h { display: flex; justify-content: space-between; align-items: center; background: #1f2937; color: #cbd5e1; font-size: 11.5px; padding: 4px 10px; }
.kc-copy { background: transparent; border: 1px solid #475569; color: #e2e8f0; border-radius: 6px; font-size: 11px; padding: 1px 8px; cursor: pointer; }
.kc-code pre { margin: 0; background: #111827; color: #e5e7eb; padding: 10px 12px; overflow: auto; }
.kc-code pre code { background: transparent; color: inherit; padding: 0; font-size: 12.5px; }
.kc-table { overflow: auto; margin: .6em 0; }
.kc-table table { border-collapse: collapse; font-size: 13px; }
.kc-table th, .kc-table td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; vertical-align: top; }
.kc-table th { background: #f4f6fa; }
/* ウィジェット */
.kc-widget .kc-composer { padding: 6px 8px 5px; border-radius: 10px; }
.kc-widget .kc-input { font-size: 13px; }
.kc-widget .kc-send { min-width: 52px; padding: 4px 10px; font-size: 12px; }
.kc-widget .kc-mode { font-size: 11px; padding: 2px 4px; }
.kc-wbody { max-height: 300px; overflow: auto; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.kc-thread.compact { padding: 0; gap: 8px; max-width: none; }
.kc-thread.compact .kc-bubble { font-size: 12.5px; padding: 6px 10px; max-width: 92%; }
.kc-thread.compact .md { font-size: 13px; line-height: 1.6; }
.kc-srcs.compact .kc-src { font-size: 11px; padding: 1px 6px; }
.kc-wfoot { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; }
.kc-wfoot a { text-decoration: none; }
.kc-webnote.compact { margin: 6px 0 0; font-size: 11.5px; }
.kc-webnote.kc-quota-over { color: var(--err, #b91c1c); font-weight: 700; }
.kc-composer { container-type: inline-size; }
.kc-hint { white-space: nowrap; }
@container (max-width: 560px) { .kc-hint { display: none; } }
/* 会話への振り分け (0.5.25): 計画カード・仕事カード・ファイル一覧・別の方法で・進行中の仕事 */
.kc-plan, .kc-job { border: 1px solid #d7e0f0; background: #f8faff; border-radius: 12px; padding: 12px 14px; margin: 2px 0; }
.kc-plan-h { font-size: 12px; color: #2c4a8a; font-weight: 700; margin-bottom: 4px; }
.kc-plan-s { font-size: 14px; line-height: 1.6; margin-bottom: 6px; }
.kc-plan-tasks { margin: 4px 0 6px; padding-left: 1.4em; font-size: 13px; } .kc-plan-tasks li { margin: 2px 0; }
.kc-plan-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.kc-job-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; } .kc-job-h b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .kc-job-h a { font-size: 12px; text-decoration: none; }
.kc-job .progress { margin: 4px 0; }
.kc-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.kc-file { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 9px; font-size: 12.5px; cursor: pointer; }
.kc-file:hover { background: #eef3ff; } .kc-file-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.kc-src { cursor: pointer; font: inherit; font-size: 12px; }
.kc-route { background: #eef3ff; color: #2c4a8a; border-radius: 6px; padding: 1px 7px; }
/* アプリの道具 (0.6.0): 使った道具の印・確認カードの欄 */
.kc-tools { margin-top: 6px; display: grid; gap: 8px; }
.kc-tool-trail { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kc-tool-trail .kc-src:disabled { cursor: default; opacity: .85; }
.kc-src.err { background: #fdf0f0; color: #a33; }
.kc-args { margin: 4px 0 2px; padding: 6px 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; display: grid; gap: 2px; word-break: break-word; }
.kc-redo { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.kc-redo a { text-decoration: none; }
.kc-side-h { font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px 6px 2px; letter-spacing: .02em; }
.kc-jobitem .kc-conv-t { display: flex; gap: 6px; align-items: center; } .kc-jobitem .state { font-size: 10.5px; padding: 1px 6px; flex: 0 0 auto; }
.kc-side-more { display: block; font-size: 12px; padding: 2px 10px 6px; text-decoration: none; }
.jobtabs { gap: 6px; flex-wrap: wrap; }
.art-chip { cursor: pointer; text-decoration: none; white-space: nowrap; }
.jobs-tbl td { vertical-align: top; }
.kc-thread.compact .kc-plan, .kc-thread.compact .kc-job { padding: 8px 10px; } .kc-thread.compact .kc-plan-s { font-size: 12.5px; }
/* 声 (ui/voice.js): 🎤 で話す・👂 で「コトハコ」の呼びかけを待つ。話している間は音の大きさ (--lv) で縁が太くなる */
.kc-mic { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; line-height: 1; flex: 0 0 auto; display: grid; place-items: center; padding: 0; }
.kc-mic:hover { background: #f3f6fc; }
.kc-mic.on { background: #fdecec; border-color: #e5484d; color: #b42318; box-shadow: 0 0 0 calc(2px + var(--lv, 0) * 8px) rgba(229, 72, 77, .18); }
.kc-wake.on { background: #eaf2ff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.kc-composer.compact .kc-mic { width: 28px; height: 28px; font-size: 13px; }
/* AI が覚えていること: 「これを覚えますか？」のカードと、覚えていることの画面 */
.kc-mem { margin-top: 8px; }
.kc-mem-row { display: grid; gap: 6px; padding: 6px 0; border-top: 1px dashed #d7e0f0; } .kc-mem-row:first-of-type { border-top: 0; }
.kc-mem-done { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; font-size: 13px; }
.kc-mem-list { display: grid; gap: 6px; margin: 10px 0 4px; }
.kc-mem-item { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.kc-mem-item .t { flex: 1; min-width: 0; word-break: break-word; font-size: 13.5px; } .kc-mem-item .t small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.kc-mem-add { display: flex; gap: 8px; margin-top: 8px; } .kc-mem-add .inp { flex: 1; min-width: 0; }
.kc-mem-bar { height: 6px; background: #e6ebf5; border-radius: 4px; overflow: hidden; margin-top: 3px; } .kc-mem-bar i { display: block; height: 100%; background: var(--accent); }
.jobs-wrap { overflow-x: auto; }
.jobs-tbl .state { white-space: nowrap; }
.jobs-tbl td:nth-child(5) { white-space: nowrap; }
/* AI Desk (0.5.26): Claude / Codex 風の左の列・新しいチャット・プロジェクト・スケジュール */
.window .sidebar .side-extra { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 8px -4px 0; border-top: 1px solid var(--line); padding-top: 4px; display: flex; flex-direction: column; }
.window .sidebar.collapsed .side-extra { display: none; }
@media (max-width: 900px) { .window .sidebar .side-extra { display: none; } }
.window .sidebar .side-extra + .grow { flex: 0 0 0; }
.kc-side-row { display: flex; align-items: center; justify-content: space-between; }
.kc-iconbtn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; width: 26px; height: 24px; border-radius: 6px; padding: 0; }
.kc-iconbtn:hover { background: #e8eefb; color: var(--text); }
.kc-recent { display: flex; flex-direction: column; gap: 1px; }
.kc-ritem { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: #334; }
.kc-ritem:hover { background: #eaf0fb; } .kc-ritem.active { background: #dfe9ff; color: #1d3c8a; }
.kc-ri { flex: 0 0 auto; width: 16px; text-align: center; font-size: 12px; }
.kc-rt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-rempty { font-size: 12px; color: var(--muted); padding: 4px 8px; }
.side-extra .kc-q { margin: 2px 4px 6px; width: auto; }
.kc-desk2 { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.kc-desk2.fresh .kc-head { border-bottom-color: transparent; }
.kc-desk2.fresh .kc-scroll { display: flex; }
.kc-desk2.fresh .kc-thread { justify-content: center; min-height: 100%; }
.kc-desk2.fresh .kc-hello { text-align: left; padding: 24px 0 10px; width: 100%; }
.kc-desk2.fresh .kc-hello-t { text-align: center; font-size: 28px; font-weight: 600; margin-bottom: 8px; }
.kc-desk2.fresh .kc-hello > .sub { text-align: center; }
.kc-desk2.fresh .kc-hello .kc-composer { margin: 18px 0 6px; box-shadow: 0 6px 24px rgba(20,40,80,.08); }
.kc-desk2.fresh .kc-hello .kc-sugg { justify-content: center; }
.kc-desk2.fresh .kc-bottom { display: none; }
.kc-projchip { border: 1px solid var(--line); background: #f7f9fc; color: #445; border-radius: 999px; font-size: 12px; padding: 3px 10px; cursor: pointer; white-space: nowrap; }
.kc-projchip:hover { background: #eef3ff; }
.kc-running { margin-top: 22px; }
.kc-run-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.kc-run-h a { font-weight: 400; text-decoration: none; }
.kc-run { display: flex; gap: 10px; align-items: flex-start; padding: 9px 6px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.kc-run:hover { background: #f5f8fd; } .kc-run small { font-size: 11.5px; }
.kc-pop { position: fixed; z-index: 5000; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 5px; min-width: 200px; max-height: 60vh; overflow: auto; }
.kc-pop button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.kc-pop button:hover { background: #eef3ff; } .kc-pop button.danger { color: var(--err); }
.kc-pop-sep { height: 1px; background: var(--line); margin: 4px 2px; } .kc-pop-h { font-size: 11px; color: var(--muted); padding: 4px 10px 2px; }
.kc-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.kc-pcard { cursor: pointer; } .kc-pcard:hover { box-shadow: 0 6px 20px rgba(20,40,80,.12); }
.kc-pempty { text-align: center; padding: 40px 10px; grid-column: 1 / -1; }
.kc-plist { border-top: 1px solid var(--line); }
.kc-srow { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; } .kc-srow.off { opacity: .6; }
.kc-srow-main { min-width: 0; flex: 1; }
.kc-cwshot { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); margin: 6px 0; }
.window .sidebar.has-extra { width: 240px; }
@media (max-width: 900px) { .window .sidebar.has-extra { width: 56px; } } /* スマホ幅: 「チャットとタスク」は隠れるので、ほかの窓と同じ細いレールに */

/* 成果物をその場で見せる (一覧・タスク・チャット) */
.art-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.art-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.art-prev { border-radius: 8px; overflow: hidden; background: rgba(120,130,150,.09); }
.art-prev.clickable, .kc-art-i.clickable { cursor: zoom-in; }
.art-prev img, .kc-art-i img { display: block; border-radius: 8px; }
.art-title { display: flex; gap: 6px; align-items: center; min-width: 0; }
.art-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-intent { margin: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-foot { gap: 6px; align-items: center; flex-wrap: wrap; }
.art-text { overflow: auto; font-size: 12.5px; padding: 10px; border-radius: 8px; background: rgba(120,130,150,.09); white-space: pre-wrap; word-break: break-word; }
.art-text.md { white-space: normal; }
.art-text.small { overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); pointer-events: none; }
.art-none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; font-size: 12.5px; color: var(--muted, #888); padding: 16px; }
.art-frame-wrap { position: relative; overflow: hidden; border-radius: 8px; background: #fff; }
.art-frame-mini { position: absolute; left: 0; top: 0; width: 400%; height: 400%; border: 0; transform: scale(.25); transform-origin: 0 0; pointer-events: none; }
.art-big { margin-top: 10px; }
.art-big .art-text { max-height: 64vh; }
.art-inline { margin: 8px 0; }
.kc-art { margin: 8px 0 4px; display: grid; gap: 6px; max-width: 560px; }
.kc-art.multi { grid-template-columns: repeat(2, 1fr); }
.kc-art-i { border-radius: 8px; overflow: hidden; }

/* AI チャットの「考えた過程」 */
.kc-think { margin: 2px 0 6px; font-size: 12.5px; color: var(--muted, #6b7484); }
.kc-think summary { cursor: pointer; user-select: none; list-style: none; display: inline-flex; gap: 6px; align-items: center; padding: 2px 10px; border-radius: 999px; background: rgba(120,130,150,.1); }
.kc-think summary::-webkit-details-marker { display: none; }
.kc-think summary::before { content: '🧠'; }
.kc-think summary::after { content: '▸'; font-size: 10px; opacity: .7; }
.kc-think[open] summary::after { content: '▾'; }
.kc-think[open] summary { margin-bottom: 6px; }
.kc-think-t { white-space: pre-wrap; word-break: break-word; border-left: 3px solid var(--line, #e4e8ef); padding: 4px 10px; max-height: 320px; overflow: auto; }
.kc-msg.compact .kc-think-t { max-height: 160px; }

/* チャットのアプリづくりカード (BuildLearn) */
.kc-app-opts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0; }
.kc-app-opts label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.kc-app-reply { max-height: 220px; overflow: auto; border-left: 3px solid var(--line, #e4e8ef); padding: 2px 10px; margin: 4px 0 8px; font-size: 13px; }
.kc-app-reply.compact { max-height: 110px; }
.kc-app-followrow { display: flex; gap: 6px; align-items: flex-end; margin-top: 8px; }
.kc-app-follow { flex: 1; font-size: 13px; resize: vertical; }
.kc-app .kc-meta .kc-spin { display: inline-block; margin-right: 6px; vertical-align: -2px; }

/* 利用者が作ったアプリの目印 (BuildLearn 製・自作) と、箱にデータを置くアプリの目印 (DB) */
.app-badge { position: absolute; z-index: 1; width: 36%; height: 36%; border-radius: 30%; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(0,0,0,.35); pointer-events: none; }
.app-badge img { position: static; width: 100%; height: 100%; object-fit: cover; }
.app-badge.maker { right: 3%; bottom: 3%; background: #111827; }
.app-badge.maker.self { background: #475569; color: #fff; font-size: 60%; font-weight: 700; }
.app-badge.db { left: 3%; bottom: 3%; background: linear-gradient(135deg, #22d3ee, #0e7490); padding: 6%; }
.window .titlebar .app-icon .app-badge, .app-icon.sm .app-badge { display: none; }

/* AI の混み具合 (src/usage.js): すぐ / 準備に少し / 混雑 / 使えない */
.lv { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.lv.ok { background: var(--ok); } .lv.wait { background: var(--warn); } .lv.busy { background: var(--err); } .lv.off { background: #9ca3af; }
.board-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.board-head .lv { width: 14px; height: 14px; margin-top: 4px; }
.board-head b { display: block; font-size: 15px; } .board-head span { font-size: 12px; color: var(--muted); }
.board-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.board-row .t { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; }
.board-row.busy .t { color: var(--err); font-weight: 600; }
.board-foot { border-top: 1px solid var(--line); padding-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.board-foot b { color: var(--text, inherit); font-weight: 600; }
.status-toggle { font-size: 12px; cursor: pointer; color: var(--accent); background: none; border: 0; padding: 0; margin-left: auto; }
/* Office 編集 / draw.io: ほぼ全画面で開く */
#modal .dialog.viewer-dialog.office-dialog { width: 98vw; height: 95vh; max-height: 95vh; max-width: none; }

/* ---- デスクトップの窓の機能: 仮想デスクトップ・最小化・全画面・左右寄せ (ui/app.js) ---- */
.window.off-desk { display: none !important; }
.window.minimizing { transition: transform .17s ease-in, opacity .17s ease-in; transform: scale(.55) translate(-45%, 35%); opacity: 0; pointer-events: none; }
.window.snap-left { inset: 60px calc(100vw - (var(--dock-w, 116px) + 100vw - 12px) / 2 + 5px) 12px var(--dock-w, 116px) !important; width: auto !important; height: auto !important; }
.window.snap-right { inset: 60px 12px 12px calc((var(--dock-w, 116px) + 100vw - 12px) / 2 + 5px) !important; width: auto !important; height: auto !important; }
.window.snap-left .rs, .window.snap-right .rs { display: none; }
.window:fullscreen { inset: 0 !important; left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important; border-radius: 0; }
#snap-preview { position: fixed; z-index: 4000; background: rgba(59,130,246,.16); border: 2px solid rgba(96,165,250,.75); border-radius: 14px; pointer-events: none; transition: all .12s; }
#snap-preview.snap-left { top: 60px; bottom: 12px; left: var(--dock-w, 116px); right: calc(100vw - (var(--dock-w, 116px) + 100vw - 12px) / 2 + 5px); }
#snap-preview.snap-right { top: 60px; bottom: 12px; right: 12px; left: calc((var(--dock-w, 116px) + 100vw - 12px) / 2 + 5px); }
#snap-preview.snap-max { top: 60px; bottom: 12px; right: 12px; left: var(--dock-w, 116px); }
#deskbar { display: flex; align-items: center; gap: 4px; }
#deskbar .desk-btn { position: relative; background: rgba(255,255,255,.10); border: 0; color: #e6ebf5; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 7px; cursor: pointer; font-size: 13px; }
#deskbar .desk-btn:hover { background: rgba(255,255,255,.2); } #deskbar .desk-btn.on { background: #fff; color: #0f172a; font-weight: 700; }
#deskbar .desk-btn .desk-dot { position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #93c5fd; }
#deskbar .desk-sep { width: 1px; height: 18px; background: rgba(255,255,255,.2); margin: 0 4px; }
@media (max-width: 899px) { #deskbar { display: none; } }
#desk-toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: rgba(15,23,42,.86); color: #fff; padding: 8px 18px; border-radius: 10px; font-size: 14px; z-index: 5500; opacity: 0; transition: opacity .15s; pointer-events: none; }
#desk-toast.on { opacity: 1; }
#dock .dock-item { position: relative; }
#dock .dock-item.running::after { content: ''; position: absolute; left: 2px; top: 50%; width: 4px; height: 16px; margin-top: -14px; border-radius: 3px; background: rgba(255,255,255,.85); }
#dock .dock-item.running.front::after { height: 26px; margin-top: -19px; background: #93c5fd; }
#dock .dock-item.running.elsewhere::after { background: rgba(255,255,255,.4); height: 8px; margin-top: -10px; }
#dock .dock-item.minimized .app-icon { opacity: .6; transform: scale(.9); }
#dock .dock-open { display: contents; } /* 開いているがドックに無いアプリも同じ升目に */
#dock .dock-open > .dock-item:first-child::before { content: ''; position: absolute; left: 14%; right: 14%; top: -5px; height: 1px; background: rgba(255,255,255,.3); }

.ctx-menu .ctx-sep { height: 1px; background: var(--line); margin: 4px 0; }
.taskview { position: fixed; inset: 0; z-index: 6000; background: rgba(8,16,32,.8); backdrop-filter: blur(6px); padding: 28px 32px; color: #fff; overflow: auto; }
.taskview .tv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; } .taskview h2 { margin: 0 0 4px; font-size: 20px; } .taskview .tv-sub { color: #cbd5e1; font-size: 13px; }
.taskview .tv-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.taskview .tv-desk { background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px; cursor: pointer; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.taskview .tv-desk:hover { border-color: rgba(147,197,253,.6); } .taskview .tv-desk.current { border-color: #93c5fd; background: rgba(59,130,246,.18); } .taskview .tv-desk.over { border-color: #fbbf24; }
.taskview .tv-head { display: flex; align-items: center; gap: 8px; } .taskview .tv-num { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.taskview .tv-name { flex: 1; background: transparent; border: 1px solid transparent; color: #fff; font: inherit; font-weight: 700; padding: 3px 6px; border-radius: 6px; } .taskview .tv-name:focus, .taskview .tv-name:hover { border-color: rgba(255,255,255,.3); outline: 0; }
.taskview .tv-del { background: transparent; border: 0; color: #cbd5e1; cursor: pointer; font-size: 14px; border-radius: 6px; padding: 2px 6px; } .taskview .tv-del:hover { background: rgba(255,255,255,.15); color: #fff; }
.taskview .tv-wins { display: flex; flex-direction: column; gap: 6px; }
.taskview .tv-win { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.92); color: #0f172a; border-radius: 9px; padding: 6px 10px; font-size: 13px; cursor: grab; } .taskview .tv-win .app-icon { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; box-shadow: none; }
.taskview .tv-win.min { opacity: .6; } .taskview .tv-empty { color: #94a3b8; font-size: 13px; padding: 8px 2px; }
.taskview .tv-add { background: transparent; border: 2px dashed rgba(255,255,255,.3); border-radius: 14px; color: #e2e8f0; font: inherit; font-size: 14px; cursor: pointer; min-height: 160px; } .taskview .tv-add:hover { border-color: #93c5fd; color: #fff; }
/* アプリセンターのカードの説明: 3 行で畳む (「もっと見る」で全文) */
.card.app .head .desc-wrap { display: block; }
.card.app .head .desc-clamp { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.card.app .head .desc-clamp.open { display: block; -webkit-line-clamp: unset !important; overflow: visible; }
.card.app .desc-more { border: 0; background: none; color: var(--accent, #2563eb); font-size: 12px; padding: 2px 0 0; cursor: pointer; display: block; }
/* ---- 上のバーを下に (表示の設定) ---- */
body.bar-bottom #topbar { top: auto; bottom: 0; }
body.bar-bottom #dock { top: 12px; bottom: 64px; }
body.bar-bottom #widgets { top: 12px; max-height: calc(100vh - 76px); }
body.bar-bottom #notif-panel { top: auto; bottom: 60px; }
body.bar-bottom #desk-toast { top: 16px; }
body.bar-bottom .window.maximized { inset: 12px 12px 60px var(--dock-w, 116px) !important; }
body.bar-bottom .window.snap-left { top: 12px !important; bottom: 60px !important; }
body.bar-bottom .window.snap-right { top: 12px !important; bottom: 60px !important; }
body.bar-bottom #snap-preview { top: 12px !important; bottom: 60px !important; }
body.hide-search #topbar .search { display: none; }
body.hide-desks #deskbar { display: none; }
body.hide-gpu #gpu-chip { display: none !important; }
body.hide-clock #clock { display: none; }
body.hide-widgets #widgets { display: none !important; }
/* ---- 管理者からの緊急のお知らせ ---- */
.bc-overlay { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15,23,42,.72); backdrop-filter: blur(4px); }
.bc-overlay.level-emergency { background: rgba(127,29,29,.82); animation: bc-pulse 1.6s ease-in-out infinite; }
@keyframes bc-pulse { 0%, 100% { background: rgba(127,29,29,.82); } 50% { background: rgba(185,28,28,.9); } }
.bc-box { background: #fff; color: #0f172a; border-radius: 16px; border-top: 10px solid; max-width: 640px; width: 100%; padding: 22px 26px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.bc-box .bc-label { display: inline-block; color: #fff; font-weight: 800; padding: 3px 12px; border-radius: 999px; font-size: 14px; letter-spacing: .1em; }
.bc-box h1 { font-size: 26px; margin: 12px 0 10px; line-height: 1.35; }
.bc-box .bc-body { font-size: 16px; line-height: 1.8; white-space: pre-wrap; margin-bottom: 12px; }
.bc-box .bc-meta { color: #64748b; font-size: 12.5px; margin-bottom: 16px; }
.bc-box .bc-ack { width: 100%; font-size: 17px; padding: 12px; justify-content: center; }
/* ストアのまとめて選ぶ: カードの右上のチェック・違う種類は薄く・選んでいる間は下にくっついてくる小さな枠 */
.card.app.pickable { position: relative; }
.card.app.pickable .head > div:last-child { padding-right: 24px; }
.card.app .pick-box { position: absolute; top: 8px; right: 8px; padding: 4px; line-height: 0; cursor: pointer; }
.card.app .pick-box input { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--accent); }
.card.app.picked { box-shadow: 0 0 0 2px var(--accent) inset; }
.card.app.sel-off { opacity: .4; filter: grayscale(1); }
.card.app.sel-off .pick-box, .card.app.sel-off .pick-box input { cursor: not-allowed; }
.sel-float { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: fit-content; max-width: calc(100% - 24px); margin: 12px auto 0; padding: 8px 12px; background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(10,20,40,.22); font-size: 13px; }
.sel-float[hidden] { display: none; }
/* System › アプリを使える人 */
.acc-picker { display: grid; gap: 12px; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; margin-top: 4px; }
.acc-ulist { max-height: 200px; overflow: auto; display: grid; gap: 2px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 6px 8px; }

/* 右上の利用者のメニュー (src: ui/app.js toggleAcctMenu) */
#acct-menu { position: fixed; top: 56px; right: 12px; width: 316px; max-height: calc(100vh - 72px); overflow: auto; z-index: 1600; background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; font-size: 13.5px; animation: am-in .12s ease-out; }
@keyframes am-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
body.bar-bottom #acct-menu { top: auto; bottom: 60px; }
#acct-menu .am-head { display: flex; gap: 12px; align-items: center; padding: 12px 12px 10px; }
#acct-menu .am-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, #818cf8, #2f6bff); flex: none; }
#acct-menu .am-who { min-width: 0; } #acct-menu .am-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
#acct-menu .am-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#acct-menu .am-sub { color: var(--muted); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#acct-menu .am-role { flex: none; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #eef2ff; color: #3730a3; }
#acct-menu .am-role-owner { background: #fef3c7; color: #92400e; } #acct-menu .am-role-admin { background: #ede9fe; color: #5b21b6; } #acct-menu .am-role-viewer { background: #f1f5f9; color: #475569; }
#acct-menu .am-ws { display: flex; align-items: center; gap: 10px; padding: 2px 12px 8px; color: var(--muted); font-size: 12px; } #acct-menu .am-ws select { flex: 1; min-width: 0; }
#acct-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 6px; }
#acct-menu .am-sec { padding: 4px 12px 2px; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; }
#acct-menu .am-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 12px; border: 0; background: transparent; border-radius: 9px; text-align: left; cursor: pointer; font: inherit; color: inherit; }
#acct-menu .am-item:hover, #acct-menu .am-item:focus-visible { background: #f1f4fa; outline: none; }
#acct-menu .am-item svg { width: 18px; height: 18px; flex: none; color: #64748b; } #acct-menu .am-item:hover svg { color: var(--accent); }
#acct-menu .am-label { flex: 1; min-width: 0; }
#acct-menu .am-badge { flex: none; font-size: 11px; padding: 1px 8px; border-radius: 999px; color: var(--muted); }
#acct-menu .am-badge.ok { background: #dcfce7; color: #166534; } #acct-menu .am-badge.warn { background: #fef3c7; color: #92400e; }
#acct-menu .am-item.danger { color: #b91c1c; } #acct-menu .am-item.danger svg, #acct-menu .am-item.danger:hover svg { color: #b91c1c; } #acct-menu .am-item.danger:hover { background: #fef2f2; }
#acct-menu .am-foot { padding: 4px 12px 8px; color: #94a3b8; font-size: 11px; }
/* 経営ダッシュボード (ui/insight.js) */
.ins-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 10px 0 4px; }
.ins-tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.ins-tl { font-size: 12px; color: var(--muted); }
.ins-tv { font-size: 24px; font-weight: 700; margin: 2px 0; letter-spacing: .01em; }
.ins-ts { font-size: 12px; color: var(--muted); }
.ins-d { font-size: 12px; font-weight: 600; white-space: nowrap; } .ins-d.up { color: #15803d; } .ins-d.down { color: #b91c1c; }
.ins-chart { width: 100%; max-width: 760px; height: auto; display: block; }
.ins-b1 { fill: #6366f1; } .ins-b2 { fill: #22c55e; } .ins-ax { font-size: 10px; fill: #64748b; }
.ins-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ins-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ins-k1::before { background: #6366f1; } .ins-k2::before { background: #22c55e; }
.ins-bar { height: 8px; background: #eef2ff; border-radius: 4px; overflow: hidden; } .ins-bar i { display: block; height: 100%; background: #6366f1; border-radius: 4px; }
.ins-apps { display: flex; flex-wrap: wrap; gap: 6px; }
.ins-sum { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fafbff; line-height: 1.8; }
