:root {
  /* Solarized — https://ethanschoonover.com/solarized/ */
  --base03:  #002b36;
  --base02:  #073642;
  --base01:  #586e75;
  --base00:  #657b83;
  --base0:   #839496;
  --base1:   #93a1a1;
  --base2:   #eee8d5;
  --base3:   #fdf6e3;
  --yellow:  #b58900;
  --orange:  #cb4b16;
  --red:     #dc322f;
  --magenta: #d33682;
  --violet:  #6c71c4;
  --blue:    #268bd2;
  --cyan:    #2aa198;
  --green:   #859900;

  /* Solarized Dark — default */
  --bg: var(--base03);
  --fg: var(--base0);
  --emph: var(--base1);
  --dim: var(--base01);
  --highlight: var(--base02);
  --accent: var(--green);
}

/* Solarized Light: explicit opt-in via ?theme=light */
html.theme-light {
  --bg: var(--base3);
  --fg: var(--base00);
  --emph: var(--base01);
  --dim: var(--base1);
  --highlight: var(--base2);
}

/* ?theme=auto follows system. Dark already matches :root defaults; only
   override when the user prefers light. */
@media (prefers-color-scheme: light) {
  html.theme-auto {
    --bg: var(--base3);
    --fg: var(--base00);
    --emph: var(--base01);
    --dim: var(--base1);
    --highlight: var(--base2);
  }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.35;
}

#terminal {
  width: 100%;
  padding: 1.25rem 1.5rem 4rem;
  box-sizing: border-box;
  word-break: break-word;
}

body.noninteractive #prompt-line { display: none !important; }

@media (max-width: 600px) {
  #terminal { padding: 0.9rem 0.9rem 2rem; }
}

#output { white-space: pre-wrap; }
.prompt-line { white-space: normal; }

.prompt-line {
  word-break: break-word;
}
.prompt-line[hidden] { display: none; }

.ps1 { color: var(--green); white-space: nowrap; }
.ps1-user { color: var(--green); }
.ps1-host { color: var(--green); }
.ps1-path { color: var(--blue); }

.input {
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  caret-color: var(--fg);
}

.cursor {
  display: inline-block;
  width: 1ch;
  color: var(--fg);
  animation: blink 1s step-end infinite;
  vertical-align: baseline;
}
@keyframes blink { 50% { opacity: 0; } }

.dim { color: var(--dim); }
.err { color: var(--red); }
.cyan { color: var(--cyan); }
.green { color: var(--green); }
.yellow { color: var(--yellow); }
.magenta { color: var(--magenta); }
.blue { color: var(--blue); }
.bold { font-weight: 700; }
.italic { font-style: italic; }
.underline { text-decoration: underline; }

a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.line { display: block; }

.less-status {
  display: inline-block;
  background: var(--emph);
  color: var(--bg);
  padding: 0 0.5ch;
}

.tap-hint { transition: opacity 250ms; }
.tap-hint.fading { opacity: 0; }

.pager {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.pager-view {
  flex: 1;
  overflow: auto;
  padding: 1.25rem 1.5rem 0.25rem;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: none;
}
.pager-view::-webkit-scrollbar { display: none; }
.pager-status-line {
  padding: 0.25rem 1.5rem 1rem;
}
