@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}

:root,
[data-palette="graphite"] {
  --bg: #0c0d0e;
  --panel: #121315;
  --fg: #e7e6e2;
  --dim: #82858b;
  --faint: #2a2c30;
  --line: #1d1f22;
  --accent: #9fe0b4;
  --key: #8fbcf0;
  --warn: #e6c27a;
  --err: #ef7d73;
  --sel: rgba(231, 230, 226, 0.05);
  color-scheme: dark;
}
[data-palette="phosphor"] {
  --bg: #060a07;
  --panel: #0a110c;
  --fg: #b6f5c4;
  --dim: #5e8f69;
  --faint: #1b3524;
  --line: #12241a;
  --accent: #6dfc8e;
  --key: #d9ffe2;
  --warn: #f2d27a;
  --err: #ff7a6e;
  --sel: rgba(109, 252, 142, 0.06);
  color-scheme: dark;
}
[data-palette="amber"] {
  --bg: #0d0a07;
  --panel: #14100b;
  --fg: #f3dcb4;
  --dim: #94795a;
  --faint: #382c1d;
  --line: #241c13;
  --accent: #ffb64a;
  --key: #ffe6b8;
  --warn: #ffd98a;
  --err: #ff7b5c;
  --sel: rgba(255, 182, 74, 0.06);
  color-scheme: dark;
}
[data-palette="nord"] {
  --bg: #20242c;
  --panel: #262b34;
  --fg: #e5e9f0;
  --dim: #8891a3;
  --faint: #3d4454;
  --line: #313744;
  --accent: #88c0d0;
  --key: #81a1c1;
  --warn: #ebcb8b;
  --err: #d08770;
  --sel: rgba(136, 192, 208, 0.06);
  color-scheme: dark;
}
[data-palette="dusk"] {
  --bg: #121019;
  --panel: #18151f;
  --fg: #ece8f4;
  --dim: #8c86a0;
  --faint: #322d40;
  --line: #24202e;
  --accent: #c3a6ff;
  --key: #8fc8ff;
  --warn: #f1d38a;
  --err: #ff8597;
  --sel: rgba(195, 166, 255, 0.06);
  color-scheme: dark;
}
[data-palette="paper"] {
  --bg: #f6f5f1;
  --panel: #fdfcfa;
  --fg: #1f2120;
  --dim: #7c7e79;
  --faint: #deddd5;
  --line: #e6e4dd;
  --accent: #2f7d55;
  --key: #1f5f9e;
  --warn: #a8710a;
  --err: #b8382e;
  --sel: rgba(31, 33, 32, 0.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { overflow-x: clip; scrollbar-gutter: stable; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 13px/1.6 "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
::selection { background: var(--faint); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
:focus-visible { outline: 1px dashed var(--accent); outline-offset: 2px; }
.dim { color: var(--dim); }
.ok { color: var(--accent); }
.warn { color: var(--warn); }
.err { color: var(--err); }
.hi, .b { color: var(--fg); font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
.cursor { animation: blink 1.06s steps(1) infinite; color: var(--fg); }
@keyframes blink { 50% { opacity: 0; } }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.link:hover { text-decoration-color: var(--accent); }

:root { --maxw: 1200px; }

:root { --band: var(--maxw); }
html.view-top { --band: min(var(--maxw), calc(var(--col) + 48px)); }
.app { max-width: var(--band); margin: 0 auto; padding: 18px 24px 0; }

.scan {
  pointer-events: none; position: fixed; inset: 0; z-index: 50; display: none;
  background:
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.10) 2px 3px),
    radial-gradient(ellipse at center, transparent 62%, rgba(0,0,0,.28) 100%);
}
html.scan-on .scan { display: block; }
[data-palette="paper"] .scan { display: none !important; }

.term { white-space: pre; overflow-x: auto; scrollbar-width: thin; line-height: 1.45; }
.ln { min-height: 1.45em; }

.tmux {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 0; flex-wrap: wrap;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg));
  color: var(--fg);
  padding: 0 24px;
  min-height: 26px; line-height: 26px; white-space: nowrap;
}
.tmux .sess { background: var(--accent); color: var(--bg); padding: 0 10px; font-weight: 500; margin-right: 10px; }
.tmux .wins { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 0 1 auto; }
.tmux .wins::-webkit-scrollbar { display: none; }
.tmux .win { padding: 0 8px; color: var(--dim); }
.tmux .win:hover { color: var(--fg); }
.tmux .win.on { color: var(--fg); background: color-mix(in srgb, var(--accent) 30%, var(--bg)); }
.tmux .grow { display: none; }

.tmux .tin { display: flex; align-items: center; min-width: 0; max-width: 100%; margin: 0 auto; }
.tmux .tin > .err { order: 2; }
.tmux .err { padding: 0 10px; }

.tmux .seg { display: flex; align-items: center; gap: 12px; color: var(--dim); margin-left: 32px; }
.tmux .views { gap: 2px; }
.tmux .views button { padding: 0 6px; color: var(--dim); }
.tmux .views button:hover { color: var(--fg); }
.tmux .views button[aria-pressed="true"] { color: var(--bg); background: var(--dim); }
.tmux .adm:hover { color: var(--fg); }
.tmux .up { color: var(--fg); }
.tmux .clk { background: color-mix(in srgb, var(--accent) 30%, var(--bg)); color: var(--fg); padding: 0 10px; }
.theme { position: relative; }
.tbtn { color: var(--dim); }
.tbtn:hover, .tbtn[aria-expanded="true"] { color: var(--fg); }
.menu {
  position: absolute; right: 0; top: 100%; z-index: 60; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--faint); padding: 4px 0; min-width: 15ch;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .5);
}
.menu button { padding: 0 12px; color: var(--dim); white-space: pre; line-height: 1.9; }
.menu button:hover, .menu button[aria-checked="true"] { color: var(--fg); background: var(--sel); }
.menu .sw { display: inline-block; width: 8px; height: 8px; box-shadow: inset 0 0 0 1px rgba(127,127,127,.5); }

