/* The terminal (assets/shell.js) — lives in the desktop's terminal windows */
.sh { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.sh-out {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 6px;
  scrollbar-color: var(--border) transparent;
}
/* anchored to the bottom like a real terminal */
.sh-head { margin-top: auto; }
.sh-entries { display: flex; flex-direction: column; }
.sh .entry { padding: 2px 0; min-width: 0; }
.sh .entry + .echo, .sh-head + .sh-entries > .echo:first-child { margin-top: 10px; }
.sh .entry pre, .sh .entry p { margin: 0; font: inherit; white-space: pre-wrap; }

.sh .wordmark {
  font: 44px/0.8 var(--display);
  letter-spacing: -0.075em;
  margin: 4px 0 12px;
  white-space: pre;
}
.sh .wordmark .slash { color: var(--shell); }
.sh .boot { color: var(--muted); white-space: pre-wrap; margin: 0; }
.sh .boot .ok, .sh .boot b { color: var(--pale-ink); font-weight: 400; }

.sh .echo .p, .sh-line .prompt { color: var(--muted); }
.sh .s { color: var(--shell); }
.sh .u, .sh-line .who { color: var(--green); }
.sh .ctl { color: var(--muted); }
.sh .err { color: var(--accent-text); }
.sh .help { color: var(--muted); white-space: pre; overflow-x: auto; }
.sh .help b { color: var(--text); font-weight: 400; }

/* input line */
.sh-line { display: flex; align-items: baseline; margin: 6px 0 4px; }
.sh-line .prompt { white-space: nowrap; margin-right: 1ch; }
.sh-field { position: relative; flex: 1; min-width: 4ch; display: flex; }
.sh-line input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text);
  caret-color: transparent;   /* drawn by .sh-cursor */
  font: inherit;
}
/* a thick red text cursor */
.sh-cursor {
  position: absolute; left: 0; top: 50%;
  width: 3px; height: 1.3em; margin-top: -.65em;
  background: var(--shell);
  pointer-events: none;
}
.sh-cursor.blink { animation: sh-blink 1.1s steps(1) .5s infinite; }
@keyframes sh-blink { 50% { opacity: 0; } }
.sh-field:not(:focus-within) .sh-cursor { animation: none; opacity: .35; }
.sh-line input:focus-visible { outline: none; }
.sh-line input::placeholder { color: var(--muted); opacity: .7; }

/* ls */
.sh .ls { display: grid; gap: 2px; }
.sh .ls-menu { display: flex; flex-wrap: wrap; gap: 0 2ch; padding-left: 26px; margin-bottom: 6px; }
.sh .ls-menu button { background: none; border: 0; padding: 0; cursor: pointer; }
.sh .ls-menu .x { color: var(--gold); }
.sh .ls-menu button:hover .x { color: var(--accent-text); }
.sh .row {
  display: grid;
  grid-template-columns: 26px 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 14px;
  width: 100%;
  min-height: 54px;
  padding: 3px 8px 3px 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.sh .row:hover { background: color-mix(in srgb, var(--raised) 60%, transparent); }
.sh .row .cur {
  justify-self: center; width: 9px; height: 12px; visibility: hidden;
  background: var(--gold); clip-path: polygon(0 0, 100% 50%, 0 100%);   /* a yellow ▶ */
}
.sh .ls.live .row.at .cur { visibility: visible; }
.sh .ls.live .row.at { background: var(--raised); }
.sh .row .thumb {
  width: 64px; height: 48px;
  border: 1px solid var(--border);
  object-fit: cover; display: block;
}
.sh .row .doc {
  width: 64px; height: 48px; border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--muted); font-size: 11px;
}
.sh .row .name { color: var(--accent-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh .row.opened .name, .sh .row.readme .name { color: var(--pale-ink); }
.sh .row .num { display: inline-block; width: 3ch; color: inherit; }
.sh .row .meta { color: var(--muted); white-space: nowrap; }
.sh .ls .hint { color: var(--muted); padding-left: 26px; margin-top: 4px; }

/* lobsters whispering (konami) */
.sh .whisper { display: flex; align-items: flex-end; gap: 14px; }
.sh .whisper .pair { display: flex; }
.sh .whisper img { width: 40px; height: auto; }
.sh .whisper img + img { transform: scaleX(-1); margin-left: -6px; }

@container (max-width: 560px) {
  .sh .row { grid-template-columns: 22px 64px minmax(0, 1fr); }
  .sh .row .meta { grid-column: 3; }
  .sh .wordmark { font-size: 40px; }
}
@media (max-width: 640px) {
  .sh-out { padding: 12px 12px 8px; }
  .sh .row { grid-template-columns: 22px 64px minmax(0, 1fr); }
  .sh .row .meta { grid-column: 3; }
  .sh-line input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sh-cursor.blink { animation: none; } }
