/* Right panel: context section and workspace files. */
/* right panel */
.rpanel { background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.rsec { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.rsec.grow { flex: 1; display: flex; flex-direction: column; min-height: 260px; border-bottom: 0; }
.ctx-head { display: flex; align-items: center; gap: 4px; }
.ctx-toggle { flex: 1; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; text-align: left; }
.ctx-toggle:hover { background: var(--panel-2); }
.ctx-toggle b { flex: 1; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ctx-pct { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ctx-chev { color: var(--muted); transform: rotate(-90deg); transition: transform .15s; }
.ctx-toggle[aria-expanded="true"] .ctx-chev { transform: none; }
#ctxBody { margin-top: 12px; }
.ctx-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 6px; }
.ctx-top b { font-variant-numeric: tabular-nums; }
.ctx-top span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.seg-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--panel-2); margin-bottom: 12px; }
.seg-bar i { display: block; height: 100%; min-width: 2px; }
.seg-bar i.buffer { margin-left: auto; background: repeating-linear-gradient(135deg, var(--border) 0 3px, transparent 3px 6px); }
.legend { display: grid; grid-template-columns: 10px 1fr auto 44px; gap: 5px 8px; align-items: center; font-size: 12.5px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .num { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.legend .pc { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.legend .dim { color: var(--muted); }
.legend .gap { grid-column: 1 / -1; height: 4px; }
.ctx-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.ctx-foot span { white-space: nowrap; }
.ctx-meta-note { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.ctx-meta-note button { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 0; font-size: 11.5px; }
.mini-bar { width: 34px; height: 5px; border-radius: 99px; background: var(--panel-2); overflow: hidden; display: inline-block; }
.mini-bar i { display: block; height: 100%; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12.5px; margin: 10px 0 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.tree { flex: 1; overflow-y: auto; margin: 0 -8px; padding: 2px 0; border-radius: 8px; min-height: 80px; }
.tree.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.node { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; user-select: none; }
.node:hover { background: var(--panel-2); }
.node.menu-open { background: var(--panel-2); }
.node .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .sz { color: var(--muted); font-size: 11.5px; }
.node .icon-btn { opacity: 0; width: 22px; height: 22px; }
.node:hover .icon-btn, .node.menu-open .icon-btn { opacity: 1; }
@media (hover: none) { .node .icon-btn { opacity: 1; } }
.caret { width: 12px; color: var(--muted); font-size: 10px; flex: none; text-align: center; }
.tree-empty { color: var(--muted); font-size: 12.5px; padding: 10px; text-align: center; }
