/* Colors follow <html data-theme>, set by terminal/theme.js. Before the
   script runs, the media query picks the right one for the first paint. */
:root {
  --console-bg: #0c0c0c;
  --console-fg: #d0d0d0;
  --tip-bg: #1c2026;
  --tip-fg: #e4e4e4;
  --tip-border: #3c424b;
  --tip-muted: #a3a3a3;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --console-bg: #f7f7f5;
    --console-fg: #1f1f1f;
    --tip-bg: #ffffff;
    --tip-fg: #1f1f1f;
    --tip-border: #c9c9c3;
    --tip-muted: #5c5c5c;
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --console-bg: #f7f7f5;
  --console-fg: #1f1f1f;
  --tip-bg: #ffffff;
  --tip-fg: #1f1f1f;
  --tip-border: #c9c9c3;
  --tip-muted: #5c5c5c;
  color-scheme: light;
}

/* A full-window terminal: xterm scrolls its own output, the page never does. */
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--console-bg);
  color: var(--console-fg);
}

.console {
  box-sizing: border-box;
  height: 100%;
  padding: 8px;
}

/* No padding or border here: the fit addon reads this element's computed
   size as the space available to the terminal. */
#terminal {
  height: 100%;
  width: 100%;
}

/* Hover tooltips (terminal/tooltips.js). pointer-events: none, so the
   tooltip never steals the hover from the text under it. */
.tooltip {
  position: fixed;
  z-index: 10;
  max-width: min(30rem, calc(100vw - 16px));
  padding: 6px 10px;
  border: 1px solid var(--tip-border);
  border-radius: 4px;
  background: var(--tip-bg);
  color: var(--tip-fg);
  box-shadow: 0 2px 10px rgb(0 0 0 / 25%);
  font: 13px/1.45 Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.tooltip[hidden] {
  display: none;
}

.tooltip-title {
  font-weight: 600;
  margin-bottom: 2px;
}

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

.load-error {
  font-family: ui-monospace, monospace;
  padding: 16px;
}
