:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --terminal: #050505;
  --chrome: #202020;
  --chrome-2: #151515;
  --line: #3a3a3a;
  --line-soft: #242424;
  --text: #d6d6d6;
  --muted: #8d8d8d;
  --green: #8cff9a;
  --green-soft: #b8ffc1;
  --blue: #8ec8ff;
  --logo: #df7857;
  --logo-dark: #0f0f0f;
  --amber: #f6d76b;
  --red: #ff5f56;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: var(--bg);
}

.no-detect [x-apple-data-detectors],
.no-detect a[x-apple-data-detectors],
.no-detect-part[x-apple-data-detectors],
.no-detect-part a[x-apple-data-detectors] {
  color: inherit !important;
  font: inherit !important;
  text-decoration: none !important;
}

.no-detect,
.no-detect-part {
  -webkit-user-select: text;
  text-decoration: none;
}

.synthetic-at::before {
  content: "@";
}

.synthetic-dot::before {
  content: ".";
}

body::before,
body::after {
  display: none;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1080px, calc(100% - 24px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0;
  display: grid;
  align-items: center;
}

.terminal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: min(800px, calc(100vh - 36px));
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--terminal);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.65);
}

.titlebar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid #111;
  background: linear-gradient(180deg, #2a2a2a, #1c1c1c);
}

.lights {
  display: flex;
  gap: 8px;
}

.lights span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.34);
}

.lights span:first-child {
  background: var(--red);
}

.lights span:nth-child(2) {
  background: var(--amber);
}

.title,
.state,
.statusbar,
.suggestions button,
.prompt-line label {
  color: var(--muted);
}

.title {
  color: #bcbcbc;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.86rem;
}

.state {
  color: #bcbcbc;
  font-size: 0.78rem;
}

.screen {
  overflow: auto;
  padding: 8px clamp(16px, 2.5vw, 28px) clamp(16px, 2.5vw, 28px);
  outline: none;
  background: var(--terminal);
  scrollbar-color: #555 #111;
}

.line {
  min-height: 1.45em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.42;
  font-size: clamp(0.92rem, 1.2vw, 1rem);
}

.line.prompt {
  margin-top: 10px;
  color: var(--green);
}

.line.info {
  color: var(--green);
}

.line.section {
  display: flex;
  gap: 0.55em;
  align-items: center;
  color: var(--green);
}

.section-dot {
  width: 0.48em;
  height: 0.48em;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.line.tree-item {
  display: grid;
  grid-template-columns: 1.45em minmax(0, max-content);
  column-gap: 0.55em;
  align-items: start;
  padding-left: 1.45em;
}

.tree-branch {
  width: 0.62em;
  height: 0.86em;
  border-bottom: 2px solid var(--text);
  border-left: 2px solid var(--text);
  transform: translateY(0.1em);
}

.line.success {
  color: var(--green-soft);
}

.line.error {
  color: #ff8b85;
}

.line.brand {
  position: relative;
  z-index: 0;
  min-height: 0;
  margin: 2px 0 4px;
}

.logo-word {
  display: block;
  overflow-x: auto;
  margin: 0;
  width: max-content;
  color: var(--logo);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: clamp(0.48rem, 1.16vw, 1rem);
  font-weight: 700;
  line-height: 1.05;
  white-space: pre;
  text-shadow: 1px 1px 0 var(--logo-dark);
}

.line.brand + .line.prompt {
  margin-top: 2px;
}

.terminal-cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--green);
  animation: cursor-blink 1s steps(2, start) infinite;
}

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

.statusbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
  min-height: 28px;
  padding: 0 14px;
  border-top: 1px solid #111;
  color: #dcdcdc;
  background: var(--chrome);
  font-size: 0.8rem;
}

.statusbar span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 14px, 680px);
    min-height: 100dvh;
    height: 100dvh;
    padding: 7px 0;
    align-items: stretch;
  }

  .terminal {
    min-height: 0;
    height: calc(100dvh - 14px);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .titlebar {
    grid-template-columns: auto 1fr;
  }

  .state {
    display: none;
  }

  .screen {
    padding: 10px 12px 18px;
  }

  .statusbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