.ps { margin-top: 14px; white-space: pre-wrap; word-break: break-word; }
.home > .ps:first-child, .screen > .term:first-child { margin-top: 0; }
.ps .u { color: var(--accent); font-weight: 500; }
.ps .sym { color: var(--dim); }
.ps .path { color: var(--fg); font-weight: 500; }
.ps .cmd { color: var(--fg); }
.ps .arg { color: var(--dim); }
.notice {
  margin: 4px 0 6px; padding: 0 0 0 12px; border-left: 2px solid var(--warn);
  white-space: pre-wrap; word-break: break-word;
}
.notice::before { content: "wall: "; color: var(--warn); }

.view { margin-top: 4px; }
.panes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 26px 24px; padding-top: 12px; }
.pane {
  position: relative; border: 1px solid var(--faint); padding: 14px 16px 10px;
  cursor: pointer; min-width: 0; transition: border-color .15s;
}
.pane:hover { border-color: var(--dim); }
.pane.off { opacity: .6; }
.pane .head {
  position: absolute; top: -0.8em; left: 10px; right: 10px;
  display: flex; align-items: center; gap: 0; line-height: 1.6; pointer-events: none;
}
.pane .head > * { background: var(--bg); padding: 0 6px; }
.pane .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pane .tag { color: var(--dim); padding-left: 0; flex: none; }
.pane .head .grow { flex: 1; background: none; padding: 0; }
.pane .st { flex: none; }

.pane .body { overflow: hidden; white-space: pre; line-height: 1.45; }
.pane .body .err { white-space: pre-wrap; }
.mk, .tk { color: var(--key); font-weight: 500; }
.br { color: var(--dim); }
.bar.ok { color: var(--accent); }
.bar.warn { color: var(--warn); }
.bar.err { color: var(--err); }
.mv { color: var(--dim); }

.table { padding-top: 4px; }
.tbl { display: inline-block; min-width: 0; }
.thead { background: color-mix(in srgb, var(--fg) 82%, var(--bg)); color: var(--bg); padding: 1px 1ch 1px 0; line-height: 1.7; }
.thead button:hover, .thead button.on { text-decoration: underline; text-underline-offset: 3px; }

.thead .rz { cursor: col-resize; position: relative; touch-action: none; }
.thead .rz::after {
  content: ""; position: absolute; top: 2px; bottom: 2px; left: calc(50% - 1px); width: 2px;
  background: var(--bg); opacity: 0; transition: opacity .12s;
}
.thead:hover .rz::after { opacity: .25; }
.thead .rz:hover::after, html.resizing .rz::after { opacity: .7; }
html.resizing, html.resizing * { cursor: col-resize !important; user-select: none; }
.trow { cursor: pointer; line-height: 1.95; }
.trow:hover { background: var(--sel); }
.trow.off { opacity: .6; }

