/* public/pdf-inspector/pdf-inspector.css
   PDF Inspector — Astro の CSS 処理を通さないよう public に置く（WASM Inspector の配色に合わせる） */

.pi-app {
  --acc: #00ff88; --bg: #0d0d0d; --panel: #111; --line: #1a1a1a; --dim: #555; --text: #c0c0c0; --bad: #ff5370; --warn: #ffcb6b; --info: #82aaff;
  display: flex; margin-top: 70px; margin-bottom: 70px; height: calc(100vh - 140px);
  font-family: Consolas, "SF Mono", Menlo, Monaco, "Courier New", monospace; color: var(--text); background: var(--bg);
  position: relative;
}
html.is-embed .pi-app { margin: 0; height: 100vh; }
.pi-app [hidden] { display: none !important; }
.pi-app *, .pi-palette *, .pi-help * { box-sizing: border-box; }

.pi-left { width: 300px; min-width: 300px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.pi-center { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.pi-right { width: 560px; min-width: 320px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }

.pi-header { padding: 8px 12px; background: #0a0a0a; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pi-title { color: var(--acc); font-size: 13px; font-weight: bold; }
.pi-sub { color: #444; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-section { padding: 10px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.pi-section-title { color: var(--acc); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pi-hint { color: #444; font-size: 10px; text-transform: none; letter-spacing: 0; }
.pi-note { font-size: 10px; color: var(--dim); margin-top: 4px; line-height: 1.5; }
.pi-tree-section { border-bottom: none; padding-bottom: 4px; }
.pi-tree-host { position: relative; flex: 1; min-height: 120px; overflow: hidden; outline: none; }

.pi-drop { border: 2px dashed #333; border-radius: 4px; padding: 16px 12px; text-align: center; cursor: pointer; transition: border-color 0.2s; }
.pi-drop:hover, .pi-drop.drag-over { border-color: var(--acc); }
.pi-drop-icon { font-size: 24px; margin-bottom: 4px; }
.pi-drop-text { font-size: 11px; color: #666; }
.pi-drop-sub { font-size: 10px; color: #3a3a3a; margin-top: 6px; }
.pi-url-row { display: flex; gap: 6px; margin: 8px 0; }
.pi-url-row input { flex: 1; min-width: 0; background: #0a0a0a; border: 1px solid #2a2a2a; color: #ccc; font-family: inherit; font-size: 11px; padding: 6px 8px; outline: none; }
.pi-url-row input:focus { border-color: var(--acc); }
.pi-btn { display: block; width: 100%; padding: 8px; border: 1px solid #333; background: transparent; color: var(--text); font-family: inherit; font-size: 12px; cursor: pointer; text-align: center; transition: all 0.2s; }
.pi-btn:hover { border-color: var(--acc); color: var(--acc); }
.pi-btn-mini { padding: 4px 10px; border: 1px solid #333; background: transparent; color: #aaa; font-family: inherit; font-size: 10px; cursor: pointer; letter-spacing: 1px; transition: all 0.2s; white-space: nowrap; flex-shrink: 0; }
.pi-btn-mini:hover:not(:disabled) { border-color: var(--acc); color: var(--acc); }
.pi-btn-mini:disabled { opacity: 0.3; cursor: not-allowed; }
.pi-btn-mini.on { border-color: var(--acc); color: var(--acc); background: #00ff8812; }
.pi-btn-mini + .pi-btn-mini { margin-left: 4px; }
.pi-btn-help { border-color: #00ff8866; color: var(--acc); }

#info .row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; font-size: 11px; }
#info .k { color: #666; white-space: nowrap; }
#info .v { color: #ddd; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#info .v.acc { color: var(--acc); }
#info .v.bad { color: var(--bad); }
#info .v.warn { color: var(--warn); }
#info details { margin-top: 4px; font-size: 11px; }
#info summary { color: #777; cursor: pointer; }
#info details .row .v { white-space: normal; text-align: right; word-break: break-all; }

.pi-tabbar { display: flex; align-items: center; gap: 2px; padding: 0 8px; height: 33px; background: #0a0a0a; border-bottom: 1px solid var(--line); flex-shrink: 0; overflow: hidden; }
.pi-tab { background: transparent; border: none; border-bottom: 2px solid transparent; color: #666; font-family: inherit; font-size: 11px; letter-spacing: 1px; padding: 8px 10px; cursor: pointer; white-space: nowrap; }
.pi-tab:hover { color: #aaa; }
.pi-tab.active { color: var(--acc); border-bottom-color: var(--acc); }
.pi-tab-spacer { flex: 1; }
.pi-badge { display: inline-block; min-width: 14px; padding: 0 4px; border-radius: 7px; font-size: 9px; line-height: 14px; text-align: center; background: #222; color: #888; letter-spacing: 0; }
.pi-badge.bad { background: #ff537033; color: var(--bad); }
.pi-badge.warn { background: #ffcb6b22; color: var(--warn); }
.pi-badge.ok { background: #00ff8818; color: var(--acc); }
.pi-goto { min-width: 0; flex-shrink: 1; width: 190px; background: #0a0a0a; border: 1px solid #2a2a2a; color: #777; font-family: inherit; font-size: 10px; padding: 4px 8px; text-align: left; cursor: pointer; margin-right: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-goto:hover:not(:disabled) { border-color: var(--acc); color: #aaa; }
.pi-goto:disabled { opacity: 0.3; cursor: default; }

.pi-crumbs { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 11px; border-bottom: 1px solid var(--line); background: #0b0b0b; min-height: 26px; flex-shrink: 0; overflow: hidden; white-space: nowrap; }
.pi-crumbs .back { background: transparent; border: 1px solid #2a2a2a; color: #888; font-size: 9px; padding: 2px 6px; cursor: pointer; font-family: inherit; }
.pi-crumbs .back:hover:not(:disabled) { color: var(--acc); border-color: var(--acc); }
.pi-crumbs .back:disabled { opacity: 0.25; cursor: default; }
.pi-crumbs .crumb { color: #777; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.pi-crumbs .crumb:hover { color: var(--acc); }
.pi-crumbs .crumb.cur { color: #ddd; cursor: default; }
.pi-crumbs .sep { color: #333; }
.pi-crumbs .hint { margin-left: auto; color: #3a3a3a; font-size: 10px; padding-left: 12px; }

.pi-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pi-view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.pi-view.active { display: flex; }
.pi-head { flex-shrink: 0; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #0b0b0b; font-size: 11px; line-height: 1.6; }
.pi-head:empty { display: none; }
.pi-host { position: relative; flex: 1; min-height: 0; overflow: hidden; outline: none; }
.pi-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 32px; font-size: 12px; }
.pi-app .vview canvas { position: absolute; left: 0; top: 0; display: block; }
.pi-app .vsb { position: absolute; right: 0; top: 0; bottom: 0; width: 10px; background: #0a0a0a; border-left: 1px solid #161616; }
.pi-app .vsb-thumb { position: absolute; left: 2px; right: 2px; background: #2a2a2a; border-radius: 3px; display: none; cursor: grab; }
.pi-app .vsb-thumb:hover { background: #00ff8866; }

.pi-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: #333; font-size: 13px; pointer-events: none; }
.pi-empty-sub { margin-top: 10px; font-size: 11px; color: #2a2a2a; }
.pi-error { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); max-width: 80%; background: #1a0d0f; border: 1px solid var(--bad); color: #ddd; padding: 12px 16px; font-size: 12px; z-index: 5; }
.pi-error .t { color: var(--bad); font-size: 11px; letter-spacing: 1px; margin-bottom: 6px; }
.pi-progress { position: absolute; inset: 0; background: rgba(0,0,0,0.7); align-items: center; justify-content: center; z-index: 10; display: none; }
.pi-progress.active { display: flex; }
.pi-progress-text { color: var(--acc); font-size: 11px; }

/* 見出し（オブジェクトの情報など） */
.pi-head .title { color: #eee; font-size: 13px; }
.pi-head .title .num { color: var(--acc); }
.pi-head .meta { color: #666; }
.pi-head .meta b { color: #aaa; font-weight: normal; }
.pi-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pi-chip { border: 1px solid #2a2a2a; color: #999; padding: 1px 7px; font-size: 10px; cursor: pointer; background: transparent; font-family: inherit; }
.pi-chip:hover { border-color: var(--acc); color: var(--acc); }
.pi-chip.ref { color: #ff6b9a; border-color: #ff6b9a44; }
.pi-chip.static { cursor: default; }
.pi-chip.static:hover { border-color: #2a2a2a; color: #999; }
.pi-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pi-row + .pi-row { margin-top: 4px; }
.pi-k { color: var(--acc); font-size: 10px; letter-spacing: 1px; }
.pi-dimtext { color: #555; }
.pi-badtext { color: var(--bad); }
.pi-warntext { color: var(--warn); }
.pi-oktext { color: var(--acc); }

/* ストリームの展開の流れ */
.pi-pipe { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pi-pipe .box { border: 1px solid #2a2a2a; padding: 2px 8px; color: #bbb; background: #101010; }
.pi-pipe .box.f { border-color: #82aaff55; color: #82aaff; }
.pi-pipe .box.err { border-color: var(--bad); color: var(--bad); }
.pi-pipe .box.warn { border-color: #ffcb6b88; color: var(--warn); }
.pi-pipe .arr { color: #444; }
.pi-preview { margin-top: 8px; display: flex; gap: 12px; align-items: flex-start; }
.pi-preview canvas, .pi-preview img { max-width: 260px; max-height: 200px; background: repeating-conic-gradient(#1a1a1a 0 25%, #121212 0 50%) 0 0 / 16px 16px; border: 1px solid #222; image-rendering: pixelated; }

/* 診断 */
.pi-diag-item { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; padding: 5px 6px; border-bottom: 1px solid #151515; cursor: pointer; align-items: baseline; }
.pi-diag-item:hover { background: #151515; }
.pi-lv { font-size: 9px; letter-spacing: 1px; text-align: center; padding: 1px 0; border: 1px solid; }
.pi-lv.error { color: var(--bad); border-color: #ff537066; }
.pi-lv.warn { color: var(--warn); border-color: #ffcb6b55; }
.pi-lv.info { color: var(--info); border-color: #82aaff44; }
.pi-diag-msg { color: #ccc; line-height: 1.5; word-break: break-all; }
.pi-diag-where { color: #555; font-size: 10px; white-space: nowrap; }
.pi-diag-group { color: #777; font-size: 10px; letter-spacing: 1px; margin: 16px 0 4px; }
.pi-filter { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

/* リビジョン */
.pi-rev { border: 1px solid #1f1f1f; background: #101010; margin-bottom: 10px; }
.pi-rev-head { display: flex; gap: 12px; align-items: baseline; padding: 8px 10px; cursor: default; flex-wrap: wrap; }
.pi-rev-head:hover { background: #141414; }
.pi-rev-no { color: var(--acc); font-size: 13px; }
.pi-rev-meta { color: #777; font-size: 11px; }
.pi-rev-bar { height: 4px; background: #181818; margin: 0 10px 8px; position: relative; }
.pi-rev-bar span { position: absolute; top: 0; bottom: 0; background: var(--acc); opacity: 0.6; }
.pi-rev-objs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 10px; }
.pi-rev-obj { font-size: 10px; padding: 1px 6px; border: 1px solid #2a2a2a; color: #aaa; cursor: pointer; background: transparent; font-family: inherit; }
.pi-rev-obj:hover { border-color: var(--acc); color: var(--acc); }
.pi-rev-obj.added { border-color: #7ee78744; color: #7ee787; }
.pi-rev-obj.changed { border-color: #ffcb6b44; color: var(--warn); }
.pi-rev-obj.deleted { border-color: #ff537044; color: var(--bad); text-decoration: line-through; }
.pi-diff { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid #222; }
.pi-diff-cols { flex: 1; min-height: 0; display: flex; }
.pi-diff-cols .pi-host + .pi-host { border-left: 1px solid #222; }

/* 統計・リソース */
.pi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pi-card { border: 1px solid #1f1f1f; background: #111; padding: 10px 12px; }
.pi-card .ck { color: #555; font-size: 10px; letter-spacing: 1px; }
.pi-card .cv { color: #eee; font-size: 20px; margin: 4px 0 2px; }
.pi-card .cs { color: #666; font-size: 10px; }
.pi-h3 { color: var(--acc); font-size: 11px; letter-spacing: 1px; font-weight: normal; margin: 22px 0 8px; }
.pi-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pi-table th { text-align: left; color: #555; font-weight: normal; border-bottom: 1px solid #222; padding: 3px 6px; white-space: nowrap; }
.pi-table td { padding: 3px 6px; border-bottom: 1px solid #151515; vertical-align: top; }
.pi-table tr.link { cursor: pointer; }
.pi-table tr.link:hover td { background: #151515; }
.pi-bar { height: 6px; background: #171717; min-width: 60px; }
.pi-bar span { display: block; height: 100%; background: var(--acc); opacity: 0.6; }
.pi-pre { white-space: pre-wrap; word-break: break-all; background: #0a0a0a; border: 1px solid #1a1a1a; padding: 8px; font-size: 11px; max-height: 360px; overflow: auto; color: #bbb; }

/* ページ */
.pi-page-wrap { flex: 1; min-height: 0; display: flex; }
.pi-page-stage { flex: 1; min-width: 0; overflow: auto; position: relative; background: #1a1a1a; display: flex; align-items: flex-start; justify-content: center; padding: 16px; }
.pi-page-stage canvas { background: #fff; box-shadow: 0 0 24px #000a; }
.pi-page-side { width: 360px; border-left: 1px solid var(--line); position: relative; display: flex; flex-direction: column; min-height: 0; }
.pi-page-side:empty { display: none; }
.pi-range { width: 100%; }

/* ステータス・凡例 */
.pi-status { flex-shrink: 0; min-height: 72px; padding: 6px 10px; border-top: 1px solid var(--line); background: #0a0a0a; font-size: 11px; color: #bbb; line-height: 1.6; }
.pi-status .k { color: var(--acc); font-size: 10px; letter-spacing: 1px; margin-right: 2px; }
.pi-status .d { color: #555; }
.pi-status .path { color: #ffcb6b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-status .doc { color: #aaa; }
.pi-status .op { color: #fff; }
.pi-status .sig { color: #89ddff; margin: 0 4px; }
.pi-legend { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 3px 10px; padding: 6px 10px 8px; border-top: 1px solid #161616; font-size: 10px; color: #666; }
.pi-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; vertical-align: -1px; }

/* パレット */
.pi-palette { width: min(680px, 92vw); padding: 0; background: #0d0d0d; color: var(--text, #c0c0c0); border: 1px solid #00ff8855; box-shadow: 0 0 40px #00ff8815; font-family: Consolas, "SF Mono", Menlo, monospace; margin-top: 12vh; }
.pi-palette::backdrop { background: rgba(0,0,0,0.6); }
.pi-palette input { width: 100%; background: #0a0a0a; border: none; border-bottom: 1px solid #1f1f1f; color: #eee; font-family: inherit; font-size: 13px; padding: 12px 14px; outline: none; }
.pi-pal-list { max-height: 50vh; overflow-y: auto; }
.pi-pal-item { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 6px 14px; font-size: 12px; cursor: pointer; color: #bbb; }
.pi-pal-item .a { color: #00ff88; }
.pi-pal-item .b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #888; }
.pi-pal-item.sel { background: #00ff8814; }
.pi-pal-foot { font-size: 10px; color: #444; padding: 6px 14px; border-top: 1px solid #1a1a1a; }

/* ヘルプ */
.pi-help { width: min(860px, 92vw); max-height: 84vh; padding: 0; background: #0d0d0d; color: #c0c0c0; border: 1px solid #00ff8855; box-shadow: 0 0 40px #00ff8815; font-family: Consolas, "SF Mono", Menlo, monospace; }
.pi-help::backdrop { background: rgba(0,0,0,0.72); }
.pi-help-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #0a0a0a; border-bottom: 1px solid #1a1a1a; }
.pi-help-title { color: #00ff88; font-size: 13px; font-weight: bold; letter-spacing: 1px; }
.pi-help-body { padding: 8px 20px 20px; font-size: 12px; line-height: 1.75; overflow-y: auto; max-height: calc(84vh - 46px); }
.pi-help-body h4 { color: #00ff88; font-size: 11px; font-weight: normal; letter-spacing: 1px; margin: 18px 0 6px; }
.pi-help-body p { margin: 0 0 6px; }
.pi-help-body table { width: 100%; border-collapse: collapse; }
.pi-help-body th { text-align: left; vertical-align: top; color: #ddd; font-weight: normal; padding: 4px 12px 4px 0; width: 28%; white-space: nowrap; border-bottom: 1px solid #161616; }
.pi-help-body td { padding: 4px 0; color: #999; border-bottom: 1px solid #161616; }
.pi-help-body th.sub { color: #555; font-size: 10px; padding-top: 10px; }
.pi-help-body code { color: #ffcb6b; background: #151515; padding: 0 4px; }
.pi-help-body kbd { display: inline-block; min-width: 14px; text-align: center; padding: 0 5px; border: 1px solid #333; border-bottom-width: 2px; border-radius: 3px; color: #ddd; font-family: inherit; font-size: 11px; line-height: 1.5; }
.pi-help-body .c-ref { color: #ff6b9a; }

/* 狭い画面 */
.pi-app.left-hidden .pi-left { display: none; }
@media (max-width: 1500px) {
  .pi-right { width: 420px; }
  .pi-left { width: 260px; min-width: 260px; }
}
@media (max-width: 1200px) {
  .pi-right { width: 340px; min-width: 340px; }
  .pi-left { width: 230px; min-width: 230px; }
  .pi-goto { width: 110px; }
  .pi-crumbs .hint { display: none; }
  .pi-tab { padding: 8px 6px; }
  .pi-page-side { width: 280px; }
}
@media (max-width: 900px) {
  .pi-left { display: none; }
  .pi-app.left-shown .pi-left { display: flex; position: absolute; z-index: 20; height: 100%; box-shadow: 8px 0 24px #000a; }
  .pi-right { display: none; }
  .pi-goto { width: 80px; }
}

/* ───── PAGE タブ（描画・ステップ実行） ───── */
#page-head { padding: 6px 12px; }
.pi-pg-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 26px; }
.pi-pg-bar .pi-btn-mini + .pi-btn-mini { margin-left: 0; }
.pi-pg-step { margin-top: 4px; flex-wrap: nowrap; }
.pi-pg-num { color: #888; margin: 0 4px; white-space: nowrap; }
.pi-pg-num b { color: #ccc; font-weight: normal; }
.pi-pg-input { width: 44px; background: #111; border: 1px solid #333; color: var(--acc); font-family: inherit; font-size: 11px; padding: 2px 4px; text-align: right; }
.pi-pg-input:focus { outline: none; border-color: var(--acc); }
.pi-pg-sep { width: 1px; height: 16px; background: #2a2a2a; margin: 0 6px; }
.pi-pg-zoom { color: #aaa; min-width: 74px; text-align: center; }
.pi-pg-info { color: #666; margin-left: auto; white-space: nowrap; }
.pi-pg-warn { color: #ffb000; }
.pi-pg-slider { flex: 1; min-width: 120px; margin: 0 8px; accent-color: #00ff88; height: 14px; }
.pi-pg-op { color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 44%; min-width: 0; }
.pi-pg-op b { color: #ccc; font-weight: normal; }
.pi-pg-op b.step { color: var(--acc); }
.pi-pg-op .t { color: #9cdcfe; }
.pi-pg-op .d { color: #555; }
.pi-page-stage { display: block; }
.pi-pg-holder { position: relative; margin: 0 auto; box-shadow: 0 0 24px #000a; background: #fff; }
.pi-pg-holder canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; box-shadow: none; }
.pi-page-stage canvas.pi-pg-overlay { background: transparent; cursor: crosshair; }
.pi-pg-msg { color: #ff6b6b; padding: 24px; text-align: center; font-size: 12px; }
.pi-pg-side { flex: 1; overflow: auto; font-size: 11px; line-height: 1.55; }
.pi-pg-sec { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.pi-pg-sec > .h { color: var(--acc); font-size: 10px; letter-spacing: 1px; margin-bottom: 4px; }
.pi-pg-sec > .h.warn { color: #ffb000; }
.pi-pg-sec .d { color: #555; letter-spacing: 0; }
.pi-pg-sub { color: #666; font-size: 10px; letter-spacing: 1px; margin: 6px 0 2px; }
.pi-pg-kv { display: flex; gap: 8px; padding: 1px 0; }
.pi-pg-kv > span:first-child { color: #777; flex: 0 0 92px; }
.pi-pg-kv > span:last-child { color: #ccc; min-width: 0; overflow-wrap: anywhere; }
.pi-pg-kv .sw { display: inline-block; width: 10px; height: 10px; border: 1px solid #555; margin-right: 6px; vertical-align: -1px; }
.pi-pg-oprow { display: flex; gap: 8px; padding: 1px 4px; margin: 0 -4px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.pi-pg-oprow:hover { background: #ffffff0d; }
.pi-pg-oprow.sel { background: #00ff8814; }
.pi-pg-oprow .n, .pi-pg-warnrow .n { color: #666; flex: 0 0 auto; min-width: 36px; }
.pi-pg-oprow .t { color: #9cdcfe; overflow: hidden; text-overflow: ellipsis; }
.pi-pg-dec { color: #ce9178; padding: 2px 0; overflow-wrap: anywhere; }
.pi-pg-note { color: #666; }
.pi-pg-acts { display: flex; gap: 4px; margin-top: 6px; }
.pi-pg-warnrow { color: #d7ba7d; padding: 1px 0; overflow-wrap: anywhere; }
.pi-pg-warnrow[data-op] { cursor: pointer; }
.pi-pg-warnrow .n { margin-right: 8px; }

/* ───── RESOURCES タブ ───── */
.pi-res { padding: 0 0 40px; font-size: 11px; line-height: 1.6; }
.pi-res-loading { padding: 24px; color: #777; }
.pi-res-loading.err { color: #ff6b6b; }
.pi-res-toc { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; background: #0b0b0bf2; border-bottom: 1px solid var(--line); }
.pi-res-toc button { border: 1px solid #2a2a2a; background: transparent; color: #aaa; font-family: inherit; font-size: 10px; padding: 3px 9px; cursor: pointer; letter-spacing: 1px; }
.pi-res-toc button:hover { border-color: var(--acc); color: var(--acc); }
.pi-res-toc button b { color: var(--acc); font-weight: normal; margin-left: 2px; }
.pi-res-toc button.zero { color: #555; } .pi-res-toc button.zero b { color: #444; }
.pi-res-toc button.warn b { color: #ffb000; } .pi-res-toc button.bad b { color: #ff6b6b; }
.pi-res-sec { padding: 10px 14px 14px; border-bottom: 1px solid var(--line); scroll-margin-top: 44px; }
.pi-res-sec h3 { margin: 0 0 8px; font-size: 11px; font-weight: normal; color: var(--acc); letter-spacing: 2px; }
.pi-res-sec h3 .c { color: #888; letter-spacing: 0; margin-left: 4px; } .pi-res-sec h3 .n { color: #ffb000; letter-spacing: 0; margin-left: 10px; font-size: 10px; }
.pi-res-empty { color: #555; }
.pi-res .d { color: #666; } .pi-res .ok { color: #00ff88; } .pi-res .ng { color: #ff6b6b; } .pi-res .wn { color: #ffb000; } .pi-res .na { color: #666; }
.pi-res .tag { display: inline-block; border: 1px solid #333; color: #999; padding: 0 5px; font-size: 9px; margin: 0 4px 0 0; }
.pi-res .tag.on { color: #00ff88; border-color: #00ff8855; } .pi-res .tag.off { color: #777; }
.pi-res .pi-chip { margin-left: 6px; }
.pi-res-font { padding: 6px 8px; border: 1px solid #1c1c1c; margin-bottom: 4px; background: #0d0d0d; }
.pi-res-font .l1 { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.pi-res-font .nm, .pi-res-row .nm, .pi-res-sig .nm { color: #eee; font-size: 12px; margin-right: 6px; }
.pi-res-font .l1 .tag { margin-left: 2px; } .pi-res-font .l1 .d { margin-left: 8px; }
.pi-res-font .l2 { display: flex; flex-wrap: wrap; gap: 2px 16px; color: #999; }
.pi-res .note { color: #d7ba7d; }
.pi-res-font .sheet { margin-top: 8px; }
.pi-res-font .sheet canvas { max-width: 100%; image-rendering: auto; display: block; border: 1px solid #222; }
.pi-res-font .cellinfo, .pi-res-font .celltip { color: #888; padding: 3px 0; min-height: 18px; }
.pi-res-font .celltip { color: #9cdcfe; }
.pi-res-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.pi-res-img { display: flex; gap: 8px; border: 1px solid #1c1c1c; background: #0d0d0d; padding: 6px; cursor: pointer; min-width: 0; }
.pi-res-img:hover { border-color: var(--acc); }
.pi-res-img .th { flex: 0 0 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#222 0% 25%, #2c2c2c 0% 50%) 0 0 / 12px 12px; }
.pi-res-img .th canvas { max-width: 64px; max-height: 64px; }
.pi-res-img .th .x { color: #777; font-size: 9px; }
.pi-res-img .m { color: #aaa; min-width: 0; overflow-wrap: anywhere; line-height: 1.45; } .pi-res-img .m b { color: #ff6b9a; font-weight: normal; }
.pi-res-sig { border: 1px solid #1c1c1c; background: #0d0d0d; padding: 8px 10px; margin-bottom: 6px; }
.pi-res-sig .l1 { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
.pi-res-sig .st { border: 1px solid; padding: 0 8px; font-size: 10px; margin-right: 8px; }
.pi-res .kv { display: flex; gap: 10px; padding: 1px 0; }
.pi-res .kv > span:first-child { flex: 0 0 150px; color: #777; }
.pi-res .kv > span:last-child { color: #ccc; min-width: 0; overflow-wrap: anywhere; }
.pi-res .checks { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #222; color: #ccc; }
.pi-res details { margin-top: 6px; color: #aaa; } .pi-res summary { cursor: pointer; color: #888; }
.pi-res .cert { padding: 3px 0 3px 12px; }
.pi-res-foot { color: #666; margin-top: 6px; }
.pi-res-sub { color: #888; letter-spacing: 1px; font-size: 10px; margin: 8px 0 3px; }
.pi-res-pre { white-space: pre-wrap; overflow-wrap: anywhere; color: #9a9a9a; background: #0a0a0a; border: 1px solid #1c1c1c; padding: 8px; max-height: 360px; overflow: auto; font-family: inherit; font-size: 10.5px; }
.pi-res-row { padding: 2px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; }
.pi-res-row .v { color: #ce9178; margin-left: 8px; } .pi-res-row .c { color: #888; margin-right: 6px; }
.pi-res-row .smp { flex-basis: 100%; color: #8a8a8a; padding-left: 14px; overflow-wrap: anywhere; }
