:root {
  --bg: #12151c;
  --panel: #1a1f2a;
  --border: #2a3344;
  --text: #d7deea;
  --muted: #8b97ab;
  --keyword: #7ec8ff;
  --string: #98d8a0;
  --comment: #6b778a;
  --fn: #e8b86d;
  --num: #d4a5ff;
  --cursor: #f0c674;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse at top, #1c2433 0%, #0e1117 55%),
    #0e1117;
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.shell {
  width: min(920px, 94vw);
  margin: 4vh auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: #151a24;
}

.dots {
  display: flex;
  gap: 0.35rem;
}

.dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a4558;
}

.dots span:nth-child(1) { background: #ff6b6b; }
.dots span:nth-child(2) { background: #ffd166; }
.dots span:nth-child(3) { background: #6bcb77; }

.path {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-family: Syne, sans-serif;
  letter-spacing: 0.02em;
}

.chip {
  border: 1px solid var(--border);
  background: #10141c;
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
}

.chip:hover {
  border-color: #4a5870;
}

.editor {
  display: grid;
  grid-template-columns: auto 1fr;
  min-height: 62vh;
  max-height: 72vh;
  overflow: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: #3a4558 transparent;
}

.gutter {
  margin: 0;
  padding: 0 0.9rem 0 1rem;
  list-style: none;
  text-align: right;
  color: #4f5d73;
  font-size: 0.9rem;
  line-height: 1.55;
  user-select: none;
}

.code {
  margin: 0;
  padding: 0 1.1rem 0 0.4rem;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.tok-kw { color: var(--keyword); }
.tok-str { color: var(--string); }
.tok-cm { color: var(--comment); font-style: italic; }
.tok-fn { color: var(--fn); }
.tok-num { color: var(--num); }

.cursor {
  display: inline-block;
  color: var(--cursor);
  animation: blink 1s steps(1) infinite;
  margin-left: 1px;
}

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

.status {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.9rem;
  border-top: 1px solid var(--border);
  background: #151a24;
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 640px) {
  .shell {
    margin: 2vh auto;
    border-radius: 10px;
  }

  .editor {
    min-height: 70vh;
  }

  .code,
  .gutter {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }
}
