:root {
  color-scheme: dark;
  --text: #b9d1a2;
  --muted: #7d9670;
  --accent: #74f885;
  --line: #1b2a1f;
  --warn: #ffd166;
  --link: #9ac8ff;
  --error: #ff8f8f;
  --app-height: 100vh;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: var(--app-height);
  height: auto;
}

body {
  margin: 0;
  min-height: var(--app-height);
  background: #000;
  color: var(--text);
  font-family: "JetBrains Mono", "Fira Code", "Source Code Pro", "Noto Sans JP", monospace;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

body::before {
  content: none;
}

body::after {
  content: none;
}

.terminal-screen {
  width: min(1120px, calc(100% - 24px));
  min-height: calc(var(--app-height) - 24px);
  margin: 12px auto;
  padding: 10px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  border: 0;
  background: #000;
  display: block;
}

.terminal-log {
  overflow: visible;
  padding-right: 0;
}

.terminal-screen.terminal-cleared .terminal-log {
  min-height: 0;
}

.terminal-log::-webkit-scrollbar {
  width: 8px;
}

.terminal-log::-webkit-scrollbar-thumb {
  background: #1a2a1f;
}

.entry {
  margin: 0 0 4px;
  width: 100%;
}

.line {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
}

.prompt {
  color: var(--accent);
  font-weight: 700;
}

.command {
  color: var(--warn);
}

.output {
  margin: 2px 0 0;
  color: var(--text);
  width: 100%;
}

.output-pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.24;
}

.summary-linked-output {
  white-space: pre;
  overflow-x: auto;
  word-break: normal;
}

.sl-live-output {
  white-space: pre;
  overflow-x: hidden;
  word-break: normal;
}

.summary-linked-output a {
  white-space: pre;
}

.error {
  color: var(--error);
}

.terminal-form {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
  position: relative;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.terminal-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  letter-spacing: inherit;
  caret-color: var(--accent);
}

.terminal-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 20;
  margin: 0;
  padding: 4px 0;
  white-space: pre-wrap;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  border-top: 1px solid #1a2a1f;
  background: #000;
  color: var(--muted);
  line-height: 1.24;
  pointer-events: none;
}

.terminal-suggestions.is-above {
  top: auto;
  bottom: calc(100% + 2px);
  border-top: 0;
  border-bottom: 1px solid #1a2a1f;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

a:hover {
  color: #b4d2ff;
}

@media (max-width: 860px) {
  .terminal-screen {
    width: calc(100% - 16px);
    margin: 8px auto;
    min-height: calc(var(--app-height) - 16px);
  }

  .output {
    margin-left: 0;
  }
}
