* {
  box-sizing: border-box;
}

:root {
  --bg: #0a0f14;
  --panel: rgba(12, 18, 24, 0.92);
  --bar: #111922;
  --border: rgba(126, 231, 135, 0.16);
  --text: #d6e7d9;
  --muted: #7f9185;
  --accent: #7ee787;
  --accent-2: #55c2ff;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(85, 194, 255, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(126, 231, 135, 0.08), transparent 30%),
    linear-gradient(180deg, #071018 0%, #03070c 100%);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
}

body {
  min-height: 100vh;
  padding: 24px;
}

.page-shell {
  max-width: 1100px;
  margin: 0 auto;
}

.terminal-window {
  min-height: calc(100vh - 48px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.terminal-bar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(18, 28, 38, 0.96), rgba(12, 18, 24, 0.96));
  border-bottom: 1px solid rgba(126, 231, 135, 0.12);
}

.window-controls {
  display: flex;
  gap: 10px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.title {
  font-size: 13px;
  color: var(--muted);
}

.terminal {
  height: calc(100vh - 48px - 54px - 72px);
  min-height: 520px;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
}

.line,
.output-line {
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-block + .output-block,
.command-block + .output-block,
.output-block + .command-block {
  margin-top: 6px;
}

.command-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  line-height: 1.7;
  flex-wrap: wrap;
}

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

.path {
  color: var(--accent-2);
}

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

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

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 6px 0 10px;
}

.file {
  color: var(--text);
}

.dir {
  color: var(--accent-2);
}

.doc {
  color: #ffd580;
}

.linkish {
  color: var(--accent);
}

.file-view {
  margin: 8px 0 12px;
  padding: 14px 16px;
  border-left: 2px solid rgba(126, 231, 135, 0.35);
  background: rgba(126, 231, 135, 0.04);
  border-radius: 8px;
}

.file-view h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--accent);
}

.file-view p,
.file-view li {
  margin: 0 0 8px;
  line-height: 1.7;
}

.file-view ul {
  margin: 0;
  padding-left: 18px;
}

.prompt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 24px 24px;
  border-top: 1px solid rgba(126, 231, 135, 0.08);
  background: rgba(6, 10, 14, 0.45);
}

.prompt-label,
.prompt-dollar {
  color: var(--accent);
  flex: 0 0 auto;
}

.prompt-path {
  color: var(--accent-2);
  flex: 0 0 auto;
}

.command-input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  min-width: 100px;
}

.command-input::placeholder {
  color: #55665a;
}

a {
  color: var(--accent);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(126, 231, 135, 0.18);
  border-radius: 999px;
}

@media (max-width: 700px) {
  body {
    padding: 12px;
  }

  .terminal-window {
    min-height: calc(100vh - 24px);
    border-radius: 14px;
  }

  .terminal {
    padding: 18px;
    height: calc(100vh - 24px - 54px - 78px);
  }

  .prompt-row {
    padding: 14px 18px 18px;
    flex-wrap: wrap;
  }

  .command-input {
    width: 100%;
    flex-basis: 100%;
  }

  .title {
    display: none;
  }
}


.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 10, 0.58);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.preview-overlay.hidden {
  display: none;
}

.preview-window {
  width: min(880px, 100%);
  max-height: min(82vh, 900px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(126, 231, 135, 0.18);
  background: rgba(13, 18, 24, 0.98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.preview-bar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(18, 28, 38, 0.98), rgba(12, 18, 24, 0.98));
  border-bottom: 1px solid rgba(126, 231, 135, 0.12);
}

.preview-title {
  font-size: 13px;
  color: var(--muted);
}

.preview-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  min-height: 300px;
  max-height: calc(82vh - 54px);
  background:
    linear-gradient(180deg, rgba(8, 12, 16, 0.96), rgba(4, 8, 12, 0.98));
}

.preview-image {
  max-width: 100%;
  max-height: calc(82vh - 100px);
  border-radius: 12px;
  border: 1px solid rgba(126, 231, 135, 0.12);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
  object-fit: contain;
}

.close-preview {
  appearance: none;
  border: none;
  cursor: pointer;
}

.markdown-view p,
.markdown-view li {
  margin: 0 0 8px;
  line-height: 1.7;
}

.markdown-view ul {
  margin: 0;
  padding-left: 18px;
}


.input-shell {
  position: relative;
  flex: 1 1 auto;
  min-width: 160px;
}

.ghost-input,
.command-input {
  font: inherit;
  letter-spacing: inherit;
  white-space: pre;
}

.ghost-input {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: rgba(214, 231, 217, 0.28);
  overflow: hidden;
}

.command-input {
  position: relative;
  width: 100%;
  z-index: 1;
}

.autocomplete-match {
  color: transparent;
}


.mobile-boot-hint {
  display: none;
}

.mobile-helper {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid rgba(126, 231, 135, 0.08);
  background: rgba(6, 10, 14, 0.35);
}

.mobile-helper-intro {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mobile-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-chip,
.mobile-context-chip {
  appearance: none;
  border: 1px solid rgba(126, 231, 135, 0.18);
  background: rgba(126, 231, 135, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.mobile-chip:active,
.mobile-context-chip:active {
  transform: translateY(1px);
}

.mobile-context {
  margin-top: 12px;
}

.mobile-context-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

@media (max-width: 700px) {
  .mobile-boot-hint {
    display: block;
  }

  .mobile-helper {
    display: block;
  }

  .prompt-row {
    border-bottom: 1px solid rgba(126, 231, 135, 0.08);
  }

  .terminal {
    height: calc(100vh - 24px - 54px - 170px);
    min-height: 420px;
  }

  .file-list {
    gap: 6px 10px;
  }

  .file {
    font-size: 14px;
  }
}

@media (max-width: 700px) {
  .command-input {
    caret-color: transparent;
  }
}
