:root {
  --bg: #0a0c0a;
  --panel: #0e110e;
  --bar: #161a16;
  --line: #222822;
  --fg: #c8d3c5;
  --dim: #5f6d5c;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #f87171;
  --cyan: #67e8f9;
}

* { box-sizing: border-box; }

html, body { background: var(--bg); }
body {
  margin: 0;
  color: var(--fg);
  font: 14px/1.6 "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  padding: 24px 16px;
}
::selection { background: var(--green); color: var(--bg); }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 6px; }

.term {
  max-width: 860px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--panel);
  box-shadow: 0 0 0 1px #000, 0 20px 60px rgba(0, 0, 0, .6);
}

.titlebar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: var(--bar); border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--dim);
}
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #2c332c; }
.title { flex: 1; text-align: center; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button {
  font: inherit; font-size: 12px; border: 0; padding: 2px 10px; cursor: pointer;
  background: transparent; color: var(--dim);
}
.seg button[aria-checked="true"] { background: var(--green); color: var(--bg); font-weight: 700; }
.lists button[aria-checked="true"] { background: var(--amber); }

.screen { padding: 20px 22px 16px; }

.banner {
  margin: 4px 0 12px; color: var(--fg); font-size: 28px; line-height: 1.2; font-weight: 700;
  letter-spacing: -.02em; text-shadow: 0 0 12px rgba(74, 222, 128, .25);
}

.dim { color: var(--dim); }
.small { font-size: 12px; }
.hl { color: var(--amber); }

section { margin-top: 26px; }
.cmd { color: var(--fg); font-weight: 600; margin-bottom: 10px; }
.ps { color: var(--green); margin-right: 6px; }

.row { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; color: var(--dim); }
.row label { display: flex; align-items: center; gap: 8px; }

input[type="text"] {
  font: inherit; color: var(--amber); background: transparent;
  border: 0; border-bottom: 1px dashed var(--dim); outline: none; padding: 2px 2px; width: 90px;
}
input[type="text"]:focus { border-bottom-color: var(--green); }
input::placeholder { color: #3a443a; }
.inline-input { width: 220px !important; font-weight: 600; }

input[type="range"] { width: 140px; accent-color: var(--green); }

.btn {
  font: inherit; font-weight: 700; color: var(--green); background: transparent;
  border: 1px solid var(--green); border-radius: 3px; padding: 3px 12px; cursor: pointer;
}
.btn:hover { background: var(--green); color: var(--bg); }
.link { font: inherit; font-size: 12px; background: none; border: 0; color: var(--dim); cursor: pointer; text-decoration: underline; padding: 0; }

.names {
  list-style: none; padding: 0; margin: 14px 0 8px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 16px;
}
.names li {
  cursor: pointer; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: type .25s steps(4) both;
}
.names li::before { content: "> "; color: var(--dim); }
.names li:hover { background: var(--line); }
.names li.kept { color: var(--amber); }
.names li.kept::before { content: "* "; color: var(--amber); }
.names .tag { margin-left: 6px; }
@keyframes type { from { opacity: 0; } }

.kept { color: var(--amber); }

.tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 2px;
  color: var(--bg); background: var(--green);
}

.banner .cursor { width: 14px; height: 26px; vertical-align: -4px; margin-left: 4px; }
.cursor {
  display: inline-block; width: 8px; height: 15px; vertical-align: -2px; margin-left: 2px;
  background: var(--green); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

#verdict { margin-top: 6px; padding-left: 14px; border-left: 2px solid var(--line); }
#verdict-text { font-weight: 700; }
.mono-bar { white-space: pre; overflow-x: auto; }
#meter-fill { letter-spacing: -1px; }

.letters { display: flex; flex-wrap: wrap; gap: 2px; margin: 10px 0 6px; }
.letters span {
  padding: 0 6px; border-bottom: 2px solid; font-weight: 700; font-size: 16px;
}
.letters span.end { font-size: 11px; color: var(--dim); font-weight: 400; align-self: flex-end; }

.keys { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.keys button {
  font: inherit; min-width: 28px; padding: 2px 6px; cursor: pointer;
  background: transparent; color: var(--fg); border: 1px solid var(--line); border-radius: 3px;
}
.keys button:hover { border-color: var(--dim); }
.keys button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--bg); font-weight: 700; }

.bars { margin: 4px 0 0; color: var(--fg); font: inherit; white-space: pre; overflow-x: auto; }
.bars .b { color: var(--green); }
.bars .e { color: #263026; }

.how summary { cursor: pointer; font-weight: 600; list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.txt { color: var(--dim); font: inherit; font-size: 13px; white-space: pre-wrap; margin: 10px 0 0; }

.foot { margin-top: 28px; padding-top: 12px; border-top: 1px dashed var(--line); }

@media (max-width: 560px) {
  body { padding: 0; font-size: 13px; }
  .term { border-radius: 0; border: 0; }
  .screen { padding: 16px; }
  .banner { font-size: 22px; }
  .title { display: none; }
  .titlebar { justify-content: space-between; }
  .inline-input { width: 150px !important; }
  .names { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
