/* The terminal dialog (docs/26 section 1, term-dialog) and the rules xterm needs. Linked by index.html (a small file; xterm's code loads late).
   The .xterm rules below are the ones of css/xterm.css of @xterm/xterm 5.5.0 (MIT, Copyright (c) 2014 The xterm.js authors, see
   vendor/xterm/LICENSE), written with logical properties: the terminal box is LTR, so inline-start is the left. */
dialog.term-dialog { inline-size: min(1100px, calc(100vw - 32px)); block-size: min(760px, calc(100vh - 32px)); max-inline-size: none; max-block-size: none; padding: 0; display: none; flex-direction: column; overflow: hidden; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
dialog.term-dialog[open] { display: flex; }
dialog.term-dialog::backdrop { background: var(--scrim); }
.term-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 16px; border-block-end: 1px solid var(--line); }
.term-head h2 { font-size: 15px; font-weight: 600; min-inline-size: 0; overflow-wrap: anywhere; }
.term-status { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.term-status .ico { inline-size: 14px; block-size: 14px; color: var(--tone); stroke-width: 2.2; }
.term-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
/* the keys a phone's keyboard lacks: only below 720 px */
.term-keys { display: none; inline-size: 100%; gap: 6px; direction: ltr; } /* keyboard order: Esc first, on the left */
.term-keys .btn { flex: 1 1 0; min-inline-size: 0; padding-inline: 4px; font-family: var(--mono); }
.term-msg { padding: 8px 16px; font-size: 13.5px; border-block-end: 1px solid var(--line); background: var(--surface-2); }
.term-code { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 16px; border-block-end: 1px solid var(--line); }
.term-code .field { flex: 0 1 220px; }
/* the terminal itself is always dark: the shell's colours are made for a dark screen */
.term-host { position: relative; flex: 1; min-block-size: 0; padding-block: 8px 4px; padding-inline: 10px 4px; background: #121211; direction: ltr; }
.term-host > .xterm { block-size: 100%; }

.xterm { cursor: text; position: relative; user-select: none; -webkit-user-select: none; }
.xterm.focus, .xterm:focus { outline: none; }
.xterm .xterm-helpers { position: absolute; inset-block-start: 0; z-index: 5; }
.xterm .xterm-helper-textarea { padding: 0; border: 0; margin: 0; position: absolute; opacity: 0; inset-inline-start: -9999em; inset-block-start: 0; inline-size: 0; block-size: 0; z-index: -5; white-space: nowrap; overflow: hidden; resize: none; }
.xterm .composition-view { background: #000000; color: #ffffff; display: none; position: absolute; white-space: nowrap; z-index: 1; }
.xterm .composition-view.active { display: block; }
.xterm .xterm-viewport { background-color: #121211; overflow-y: scroll; cursor: default; position: absolute; inset: 0; }
.xterm .xterm-screen { position: relative; }
.xterm .xterm-screen canvas { position: absolute; inset-inline-start: 0; inset-block-start: 0; }
.xterm .xterm-scroll-area { visibility: hidden; }
.xterm-char-measure-element { display: inline-block; visibility: hidden; position: absolute; inset-block-start: 0; inset-inline-start: -9999em; line-height: normal; }
.xterm.enable-mouse-events { cursor: default; }
.xterm.xterm-cursor-pointer, .xterm .xterm-cursor-pointer { cursor: pointer; }
.xterm.column-select.focus { cursor: crosshair; }
.xterm .xterm-accessibility:not(.debug), .xterm .xterm-message { position: absolute; inset: 0; z-index: 10; color: transparent; pointer-events: none; }
.xterm .xterm-accessibility-tree:not(.debug) *::selection { color: transparent; }
.xterm .xterm-accessibility-tree { user-select: text; white-space: pre; }
.xterm .live-region { position: absolute; inset-inline-start: -9999px; inline-size: 1px; block-size: 1px; overflow: hidden; }
.xterm-dim { opacity: 1 !important; }
.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }
.xterm-overline { text-decoration: overline; }
.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
.xterm-strikethrough { text-decoration: line-through; }
.xterm-screen .xterm-decoration-container .xterm-decoration { z-index: 6; position: absolute; }
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer { z-index: 7; }
.xterm-decoration-overview-ruler { z-index: 8; position: absolute; inset-block-start: 0; inset-inline-end: 0; pointer-events: none; }
.xterm-decoration-top { z-index: 2; position: relative; }

@media (max-width: 719px) {
  dialog.term-dialog { inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; border-radius: 0; border: 0; margin: 0; inset: 0; }
  .term-btns { inline-size: 100%; margin-inline-start: 0; }
  .term-btns .btn { flex: 1; }
  .term-keys { display: flex; }
  .term-code .field { flex-basis: 100%; }
  .term-code .btn { flex: 1; }
}
