/* アセットマネージャー (js/content_browser.js): docked under the 3D view, the full width of the window. */
#cbDock { display: none; grid-row: 4; min-height: 0; height: var(--cb-h, 280px); background: var(--panel); border-top: 1px solid var(--line); position: relative;
  --cb-tree: 210px; --cb-thumb: 96px; --cb-sel: var(--accent); --cb-tile: var(--panel2); --cb-tile-line: color-mix(in srgb, var(--line) 70%, transparent);
  grid-template-rows: 34px auto auto minmax(0, 1fr) 22px; font-size: 12px; }
#cbDock.cb-open { display: grid; }
#cbDock.cb-collapsed { grid-template-rows: 30px; }
#cbDock.cb-collapsed > :not(.cb-bar):not(.cb-resize) { display: none !important; }
#cbDock.cb-collapsed .cb-bar > :not(.cb-collapse):not(.cb-title):not(.cb-crumbs):not([data-a=hide]) { display: none; }
body.cb-docked { grid-template-rows: 30px 40px minmax(0, 1fr) auto 28px; }
body.cb-docked.tablet { grid-template-rows: 44px 52px minmax(0, 1fr) auto 32px; }
body[data-mode="pages"] #cbDock { display: none !important; }
body[data-mode="pages"].cb-docked { grid-template-rows: 30px 40px minmax(0, 1fr) 28px; }
body[data-mode="pages"].cb-docked.tablet { grid-template-rows: 44px 52px minmax(0, 1fr) 32px; }

/* resize handle on the top edge */
.cb-resize { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: ns-resize; z-index: 3; }
.cb-resize:hover, #cbDock.cb-resizing .cb-resize { background: linear-gradient(transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); }
#cbDock.cb-resizing, #cbDock.cb-resizing * { user-select: none; }

