/* ClisTa Protocol — terminal kit · interactive CLI shell
   Recreated from ui_kits/terminal (app.jsx + data.jsx). */

html, body { margin: 0; background: var(--ink-50); }

/* App fills the viewport below the 64px shared global header. */
.cli {
  height: calc(100vh - 65px);
  display: flex;
  flex-direction: column;
  background: var(--ink-50);
}

/* ---- Slim status strip (app state below the global header) -- */
.cli__statusbar {
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--border-hair);
}
.cli__thread { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }
.cli__status { display: flex; align-items: center; gap: 10px; }

/* ---- Body split --------------------------------------------- */
.cli__split { flex: 1; display: flex; min-height: 0; }

/* ---- Rail --------------------------------------------------- */
.cli__rail {
  width: 270px;
  flex: none;
  border-right: 1px solid var(--border-hair);
  background: var(--paper);
  padding: 20px 16px;
  overflow-y: auto;
}
.cli__group { margin-bottom: 22px; }
.cli__group > .cl-eyebrow { padding-left: 8px; }
.cli__items { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.cli__cmd {
  text-align: left;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background var(--dur-fast);
}
.cli__cmd:hover { background: var(--ink-50); }
.cli__cmd.is-active { background: var(--ink-100); }
.cli__cmd-name { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-strong); }
.cli__cmd-label { font-size: 12px; color: var(--text-faint); }

/* ---- Terminal pane ------------------------------------------ */
.cli__main { flex: 1; padding: 18px; min-width: 0; }
.cli__window {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--term-bg);
  border: 1px solid var(--border-inverse);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-term);
  overflow: hidden;
}
.cli__wbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-inverse);
}
.cli__wbar-left { display: flex; align-items: center; gap: 8px; }
.cli__lights { display: flex; gap: 6px; }
.cli__lights i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #3a3a42; display: inline-block; }
.cli__wtitle { font-family: var(--font-mono); font-size: 12px; color: var(--term-dim); margin-left: 6px; }
.cli__clear {
  background: transparent;
  border: 1px solid #3a3a42;
  color: var(--term-dim);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 10px;
  cursor: pointer;
}
.cli__clear:hover { color: var(--term-fg); border-color: #4a4a52; }
.cli__feed {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--term-fg);
}

/* output rows */
.cli__feed .t-line { display: flex; gap: 8px; white-space: pre-wrap; word-break: break-word; }
.cli__spacer { height: 12px; }

/* kv block */
.cli__kv {
  margin: 8px 0 8px 18px;
  display: grid;
  grid-template-columns: minmax(0,210px) 1fr;
  row-gap: 3px;
  column-gap: 18px;
}
.cli__kv .k { color: var(--term-dim); }

/* tree block */
.cli__tree { margin: 8px 0 8px 18px; }
.cli__tree .row { display: flex; gap: 12px; white-space: pre; }
.cli__tree .a { color: var(--term-fg); min-width: 168px; }
.cli__tree .b { color: var(--term-dim); min-width: 96px; }
.cli__tree .c { color: var(--term-dim); }
.cli__tree .c.survived { color: var(--term-red); }

/* prompt + caret */
.cli__prompt { display: flex; gap: 8px; margin-top: 4px; }
.cli__prompt .sigil { color: var(--term-dim); }
.cli__caret {
  width: 8px; height: 17px;
  background: var(--term-green);
  display: inline-block;
  animation: cl-blink 1.1s steps(1) infinite;
}
@keyframes cl-blink { 50% { opacity: 0; } }

@media (max-width: 720px) {
  .cli__rail { width: 200px; }
}
