:root {
  --bg: #111111;
  --panel: #0b0b0b;
  --panel-alt: #191919;
  --text: #d6d6d6;
  --muted: #929292;
  --accent: #e5e5e5;
  --highlight: #73ff7b;
  --shell-path: #8ab4f8;
  --command: #f1f1f1;
  --border: #373737;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 1.5rem;
  overflow: hidden;
}

.app-shell {
  width: min(100%, 1080px);
  height: min(840px, calc(100svh - 3rem));
  min-height: 70vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
}

.brand {
  color: var(--text);
  font-weight: 500;
}

.shell-user {
  color: var(--highlight);
  font-weight: 600;
}

.shell-path {
  color: var(--shell-path);
}

.shell-symbol {
  color: var(--text);
  font-weight: 600;
}

.status {
  color: var(--muted);
  text-transform: lowercase;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.status::before {
  content: "[";
}

.status::after {
  content: "]";
}

.output {
  container-type: inline-size;
  flex: 1;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

.startup-banner {
  margin: 0 0 1.25rem;
  font-family: inherit;
  font-size: min(12px, 2.5vw);
  font-size: min(12px, 2.5cqi);
  line-height: 1.15;
  white-space: pre;
  overflow-wrap: normal;
  color: var(--accent);
}

.output .line {
  margin: 0.2rem 0;
}

.output .prompt-line {
  color: var(--command);
}

.output .room-title {
  font-weight: 700;
}

.input-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: 0.9rem 1.5rem;
}

.input-form:focus-within {
  border-top-color: var(--muted);
}

.prompt {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

#command-input {
  flex: 1;
  background: transparent;
  color: var(--text);
  border: none;
  outline: none;
  font: inherit;
  min-width: 0;
  caret-color: var(--text);
}

#command-input::placeholder {
  color: var(--muted);
}

::selection {
  color: #ffffff;
  background: #315a86;
}

.output,
body {
  scrollbar-color: var(--muted) var(--panel);
  scrollbar-width: thin;
}

@media (max-width: 640px) {
  body {
    padding: 0;
  }

  .app-shell {
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .status-bar {
    padding: calc(0.6rem + env(safe-area-inset-top)) 0.9rem 0.6rem;
  }

  .input-form .shell-user,
  .input-form .shell-path {
    display: none;
  }

  .output {
    padding: 1rem 0.9rem;
  }

  .input-form {
    padding: 0.85rem 0.9rem calc(0.85rem + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
