/* System monitor. */

.sysmon { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sm-tabs { flex: none; display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--stroke); }
.sm-tab { padding: 7px 14px; font-size: 12.5px; color: var(--text-2); border-radius: var(--radius-s) var(--radius-s) 0 0; border: 1px solid transparent; border-bottom: none; }
.sm-tab:hover { color: var(--text-1); background: var(--hover); }
.sm-tab.on { background: var(--bg-2); color: var(--text-1); border-color: var(--stroke); }
.sm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }

.sm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sm-card { border: 1px solid var(--stroke); border-radius: var(--radius-m); padding: 12px 14px; background: var(--bg-1); }
.sm-card .sc-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); }
.sm-card .sc-val { font-size: 21px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.sm-card .sc-sub { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.sm-graph { margin-top: 9px; height: 54px; }
.sm-graph canvas { width: 100%; height: 100%; display: block; }

.sm-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.sm-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); padding: 7px 10px; border-bottom: 1px solid var(--stroke); position: sticky; top: 0; background: var(--surface-solid); }
.sm-table td { padding: 6px 10px; border-bottom: 1px solid var(--stroke); }
.sm-table tr:hover td { background: var(--hover); }
.sm-table .p-name { font-family: var(--font-mono); }
.sm-table .agent-tag { color: var(--accent); }
.sm-table .crit { color: var(--warning); }
.sm-kill { font-size: 11px; padding: 3px 9px; border-radius: 5px; color: var(--text-2); border: 1px solid var(--stroke); }
.sm-kill:hover { color: #ff6b5e; border-color: rgba(217,45,32,.4); }
.cpu-bar { width: 64px; height: 5px; background: var(--bg-4); border-radius: 4px; overflow: hidden; }
.cpu-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.cpu-bar i.hot { background: var(--warning); }

/* Browser */
.zbrowse { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.zb-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--stroke); }
.zb-nav { width: 30px; height: 30px; border-radius: var(--radius-s); display: grid; place-items: center; color: var(--text-2); }
.zb-nav:hover { background: var(--hover); color: var(--text-1); }
.zb-nav[disabled] { opacity: .35; pointer-events: none; }
.zb-url {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--stroke); border-radius: 999px;
  padding: 6px 14px;
}
.zb-url .icon { color: var(--text-3); }
.zb-url.secure .icon { color: var(--success); }
.zb-url.offline .icon { color: var(--danger); }
.zb-url input { flex: 1; background: none; border: none; outline: none; font-size: 12.5px; color: var(--text-1); font-family: var(--font-mono); }
.zb-page { flex: 1; min-height: 0; overflow-y: auto; background: var(--bg); user-select: text; }
.zb-error { display: grid; place-content: center; height: 100%; text-align: center; gap: 10px; color: var(--text-2); padding: 30px; }
.zb-error .big { font-size: 17px; color: var(--text-1); }

.wiki-page { max-width: 760px; margin: 0 auto; padding: 34px 38px; line-height: 1.65; font-size: 13.5px; color: var(--text); }
.wiki-page h1 { font-size: 24px; border-bottom: 2px solid var(--stroke-2); padding-bottom: 8px; margin-bottom: 14px; }
.wiki-page h2 { font-size: 17px; margin: 22px 0 8px; border-bottom: 1px solid var(--stroke); padding-bottom: 4px; }
.wiki-page p { margin: 8px 0; }
.wiki-page code, .wiki-page .mono { font-family: var(--font-mono); font-size: 12px; background: var(--bg-3); padding: 1px 6px; border-radius: 4px; }
.wiki-page pre { background: var(--bg-1); border: 1px solid var(--stroke); border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 10px 0; }
.wiki-page pre code { background: none; padding: 0; }
.wiki-page .wikibar { display: flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-bottom: 18px; }
.wiki-page .wikibar .arch-tag { color: var(--arch-blue); font-weight: 700; }
.wiki-note { border-left: 3px solid var(--arch-blue); background: rgba(23,147,209,.07); padding: 8px 12px; border-radius: 0 6px 6px 0; margin: 10px 0; font-size: 12.5px; }

