/* =====================================================================
   Activity - task manager  (.app-taskmanager)
   ===================================================================== */
.tm-bar { flex: 1; display: flex; justify-content: center; padding-right: 60px; pointer-events: none; }
.tm-bar .seg { pointer-events: auto; }
.tm-seg button .ic { display: inline; }
.app-taskmanager { background: var(--surface); }
.tm-view { display: none; flex: 1; min-height: 0; }
.tm-view.on { display: flex; }
.tm-procs { flex-direction: column; }

/* processes */
.tm-toolbar { gap: 12px; padding: 0 12px; }
.tm-search { width: 220px; }
.tm-search .input { height: 30px; border-radius: 15px; background: var(--tile); box-shadow: none; }
.tm-search .input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.tm-summary { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.tm-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.tm-end:not(:disabled) { background: #e5484d; color: #fff; box-shadow: none; }
.tm-end:not(:disabled):hover { background: #e5484d; filter: brightness(1.08); }
.tm-end .ic { display: inline; }
.tm-table { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tm-scroll { flex: 1; }
.tm-row { display: grid; grid-template-columns: minmax(0, 1fr) 132px 92px 108px; align-items: stretch; }
.tm-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.tm-th { height: 34px; border: 0; background: none; padding: 0 14px; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); text-align: left; }
.tm-th:hover { background: var(--hover); color: var(--text); }
.tm-th.tm-c-cpu, .tm-th.tm-c-mem { justify-content: flex-end; }
.tm-th + .tm-th { box-shadow: inset 1px 0 0 var(--line); }
.tm-sort { width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; opacity: 0; }
.tm-th.sorted { color: var(--accent); }
.tm-th.sorted .tm-sort { opacity: 1; }
.tm-th.sorted.asc .tm-sort { transform: rotate(180deg); margin-top: -4px; }
.tm-group { padding: 12px 14px 6px; font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.tm-proc { min-height: 40px; border-radius: 0; transition: background .1s; }
.tm-proc:hover { background: var(--hover); }
.tm-proc.sel { background: rgba(var(--accent-rgb), .16); box-shadow: inset 3px 0 0 var(--accent); }
.tm-td { display: flex; align-items: center; padding: 0 14px; min-width: 0; font-size: 13px; }
.tm-td.num { justify-content: flex-end; font-variant-numeric: tabular-nums; font-weight: 600; transition: background .6s; }
.tm-proc.sel .tm-td.num { background: transparent !important; }
.tm-c-name { gap: 10px; }
.tm-c-name .appicon { box-shadow: none; flex: 0 0 auto; }
.tm-c-name .appicon .rt-badge { box-shadow: 0 0 0 1.5px var(--surface); }
.tm-pname { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tm-pname b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-pname small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-sysic { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 6px; display: grid; place-items: center; background: var(--tile-hover); color: var(--text-2); }
.tm-empty { padding: 50px 20px; }

/* performance */
.tm-perf { min-height: 0; }
.tm-side { width: 230px; gap: 4px; padding: 10px 8px; }
.tm-side-item { height: auto; padding: 8px; gap: 12px; align-items: center; }
.tm-side-item .tm-spark { width: 72px; height: 38px; flex: 0 0 auto; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.tm-side-item.on .tm-spark { box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .55); }
.tm-side-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.tm-side-text b { font-size: 13.5px; font-weight: 700; }
.tm-side-val { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tm-p-main { padding: 18px 22px 18px; gap: 12px; overflow-y: auto; }
.tm-p-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tm-p-title { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.tm-p-title .ic { color: var(--accent); }
.tm-p-sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.tm-p-now { font-family: var(--font-display); font-size: 26px; font-weight: 300; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tm-chart-wrap { position: relative; flex: 1 1 200px; min-height: 170px; padding: 20px 0 20px; }
.tm-chart { width: 100%; height: 100%; display: block; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-2); background: linear-gradient(180deg, rgba(var(--accent-rgb), .03), transparent); }
.tm-ax { position: absolute; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tm-ax.tl { top: 0; left: 0; } .tm-ax.tr { top: 0; right: 0; }
.tm-ax.bl { bottom: 0; left: 0; } .tm-ax.br { bottom: 0; right: 0; }
.tm-chart-wrap.dual::after { content: 'Receive - solid   ·   Send - dashed'; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--text-3); white-space: pre; }
.tm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; flex: 0 0 auto; }
.tm-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tm-stat span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.tm-stat b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tm-stat.big b { font-family: var(--font-display); font-size: 21px; font-weight: 400; }

/* narrow / phone */
.app-taskmanager.tm-narrow .tm-row { grid-template-columns: minmax(0, 1fr) 70px 86px; }
.app-taskmanager.tm-narrow .tm-c-runtime { display: none; }
.app-taskmanager.tm-narrow .tm-summary span:nth-child(n+2) { display: none; }
.app-taskmanager.tm-narrow .tm-search { width: auto; flex: 1; min-width: 0; }
.app-taskmanager.tm-narrow .toolbar-spacer { display: none; }
.app-taskmanager.tm-narrow .tm-perf { flex-direction: column; }
.app-taskmanager.tm-narrow .tm-side { width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
.app-taskmanager.tm-narrow .tm-side-item { flex: 0 0 auto; width: auto; flex-direction: column; align-items: flex-start; gap: 6px; }
.app-taskmanager.tm-narrow .tm-side-item .tm-spark { width: 92px; }
.app-taskmanager.tm-narrow .tm-side-val { display: none; }
.app-taskmanager.tm-narrow .tm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-taskmanager.tm-narrow .tm-p-main { padding: 14px; }
.tm-bar.compact { padding-right: 0; justify-content: flex-end; }
.tm-bar.compact .seg button { padding: 0 10px; }
.tm-bar.compact .seg button span { display: none; }
[data-layout="mobile"] .win[data-app="taskmanager"] .win-title-text { display: none; }
