:root {
  color-scheme: dark;
  --bg: #000;
  --fg: #e8e8e8;
  --dim: #9a9a9a;
  --cmd: #d5dbe4;
  --ok: #b7d7a8;
  --err: #e0a090;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.35 "SF Mono", ui-monospace, Menlo, Consolas, "Apple SD Gothic Neo", "Noto Sans KR", monospace;
}

#term {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 8px 10px 0;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

#below,
#field {
  cursor: text;
}

#below {
  flex: 1;
  min-height: 40vh;
  display: block;
}

#field {
  position: relative;
  flex: 1;
  min-width: 12em;
  height: 1.35em;
}

#term ::selection {
  background: #b5d5fe;
  color: #000;
}

#log,
#prompt {
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}

.row {
  margin: 0;
}

.row.dim { color: var(--dim); }
.row.ok { color: var(--ok); }
.row.err { color: var(--err); }

#line {
  display: flex;
  align-items: center;
  min-height: 1.35em;
}

#line.busy {
  display: none;
}

#cmd[data-mask="1"] {
  -webkit-text-security: disc;
  text-security: disc;
}

#cmd {
  display: block;
  width: 100%;
  min-width: 12em;
  height: 1.35em;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  caret-color: transparent;
  font: inherit;
}

#caret {
  display: none;
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 0.58em;
  height: 1.05em;
  background: #e8e8e8;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

#line:focus-within #caret {
  display: block;
  animation: blink 1.05s steps(1) infinite;
}

#field.composing #cmd {
  caret-color: var(--fg);
}

#field.composing #caret {
  display: none;
}

#measure {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  font: inherit;
  pointer-events: none;
}

@keyframes blink {
  50% { opacity: 0; }
}