.detail .term { margin-top: 2px; }
.detail .blk { padding-bottom: 2px; }
.flag { color: var(--dim); }
.flag:hover { color: var(--fg); }
.flag.on { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 22px 16px; margin-top: 16px; }
.chart { position: relative; border: 1px solid var(--faint); padding: 16px 14px 8px; min-width: 0; }
.chart > .head { position: absolute; top: -0.8em; left: 10px; right: 10px; display: flex; gap: 0; line-height: 1.6; }
.chart > .head > * { background: var(--bg); padding: 0 6px; }
.chart .t { font-weight: 500; }
.chart .legend { display: flex; gap: 10px; color: var(--dim); }
.chart .legend i { display: inline-block; width: 8px; height: 1.5px; vertical-align: 4px; margin-right: 5px; }
.chart > .head .grow { flex: 1; background: none; padding: 0; }
.chart .peak { color: var(--dim); }
.chart svg { display: block; width: 100%; height: 120px; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 2 4; }
.chart .axis { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; margin-top: 4px; }
.chart .tip {
  position: absolute; pointer-events: none; z-index: 5; top: 22px;
  background: var(--bg); border: 1px solid var(--faint); padding: 4px 10px; white-space: pre; font-size: 12px;
}
.chart .msg { color: var(--dim); padding: 44px 0; text-align: center; }

.out { margin-top: 18px; }
.out .hint { margin-top: 4px; }
.cli {
  position: sticky; bottom: 0; z-index: 40;
  display: flex; gap: 10px; align-items: center;
  margin: 18px calc(50% - 50vw) 0; padding: 10px max(24px, calc(50vw - var(--band) / 2 + 24px)) 14px;
  background: var(--bg);
  font-size: 1.05em;
}

.cli::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 22px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.cli .ps1 { color: var(--accent); white-space: nowrap; flex: none; font-weight: 500; }
.cli .field { flex: 1; min-width: 0; position: relative; display: flex; }
.cli input {
  flex: 1; min-width: 0; font: inherit; color: var(--fg); background: transparent;
  border: 0; outline: 0; caret-color: var(--accent); padding: 4px 0;
}
.cli input::placeholder { color: var(--dim); opacity: 1; }

.cli .field:has(input:placeholder-shown:not(:focus))::before {
  content: "█"; color: var(--accent); position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  animation: blink 1.06s steps(1) infinite; pointer-events: none;
}
.cli .field:has(input:placeholder-shown:not(:focus)) input { text-indent: 1.4ch; }

@media (max-width: 760px) {
  body { font-size: 12px; }
  .app { padding: 12px 12px 0; }
  .tmux { padding: 0 0 0 0; flex-wrap: nowrap; }
  .tmux .sess { margin-right: 4px; padding: 0 8px; }
  .tmux .wins { flex: 1 1 auto; }
  .tmux .clk, .tmux .right, .tmux .tin > .err { display: none; }
  .tmux .tin { margin: 0; width: 100%; }
  .tmux .seg { gap: 6px; margin-left: 8px; flex: none; }
  .tmux .stat { padding-right: 8px; }
  .panes, .charts { grid-template-columns: 1fr; }
  .cli { margin-left: -12px; margin-right: -12px; padding: 10px 12px; font-size: 13px; }
  .cli .ps1 { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
  .detail .term { white-space: pre-wrap; }
}
@media (min-width: 1200px) {
  body { font-size: 14px; }
}
@media (min-width: 1200px) {
  .tmux { min-height: 28px; line-height: 28px; }

  .detail .info { column-count: 2; column-gap: 72px; }
  .detail .blk { break-inside: avoid; }

  .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail .info > .blk:first-child > .ps { margin-top: 0; }
}
@media (min-width: 1700px) {
  :root { --maxw: 1480px; }
}
@media (min-width: 2300px) {
  :root { --maxw: 1680px; }
  body { font-size: 15px; }
}
html.anim .cli { transition: padding .3s cubic-bezier(.2, .7, .2, 1); }

html.resizing .table { overflow: visible; }
@media (prefers-reduced-motion: reduce) {
  .cursor, .cli .field::before { animation: none !important; }
  html.anim .cli { transition: none; }
}