/* top bar */
.cb-bar { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 4px; background: var(--bar); border-bottom: 1px solid var(--line); min-width: 0; }
.cb-title { font-weight: 600; letter-spacing: .02em; margin-right: 2px; cursor: default; white-space: nowrap; }
.cb-ib { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 24px; min-width: 24px; padding: 0 5px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: var(--ink); cursor: pointer; white-space: nowrap; }
.cb-ib:hover { background: var(--hover); border-color: var(--line); }
.cb-ib.on { background: var(--hover); border-color: var(--accent); color: var(--accent); }
.cb-ib svg { flex: none; }
.cb-filterbtn span { font-size: 11.5px; }
.cb-fcount:not(:empty) { font-style: normal; background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 0 5px; font-size: 10.5px; line-height: 15px; }
.cb-crumbs { display: flex; align-items: center; gap: 0; min-width: 0; flex: 0 1 auto; overflow: hidden; color: var(--muted); }
.cb-crumbs button { border: 0; background: none; padding: 2px 4px; border-radius: 3px; cursor: pointer; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.cb-crumbs button:hover { background: var(--hover); color: var(--ink); }
.cb-crumbs button.last { color: var(--ink); font-weight: 600; }
.cb-crumbs .sep { display: inline-flex; opacity: .5; }
.cb-crumbs .sep svg { width: 10px; height: 10px; }
.cb-searchbox { margin-left: auto; display: flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel2); width: min(340px, 30vw); color: var(--muted); }
.cb-searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent); }
.cb-q { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; color: var(--ink); font-size: 12px; }
/* アセットマネージャーのタブ：［一覧］（この棚）／［管理（登録・公開範囲）］（js/assets.js の窓） */
.cb-amtabs { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.cb-amtab { height: 22px; padding: 0 8px; border: 0; background: transparent; color: var(--ink); cursor: pointer; white-space: nowrap; font-size: 12px; }
.cb-amtab + .cb-amtab { border-left: 1px solid var(--line); }
.cb-amtab:hover { background: var(--hover); }
.cb-amtab.on { background: var(--accent); color: var(--accent-ink); cursor: default; }
#cbDock.cb-collapsed .cb-amtabs { display: none; }
.cb-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.cb-seg .cb-ib { border-radius: 0; border: 0; height: 22px; }
.cb-seg .cb-ib.on { background: var(--accent); color: var(--accent-ink); }
#cbDock .cb-size { flex: none; width: 90px; min-width: 0; margin: 0 2px; accent-color: var(--accent); }
#cbDock.cb-list .cb-size { opacity: .35; pointer-events: none; }

/* filter chips */
.cb-chips { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; padding: 4px 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; background: var(--panel); }
.cb-chips[hidden] { display: none; }
.cb-chips .chip { white-space: nowrap; line-height: 18px; font-size: 11px; }
.cb-tagsl { color: var(--muted); font-size: 11px; margin: 0 2px 0 6px; }

/* body: tree | split | grid */
.cb-body { display: grid; grid-template-columns: var(--cb-tree) 5px minmax(0, 1fr); min-height: 0; }
.cb-tree { overflow: auto; padding: 4px 0 8px; background: var(--panel); scrollbar-width: thin; }
.cb-split { cursor: ew-resize; background: var(--line); width: 1px; margin: 0 2px; position: relative; }
.cb-split::after { content: ""; position: absolute; inset: 0 -3px; }
.cb-split:hover { background: var(--accent); }
.cb-node { display: flex; align-items: center; gap: 3px; height: 22px; padding: 0 6px 0 calc(4px + var(--d) * 14px); cursor: pointer; white-space: nowrap; border-left: 2px solid transparent; }
.cb-node:hover { background: var(--hover); }
.cb-node.on { background: color-mix(in srgb, var(--accent) 14%, transparent); border-left-color: var(--accent); font-weight: 600; }
.cb-node.root { margin-top: 4px; }
.cb-node .tw { width: 14px; display: inline-flex; flex: none; }
.cb-tw { border: 0; background: none; padding: 0; width: 14px; height: 14px; display: inline-grid; place-items: center; color: var(--muted); cursor: pointer; transition: transform .12s; }
.cb-tw svg { width: 10px; height: 10px; }
.cb-tw.open { transform: rotate(90deg); }
.cb-node .ic { display: inline-flex; color: var(--muted); flex: none; }
.cb-node.root .ic { color: var(--accent); }
.cb-node .lb { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cb-node em { margin-left: auto; padding-left: 6px; font-style: normal; color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; font-weight: 400; }

.cb-mainwrap { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; min-width: 0; background: var(--panel2); }
.cb-scroll { grid-row: 2; position: relative; overflow-y: auto; overflow-x: hidden; outline: none; contain: strict; scrollbar-width: thin; }
.cb-spacer { width: 1px; }
.cb-empty { position: absolute; inset: 40px 0 auto; text-align: center; color: var(--muted); padding: 20px; }
.cb-empty .chip { margin-left: 6px; }
#cbDock.cb-loading .cb-scroll { opacity: .55; transition: opacity .2s .15s; }

/* grid cells (absolutely placed by the virtual grid) */
.cb-cell { position: absolute; left: 0; top: 0; border-radius: 6px; padding: 5px 5px 4px; cursor: default; user-select: none; contain: layout style; border: 1px solid transparent; }
.cb-cell:hover { background: var(--hover); }
.cb-cell.armed { transform-origin: center; outline: 2px solid var(--accent); outline-offset: -2px; }
.cb-cell.sel { background: color-mix(in srgb, var(--cb-sel) 16%, transparent); border-color: var(--cb-sel); }
.cb-cell .th { position: relative; height: var(--cb-thumb); border-radius: 4px; overflow: hidden; background: var(--cb-tile);
  box-shadow: inset 0 0 0 1px var(--cb-tile-line); display: grid; place-items: center; }
.cb-cell .th::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tc); opacity: .85; } /* the type strip */
.cb-cell img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cb-cell .ph { font-size: 11px; font-weight: 600; color: var(--tc); opacity: .8; letter-spacing: .04em; padding: 3px 7px; border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); border-radius: 4px; background: color-mix(in srgb, var(--tc) 7%, transparent); }
.cb-cell .lic:not(:empty) { position: absolute; left: 4px; top: 4px; font-style: normal; font-size: 9.5px; line-height: 14px; padding: 0 4px; border-radius: 3px; background: rgba(40,44,52,.72); color: #fff; }
.cb-cell .lic.internal { background: #b8452d; }
.cb-cell .fav:not(:empty) { position: absolute; right: 4px; top: 2px; font-style: normal; color: #e0a100; font-size: 12px; text-shadow: 0 0 2px #fff; }
.cb-cell .nm { margin-top: 4px; font-size: 11.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-cell .sub { color: var(--muted); font-size: 10.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-cell.draft .nm::after { content: " 下書き"; color: #c07a00; font-size: 10px; }
.cb-cell .c-where, .cb-cell .c-status, .cb-cell .c-lic { display: none; }

/* list view */
.cb-listhead { display: none; }
#cbDock { --cb-cols: 22px minmax(160px, 2.4fr) 92px minmax(140px, 2fr) 120px 56px 92px; }
#cbDock.cb-list .cb-listhead { grid-row: 1; display: grid; grid-template-columns: var(--cb-cols); gap: 8px; padding: 4px 20px 4px 12px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 11px; background: var(--panel); }
#cbDock.cb-list .cb-listhead > span { cursor: pointer; overflow: hidden; white-space: nowrap; }
#cbDock.cb-list .cb-listhead > span:hover { color: var(--ink); }
#cbDock.cb-list .cb-cell { display: grid; grid-template-columns: var(--cb-cols); gap: 8px; align-items: center; height: 26px; padding: 2px 8px; border-radius: 3px; }
#cbDock.cb-list .cb-cell .th { height: 22px; width: 22px; border-radius: 3px; }
#cbDock.cb-list .cb-cell .th::after { height: 2px; }
#cbDock.cb-list .cb-cell .ph { font-size: 0; padding: 0; border: 0; width: 10px; height: 10px; border-radius: 2px; background: var(--tc); opacity: .6; }
#cbDock.cb-list .cb-cell .lic, #cbDock.cb-list .cb-cell .fav { display: none; }
#cbDock.cb-list .cb-cell .nm { margin: 0; }
#cbDock.cb-list .cb-cell .sub { color: var(--tc); font-weight: 600; font-size: 11px; }
#cbDock.cb-list .cb-cell .c-where, #cbDock.cb-list .cb-cell .c-status, #cbDock.cb-list .cb-cell .c-lic { display: block; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#cbDock.cb-list .cb-cell .c-lic.internal { color: #b8452d; font-weight: 600; }
#cbDock.cb-list .cb-cell.draft .nm::after { content: ""; }
#cbDock.cb-list .cb-cell.draft .c-status { color: #c07a00; }
.cb-cell .c-where { display: none; }

.cb-foot { display: flex; align-items: center; gap: 14px; padding: 0 10px; border-top: 1px solid var(--line); background: var(--bar); color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; }
.cb-count { color: var(--ink); font-variant-numeric: tabular-nums; }
.cb-hint { overflow: hidden; text-overflow: ellipsis; }

/* drag ghost */
.cb-ghost { position: fixed; left: 0; top: 0; z-index: 5000; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 5px 9px 5px 5px; border-radius: 7px;
  background: var(--menu); border: 1px solid var(--line); box-shadow: 0 8px 22px rgba(0,0,0,.22); max-width: 300px; font-size: 12px; opacity: .96; }
.cb-ghost img, .cb-ghost .ph { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; background: var(--panel2); flex: none; display: grid; place-items: center; font-size: 10px; color: var(--tc); box-shadow: inset 0 0 0 1px var(--line); }
.cb-ghost b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-ghost .act { display: block; color: var(--muted); font-size: 11px; }
.cb-ghost.ok { border-color: var(--accent); }
.cb-ghost.ok .act { color: var(--accent); }
body.cb-dragging, body.cb-dragging * { cursor: copy !important; }

/* hover preview */
.cb-tip { position: fixed; z-index: 4000; width: 320px; background: var(--menu); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.24); overflow: hidden; font-size: 12px; }
.cb-tip .big { position: relative; height: 168px; display: grid; place-items: center; background: var(--panel2); border-bottom: 3px solid var(--tc); overflow: hidden; }
.cb-tip .big img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
.cb-tip .big .ph { color: var(--tc); font-weight: 600; font-size: 15px; }
.cb-tip .info { padding: 8px 11px 10px; }
.cb-tip .info > b { font-size: 13.5px; display: block; line-height: 1.35; }
.cb-tip .tline { display: flex; gap: 5px; align-items: center; margin: 4px 0 6px; flex-wrap: wrap; }
.cb-tip .tp { color: var(--tc); font-weight: 600; font-size: 11px; }
.cb-tip .badge { font-size: 10.5px; line-height: 16px; padding: 0 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); }
.cb-tip .badge.ok { border-color: #2f8f6b; color: #2f8f6b; }
.cb-tip .badge.draft { border-color: #c07a00; color: #c07a00; }
.cb-tip .badge.lic.internal { background: #b8452d; border-color: #b8452d; color: #fff; }
.cb-tip .kv2 { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 11.5px; }
.cb-tip .kv2 span { color: var(--muted); }
.cb-tip .kv2 b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cb-tip p { margin: 6px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.cb-tip code { display: block; margin-top: 6px; font: 10.5px ui-monospace, Consolas, monospace; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* details dialog */
.cb-detail { display: grid; grid-template-columns: 240px 1fr; gap: 14px; align-items: start; }
.cb-dbig { position: relative; height: 200px; border: 1px solid var(--line); border-radius: 6px; display: grid; place-items: center; background: var(--panel2); overflow: hidden; color: var(--muted); }
.cb-dbig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cb-dkv .kv { display: flex; gap: 10px; }
.cb-dkv .kv span { color: var(--muted); min-width: 86px; }

@media (max-width: 900px) {
  .cb-size, .cb-filterbtn span, .cb-crumbs, .cb-amlong { display: none; }
  #cbDock:not(.cb-collapsed) .cb-title { display: none; }
  /* 狭い画面：ボタンは縮めず（縮むと中身があふれて隣に重なる）、上の列だけを横に送る。ページ全体は横に動かさない */
  .cb-bar { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .cb-bar::-webkit-scrollbar { display: none; }
  .cb-bar > * { flex-shrink: 0; }
  .cb-bar > .cb-searchbox { flex: 1 0 120px; }
  .cb-bar [data-a=float], .cb-bar [data-a=tab] { display: none; }
  .cb-searchbox { width: auto; flex: 1; }
  /* 左の木（ソース）は畳んでおき、［ソース］のボタンで左から引き出す。並ぶ所は全幅（前は木を消しただけで、並ぶ所が幅 0 の列に入っていた） */
  .cb-srcbtn { display: inline-flex; max-width: 150px; border-color: var(--line); }
  .cb-srcbtn .cb-srclabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #cbDock.cb-treeopen .cb-srcbtn { background: var(--hover); border-color: var(--accent); color: var(--accent); }
  .cb-body { position: relative; grid-template-columns: minmax(0, 1fr); }
  .cb-split { display: none; }
  .cb-tree { display: none; position: absolute; z-index: 6; inset: 0 auto 0 0; width: min(280px, 86%); border-right: 1px solid var(--line); box-shadow: 4px 0 14px rgba(0, 0, 0, .18); }
  #cbDock.cb-treeopen .cb-tree { display: block; }
  .cb-body > .cb-mainwrap { grid-column: 1; grid-row: 1; }
}
.cb-srcbtn { display: none; }
@media (max-width: 900px) { #cbDock .cb-bar .cb-srcbtn { display: inline-flex; } }
/* 狭い画面の引き出し式の配置（toolset.css の body.dl-on）でも、アセットマネージャーの段を空ける（前は段が 28px しかなく、画面の下にはみ出していた） */
body.dl-on.cb-docked:not([data-mode="pages"]) { grid-template-rows: 30px 0 minmax(0, 1fr) auto 28px; }
body.tablet.dl-on.cb-docked:not([data-mode="pages"]) { grid-template-rows: 50px 0 minmax(0, 1fr) auto 32px; }

/* 使われている所 (where used) */
.cb-cell .use:not(:empty) { position: absolute; right: 4px; bottom: 6px; font-style: normal; font-size: 9.5px; line-height: 14px; padding: 0 5px; border-radius: 7px;
  background: color-mix(in srgb, var(--panel2) 82%, transparent); color: var(--ink); box-shadow: 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; }
#cbDock.cb-list .cb-cell .use { display: none; }
.cb-cell .c-use { display: none; }
#cbDock.cb-list .cb-cell .c-use { display: block; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cb-tip .use { margin: 2px 0 8px; padding: 7px 8px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 7%, var(--panel2)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.cb-tip .use.none { background: var(--panel2); border-color: var(--line); }
.cb-tip .use .ul { display: block; font-size: 10.5px; font-weight: 600; color: var(--accent); letter-spacing: .04em; }
.cb-tip .use.none .ul { color: var(--muted); }
.cb-tip .use .ut { margin: 2px 0 0; color: var(--ink); font-size: 11.5px; line-height: 1.5; }
.cb-tip .use .uc { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-top: 5px; }
.cb-tip .use .uc:empty { display: none; }
.cb-tip .use .ue { font-size: 10.5px; color: var(--muted); margin: 0 1px 0 4px; }
.cb-tip .use .ue:first-child { margin-left: 0; }
.cb-tip .use .more { font-size: 10.5px; color: var(--muted); margin-left: 4px; }
.cb-cutlink { border: 1px solid var(--line); background: var(--panel2); color: var(--ink); border-radius: 4px; padding: 0 5px; font: 10.5px/18px ui-monospace, Consolas, monospace; cursor: pointer; }
.cb-cutlink:hover { border-color: var(--accent); color: var(--accent); }
.cb-cutlink b { font-weight: 600; }
.cb-uh { margin: 14px 0 6px; font-size: 14px; }
.cb-usage { max-height: 46vh; overflow: auto; }
.cb-usum { font-size: 13px; margin-bottom: 8px; }
.cb-uep { border-top: 1px solid var(--line); padding: 7px 0; }
.cb-uept { display: flex; gap: 8px; align-items: baseline; margin-bottom: 5px; flex-wrap: wrap; }
.cb-uept em { font-style: normal; color: var(--muted); font-size: 12px; }
.cb-uept .pl { font-style: normal; font-size: 11px; color: #2f8f6b; }
.cb-ucuts { display: flex; flex-wrap: wrap; gap: 4px; }
.cb-ucuts .cb-cutlink { font: 12px/22px system-ui, "Yu Gothic UI", sans-serif; padding: 0 8px; display: inline-flex; gap: 6px; }
.cb-ucuts .cb-cutlink b { font-family: ui-monospace, Consolas, monospace; }
.cb-uset { padding: 3px 0; }
.cb-old { color: #c07a00; }

/* 使用済み / 予定: a folded corner on the thumbnail, the count below it */
.cb-cell .fav:not(:empty) { right: auto; left: 4px; top: auto; bottom: 5px; }
.cb-cell .mark { position: absolute; right: 0; top: 0; width: 0; height: 0; border-style: solid; border-width: 0 22px 22px 0; border-color: transparent; font-style: normal; pointer-events: auto; }
.cb-cell .mark.used { border-color: transparent #2f8f6b transparent transparent; }
.cb-cell .mark.used::after { content: "✓"; position: absolute; right: -21px; top: 0; width: 12px; text-align: center; color: #fff; font-size: 10px; font-weight: 700; line-height: 12px; }
.cb-cell .mark.planned { border-color: transparent #d99a1e transparent transparent; }
.cb-cell .mark.planned::after { content: "予"; position: absolute; right: -21px; top: 1px; width: 12px; text-align: center; color: #fff; font-size: 8.5px; font-weight: 700; line-height: 10px; }
.cb-cell .use.planned:not(:empty) { background: #fff7e6; color: #8a5a00; box-shadow: 0 0 0 1px #e8c27a; border-style: dashed; }
#cbDock.cb-list .cb-cell .mark { display: none; }

/* この話で使っている物 */
#cbDock.cb-cmode .cb-scroll, #cbDock.cb-cmode .cb-listhead, #cbDock.cb-cmode .cb-empty { display: none !important; }
.cb-contents { grid-row: 1 / span 2; overflow: auto; padding: 0 14px 18px; min-height: 0; scrollbar-width: thin; }
.cb-chead { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 8px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.cb-chead b { font-size: 14px; }
.cb-chead .muted { margin-left: 8px; font-size: 12px; }
.cb-cbtns { display: flex; gap: 6px; flex: none; }
.cb-cg h4 { margin: 14px 0 4px; font-size: 13px; display: flex; align-items: baseline; gap: 6px; }
.cb-cg h4 em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 400; }
.cb-ct { width: 100%; border-collapse: collapse; }
.cb-ct td { border-top: 1px solid var(--line); padding: 4px 6px; vertical-align: top; font-size: 12px; }
.cb-ct td.th { width: 40px; padding: 3px 4px; }
.cb-ct .cth { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.cb-ct .cth img { width: 100%; height: 100%; object-fit: contain; }
.cb-ct .cth i { font-style: normal; font-size: 9px; color: var(--tc); }
.cb-ct td.nm { width: 26%; }
.cb-ct td.nm .sub { color: var(--muted); font-size: 11px; }
.cb-clink { border: 0; background: none; padding: 0; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.cb-clink:hover { color: var(--accent); text-decoration: underline; }
.cb-ct td.n { width: 70px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cb-ct td.n small { font-weight: 400; color: var(--muted); }
.cb-ct td.cuts .rg { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.cb-ct td.cuts .chips { display: flex; flex-wrap: wrap; gap: 3px; }
.cb-ct td.pv { width: 24%; color: var(--muted); font-size: 11px; }
.cb-ct td.pv b { color: var(--ink); font-weight: 600; }
.cb-plan { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 3px; border: 1px dashed #d99a1e; color: #8a5a00; background: #fff7e6; font-weight: 600; }
.cb-badge { display: inline-block; margin-left: 5px; font-size: 10px; line-height: 15px; padding: 0 5px; border-radius: 3px; background: #b8452d; color: #fff; vertical-align: 1px; font-weight: 600; }
.cb-empty2 { padding: 30px; text-align: center; color: var(--muted); }

/* the details window: 3D preview on the left */
.cb-dmodal .dialog { max-width: min(980px, 96vw); }
/* 見出しを押すと畳む（アセットの詳細・使われているところ・派生と系譜） */
.cb-dmodal section[data-fold] h3.cb-uh, .cb-dmodal section.lg-det h3.cb-uh { cursor: pointer; user-select: none; background: var(--sec-head, #e1e6ef); border-left: 4px solid var(--accent, #1a5cff); border-radius: 4px; padding: 5px 10px; margin: 10px 0 6px; font-size: 13px; }
.cb-dmodal section[data-fold] h3.cb-uh:hover, .cb-dmodal section.lg-det h3.cb-uh:hover { background: var(--hover, #dde6ff); }
.cb-dmodal .cb-usage-head { align-items: center; gap: 8px; padding: 0 !important; background: none !important; border: 0 !important; }
.cb-dmodal .cb-usage-section { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
.cb-dmodal .cb-usage-head h3.cb-uh { flex: 1; }
.cb-dmodal section[data-fold] h3.cb-uh::before, .cb-dmodal section.lg-det h3.cb-uh::before { content: '▾ '; color: var(--muted); }
.cb-dmodal section.cb-folded h3.cb-uh::before { content: '▸ '; }
.cb-dmodal section.cb-folded > :not(h3):not(header), .cb-dmodal section.cb-folded > header > :not(h3) { display: none !important; }
.cb-info-section > h3.cb-uh { margin: 4px 0 8px; }
.cb-ucount { margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: var(--accent, #1a5cff); color: #fff; font-size: 11.5px; font-weight: 600; }
.cb-dhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cb-dhead h2 { margin: 0; }
.cb-dhead .tp { color: var(--tc); font-weight: 600; font-size: 12px; border: 1px solid var(--tc); border-radius: 3px; padding: 0 6px; }
.cb-detail { grid-template-columns: 340px 1fr; margin-top: 10px; }
.cb-dleft .cb-dbig { height: 300px; background: radial-gradient(circle at 50% 40%, var(--panel2), var(--panel)); }
.cb-dleft .cb-dbig canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.cb-dleft .cb-dbig canvas:active { cursor: grabbing; }
.cb-dhint { font-size: 11px; color: var(--muted); margin-top: 5px; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.cb-dkv h4 { margin: 10px 0 3px; font-size: 12px; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.cb-dkv .kv { justify-content: space-between; gap: 14px; font-size: 12.5px; padding: 1px 0; }
.cb-dkv .kv b { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.cb-dkv .kv.pk b { font-weight: 700; }

/* the browser on its own page (content.html) */
body.cb-page { display: grid; grid-template-rows: 44px minmax(0, 1fr); height: 100vh; }
body.cb-page #cbDock { display: grid !important; grid-row: 2; height: auto; border-top: 0; }
body.cb-page .cb-resize, body.cb-page [data-a=collapse], body.cb-page [data-a=hide] { display: none !important; }
.cbp-head { display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--menu); border-bottom: 1px solid var(--line); }
.cbp-head img { height: 22px; }
.cbp-head b { font-size: 14px; }
.cbp-head .sp { flex: 1; }
.cbp-head a { color: var(--accent); text-decoration: none; font-size: 12.5px; border: 1px solid var(--line); border-radius: 5px; padding: 3px 10px; background: var(--panel2); }
.cbp-head a:hover { border-color: var(--accent); }
@media (max-width: 900px) { .cb-detail { grid-template-columns: 1fr; } .cb-ct td.pv { display: none; } }

.cb-episode-link{color:var(--accent);font-weight:600;text-decoration:underline;text-underline-offset:3px}.cb-episode-link:hover{filter:brightness(1.2)}.cb-episode-link:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.cb-single{padding:0!important;background:var(--bg)}.cb-single>.dialog{width:100%!important;max-width:1500px!important;max-height:100vh!important;min-height:100vh;margin:0 auto;border-radius:0}.cb-single .cb-dbig{height:min(52vh,540px)}.cb-single .cb-usage{max-height:none}.cb-single .cb-detail{grid-template-columns:minmax(0,1.6fr) minmax(240px,1fr)}@media(max-width:650px){.cb-single .cb-detail{grid-template-columns:1fr}.cb-single .cb-dbig{height:36vh}}

.cb-single-actions{position:sticky;top:0;z-index:3;display:flex;gap:8px;flex-wrap:wrap;padding:8px 0 12px;background:var(--panel);border-bottom:1px solid var(--line);margin-bottom:16px}.cb-single-actions a{text-decoration:none}

.cb-scope{display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:5px 8px;border-bottom:1px solid var(--line);background:var(--panel);min-width:0}.cb-scope label{display:flex;align-items:center;gap:5px;white-space:nowrap}.cb-scope select{font:inherit;max-width:220px;width:170px;padding:3px 5px;background:var(--panel2);color:var(--ink);border:1px solid var(--line);border-radius:4px}.cb-scope [data-scope=cut]{width:210px}.cb-scope-note,.cb-scope-label{color:var(--muted);font-size:11px}.cb-scope .chip{white-space:nowrap}.cb-scope :disabled{opacity:.5}.cb-scope .on{color:#fff;background:var(--accent);border-color:var(--accent)}@media(max-width:650px){.cb-scope{gap:5px}.cb-scope select,.cb-scope [data-scope=cut]{width:130px;max-width:42vw}.cb-scope-label{display:none}.cb-scope label{font-size:11px}}

#cbDock>.cb-bar{grid-row:1}#cbDock>.cb-scope{grid-row:2}#cbDock>.cb-chips{grid-row:3}#cbDock>.cb-body{grid-row:4}#cbDock>.cb-foot{grid-row:5}

/* 自分のフォルダー (js/local_folders.js): the folder bar above the tiles */
.cb-mainwrap.cb-haslocal { grid-template-rows: auto auto minmax(0, 1fr); }
.cb-mainwrap.cb-haslocal .cb-scroll { grid-row: 3; }
#cbDock.cb-list .cb-mainwrap.cb-haslocal .cb-listhead { grid-row: 2; }
.cb-mainwrap.cb-haslocal .cb-empty { inset: 72px 0 auto; }
.cb-localbar { grid-row: 1; display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 12px; min-width: 0; }
.cb-localbar .lf-rows { display: flex; flex-direction: column; gap: 4px; }
.cb-localbar .lf-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cb-localbar .lf-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.cb-localbar .lf-note, .cb-localbar em { color: var(--muted); font-size: 11px; font-style: normal; }
.cb-localbar .chip { white-space: nowrap; }
.cb-localbar .chip.primary { color: #fff; background: var(--accent); border-color: var(--accent); }

/* 使用先を独立したパネルにし、リストと完成コマの画像を切り替える。 */
.cb-usage-section { flex-shrink:0; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.cb-usage-head { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; padding:9px 12px; background:var(--hover); border-bottom:2px solid var(--accent); }
.cb-usage-head .cb-uh { margin:0; font-size:15px; font-weight:750; }
.cb-usage-views { display:flex; gap:4px; }
.cb-usage-views .on { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.cb-usage-section .cb-usage { padding:8px 12px; }
.cb-cutthumb { display:none; }
.cb-cutcaption { display:inline-flex; gap:6px; align-items:baseline; }
.cb-cutcaption small { color:var(--muted); }
.cb-usage[data-usage-view="grid"] .cb-ucuts { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:10px; }
.cb-usage[data-usage-view="grid"] .cb-cutlink { display:flex; flex-direction:column; align-items:stretch; text-align:left; padding:0; overflow:hidden; }
.cb-usage[data-usage-view="grid"] .cb-cutthumb { display:flex; align-items:center; justify-content:center; width:100%; min-height:110px; background:var(--bg); font:12px system-ui; color:var(--muted); }
.cb-cutthumb img { display:block; width:100%; max-height:240px; object-fit:contain; background:white; }
.cb-usage[data-usage-view="grid"] .cb-cutcaption { display:flex; flex-wrap:wrap; padding:6px 8px; }
.cb-dmodal:not(.cb-single) .dialog { max-height:calc(100dvh - var(--cb-header-height,0px) - 32px); }