/* Calculator */
.calc { flex: 1; display: flex; flex-direction: column; padding: 10px; gap: 8px; }
.calc-screen { text-align: right; padding: 14px 10px 6px; min-height: 84px; display: flex; flex-direction: column; justify-content: flex-end; }
.calc-expr { color: var(--text-3); font-size: 13px; min-height: 18px; font-family: var(--font-mono); }
.calc-main { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; word-break: break-all; }
.calc-keys { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-k {
  border-radius: var(--radius-s); font-size: 16px; color: var(--text-1);
  background: var(--bg-2); border: 1px solid var(--stroke);
  display: grid; place-items: center; min-height: 42px;
}
.calc-k:hover { background: var(--bg-3); }
.calc-k:active { transform: translateY(1px); }
.calc-k.op { background: var(--bg-3); color: var(--accent); font-weight: 600; }
.calc-k.eq { background: var(--accent); color: #fff; border-color: transparent; font-weight: 700; }
.calc-k.fn { color: var(--text-2); font-size: 13.5px; }
.calc-hist { max-height: 90px; overflow-y: auto; padding: 0 10px 6px; display: flex; flex-direction: column; gap: 3px; }
.calc-hist .h-row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }

/* Welcome */
.welcome { flex: 1; min-height: 0; display: flex; }
.wc-side { width: 210px; flex: none; border-right: 1px solid var(--stroke); background: var(--bg-1); padding: 14px 10px; }
.wc-hero { display: flex; gap: 12px; align-items: center; padding: 4px 8px 16px; }
.wc-hero .t { font-weight: 700; font-size: 14px; }
.wc-hero .s { font-size: 11px; color: var(--text-2); }
.wc-nav-item { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--radius-s); font-size: 12.5px; color: var(--text-1); }
.wc-nav-item:hover { background: var(--hover); }
.wc-nav-item.on { background: var(--accent-soft); font-weight: 600; }
.wc-nav-item .icon { color: var(--text-2); }
.wc-body { flex: 1; min-width: 0; overflow-y: auto; padding: 26px 30px; }
.wc-body h1 { font-size: 20px; margin-bottom: 4px; }
.wc-body h3 { font-size: 14.5px; margin: 20px 0 8px; color: var(--text-1); }
.wc-body p, .wc-body li { font-size: 13px; color: var(--text); line-height: 1.65; }
.wc-body ul, .wc-body ol { padding-left: 20px; margin: 8px 0; display: grid; gap: 5px; }
.wc-body code { font-family: var(--font-mono); font-size: 11.5px; background: var(--bg-3); padding: 1px 6px; border-radius: 4px; }
.wc-body pre { background: var(--bg-1); border: 1px solid var(--stroke); border-radius: 8px; padding: 12px 14px; font-family: var(--font-mono); font-size: 12px; overflow-x: auto; margin: 10px 0; }
.wc-check { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--stroke); border-radius: var(--radius-s); margin-bottom: 6px; }
.wc-check .icon { color: var(--text-3); }
.wc-check.done .icon { color: var(--success); }
.wc-check .ck-t { font-size: 12.5px; }
.wc-check .ck-s { font-size: 11px; color: var(--text-2); }
.wc-check .go { margin-left: auto; }
kbd {
  font-family: var(--font-mono); font-size: 11px;
  background: var(--bg-3); border: 1px solid var(--stroke-2); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px;
}
.wc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wc-table td { padding: 6px 10px; border-bottom: 1px solid var(--stroke); }
.wc-table td:first-child { width: 190px; color: var(--text-2); }

/* Paint / weather / music (optional apps) */
.paint-wrap { flex: 1; min-height: 0; display: flex; }
.paint-tools { width: 52px; flex: none; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-right: 1px solid var(--stroke); }
.paint-tool-btn { width: 36px; height: 36px; border-radius: var(--radius-s); display: grid; place-items: center; color: var(--text-2); }
.paint-tool-btn.on { background: var(--accent-soft); color: var(--accent); }
.paint-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--stroke-2); cursor: pointer; }
.paint-canvas-wrap { flex: 1; min-width: 0; position: relative; background: #fff; }
.paint-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }

.weather { flex: 1; overflow-y: auto; padding: 22px; text-align: center; }
.weather .w-now { font-size: 46px; font-weight: 700; }
.weather .w-desc { color: var(--text-2); }
.w-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-top: 20px; }
.w-day { border: 1px solid var(--stroke); border-radius: var(--radius-m); padding: 12px 6px; }
.w-agent-note { margin-top: 18px; border: 1px dashed var(--accent); border-radius: var(--radius-m); padding: 12px; color: var(--text-2); font-size: 12px; text-align: left; }

.music { flex: 1; display: flex; flex-direction: column; padding: 14px; gap: 10px; }
.music-art { width: 130px; height: 130px; border-radius: var(--radius-l); margin: 0 auto; background: linear-gradient(135deg, var(--accent), #7C5CFC); display: grid; place-items: center; color: #fff; }
.music-track { text-align: center; }
.music-track .mt { font-weight: 600; }
.music-track .ma { font-size: 12px; color: var(--text-2); }
.music-prog { height: 4px; background: var(--bg-4); border-radius: 4px; overflow: hidden; }
.music-prog i { display: block; height: 100%; background: var(--accent); }
.music-ctrls { display: flex; justify-content: center; gap: 12px; align-items: center; }
.music-ctrls button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); }
.music-ctrls button.play { width: 52px; height: 52px; background: var(--accent); color: #fff; }
.music-list { flex: 1; overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.music-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-s); font-size: 12.5px; }
.music-row:hover { background: var(--hover); }
.music-row.on { background: var(--accent-soft); }
