/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */

/**
 *  Default styles for xterm.js
 */

.xterm {
    cursor: text;
    position: relative;
    user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

.xterm.focus,
.xterm:focus {
    outline: none;
}

.xterm .xterm-helpers {
    position: absolute;
    top: 0;
    /**
     * The z-index of the helpers must be higher than the canvases in order for
     * IMEs to appear on top.
     */
    z-index: 5;
}

.xterm .xterm-helper-textarea {
    padding: 0;
    border: 0;
    margin: 0;
    /* Move textarea out of the screen to the far left, so that the cursor is not visible */
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    width: 0;
    height: 0;
    z-index: -5;
    /** Prevent wrapping so the IME appears against the textarea at the correct position */
    white-space: nowrap;
    overflow: hidden;
    resize: none;
}

.xterm .composition-view {
    /* TODO: Composition position got messed up somewhere */
    background: #000;
    color: #FFF;
    display: none;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}

.xterm .composition-view.active {
    display: block;
}

.xterm .xterm-viewport {
    /* On OS X this is required in order for the scroll bar to appear fully opaque */
    background-color: #000;
    overflow-y: scroll;
    cursor: default;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
}

.xterm .xterm-screen {
    position: relative;
}

.xterm .xterm-screen canvas {
    position: absolute;
    left: 0;
    top: 0;
}

.xterm-char-measure-element {
    display: inline-block;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: -9999em;
    line-height: normal;
}

.xterm.enable-mouse-events {
    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
    cursor: default;
}

.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
    cursor: pointer;
}

.xterm.column-select.focus {
    /* Column selection mode */
    cursor: crosshair;
}

.xterm .xterm-accessibility:not(.debug),
.xterm .xterm-message {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: transparent;
    pointer-events: none;
}

.xterm .xterm-accessibility-tree:not(.debug) *::selection {
  color: transparent;
}

.xterm .xterm-accessibility-tree {
  font-family: monospace;
  user-select: text;
  white-space: pre;
}

.xterm .xterm-accessibility-tree > div {
  transform-origin: left;
  width: fit-content;
}

.xterm .live-region {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.xterm-dim {
    /* Dim should not apply to background, so the opacity of the foreground color is applied
     * explicitly in the generated class and reset to 1 here */
    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;
    top: 0;
    right: 0;
    pointer-events: none;
}

.xterm-decoration-top {
    z-index: 2;
    position: relative;
}



/* Derived from vs/base/browser/ui/scrollbar/media/scrollbar.css */

/* xterm.js customization: Override xterm's cursor style */
.xterm .xterm-scrollable-element > .scrollbar {
    cursor: default;
}

/* Arrows */
.xterm .xterm-scrollable-element > .scrollbar > .scra {
	cursor: pointer;
	font-size: 11px !important;
}

.xterm .xterm-scrollable-element > .visible {
	opacity: 1;

	/* Background rule added for IE9 - to allow clicks on dom node */
	background:rgba(0,0,0,0);

	transition: opacity 100ms linear;
	/* In front of peek view */
	z-index: 11;
}
.xterm .xterm-scrollable-element > .invisible {
	opacity: 0;
	pointer-events: none;
}
.xterm .xterm-scrollable-element > .invisible.fade {
	transition: opacity 800ms linear;
}

/* Scrollable Content Inset Shadow */
.xterm .xterm-scrollable-element > .shadow {
	position: absolute;
	display: none;
}
.xterm .xterm-scrollable-element > .shadow.top {
	display: block;
	top: 0;
	left: 3px;
	height: 3px;
	width: 100%;
	box-shadow: var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset;
}
.xterm .xterm-scrollable-element > .shadow.left {
	display: block;
	top: 3px;
	left: 0;
	height: 100%;
	width: 3px;
	box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
}
.xterm .xterm-scrollable-element > .shadow.top-left-corner {
	display: block;
	top: 0;
	left: 0;
	height: 3px;
	width: 3px;
}
.xterm .xterm-scrollable-element > .shadow.top.left {
	box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
}

.toast-title {
  font-weight: bold;
}
.toast-message {
  -ms-word-wrap: break-word;
  word-wrap: break-word;
}
.toast-message a,
.toast-message label {
  color: #FFFFFF;
}
.toast-message a:hover {
  color: #CCCCCC;
  text-decoration: none;
}
.toast-close-button {
  position: relative;
  right: -0.3em;
  top: -0.3em;
  float: right;
  font-size: 20px;
  font-weight: bold;
  color: #FFFFFF;
  -webkit-text-shadow: 0 1px 0 #ffffff;
  text-shadow: 0 1px 0 #ffffff;
  opacity: 0.8;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
  filter: alpha(opacity=80);
  line-height: 1;
}
.toast-close-button:hover,
.toast-close-button:focus {
  color: #000000;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.4;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
  filter: alpha(opacity=40);
}
.rtl .toast-close-button {
  left: -0.3em;
  float: left;
  right: 0.3em;
}
/*Additional properties for button version
 iOS requires the button element instead of an anchor tag.
 If you want the anchor version, it requires `href="#"`.*/
button.toast-close-button {
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  -webkit-appearance: none;
}
.toast-top-center {
  top: 0;
  right: 0;
  width: 100%;
}
.toast-bottom-center {
  bottom: 0;
  right: 0;
  width: 100%;
}
.toast-top-full-width {
  top: 0;
  right: 0;
  width: 100%;
}
.toast-bottom-full-width {
  bottom: 0;
  right: 0;
  width: 100%;
}
.toast-top-left {
  top: 12px;
  left: 12px;
}
.toast-top-right {
  top: 12px;
  right: 12px;
}
.toast-bottom-right {
  right: 12px;
  bottom: 12px;
}
.toast-bottom-left {
  bottom: 12px;
  left: 12px;
}
#toast-container {
  position: fixed;
  z-index: 999999;
  pointer-events: none;
  /*overrides*/
}
#toast-container * {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
#toast-container > div {
  position: relative;
  pointer-events: auto;
  overflow: hidden;
  margin: 0 0 6px;
  padding: 15px 15px 15px 50px;
  width: 300px;
  -moz-border-radius: 3px 3px 3px 3px;
  -webkit-border-radius: 3px 3px 3px 3px;
  border-radius: 3px 3px 3px 3px;
  background-position: 15px center;
  background-repeat: no-repeat;
  -moz-box-shadow: 0 0 12px #999999;
  -webkit-box-shadow: 0 0 12px #999999;
  box-shadow: 0 0 12px #999999;
  color: #FFFFFF;
  opacity: 0.8;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
  filter: alpha(opacity=80);
}
#toast-container > div.rtl {
  direction: rtl;
  padding: 15px 50px 15px 15px;
  background-position: right 15px center;
}
#toast-container > div:hover {
  -moz-box-shadow: 0 0 12px #000000;
  -webkit-box-shadow: 0 0 12px #000000;
  box-shadow: 0 0 12px #000000;
  opacity: 1;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
  filter: alpha(opacity=100);
  cursor: pointer;
}
#toast-container > .toast-info {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=") !important;
}
#toast-container > .toast-error {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=") !important;
}
#toast-container > .toast-success {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==") !important;
}
#toast-container > .toast-warning {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=") !important;
}
#toast-container.toast-top-center > div,
#toast-container.toast-bottom-center > div {
  width: 300px;
  margin-left: auto;
  margin-right: auto;
}
#toast-container.toast-top-full-width > div,
#toast-container.toast-bottom-full-width > div {
  width: 96%;
  margin-left: auto;
  margin-right: auto;
}
.toast {
  background-color: #030303;
}
.toast-success {
  background-color: #51A351;
}
.toast-error {
  background-color: #BD362F;
}
.toast-info {
  background-color: #2F96B4;
}
.toast-warning {
  background-color: #F89406;
}
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  background-color: #000000;
  opacity: 0.4;
  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
  filter: alpha(opacity=40);
}
/*Responsive Design*/
@media all and (max-width: 240px) {
  #toast-container > div {
    padding: 8px 8px 8px 50px;
    width: 11em;
  }
  #toast-container > div.rtl {
    padding: 8px 50px 8px 8px;
  }
  #toast-container .toast-close-button {
    right: -0.2em;
    top: -0.2em;
  }
  #toast-container .rtl .toast-close-button {
    left: -0.2em;
    right: 0.2em;
  }
}
@media all and (min-width: 241px) and (max-width: 480px) {
  #toast-container > div {
    padding: 8px 8px 8px 50px;
    width: 18em;
  }
  #toast-container > div.rtl {
    padding: 8px 50px 8px 8px;
  }
  #toast-container .toast-close-button {
    right: -0.2em;
    top: -0.2em;
  }
  #toast-container .rtl .toast-close-button {
    left: -0.2em;
    right: 0.2em;
  }
}
@media all and (min-width: 481px) and (max-width: 768px) {
  #toast-container > div {
    padding: 15px 15px 15px 50px;
    width: 25em;
  }
  #toast-container > div.rtl {
    padding: 15px 50px 15px 15px;
  }
}

/*
 * SPDX-FileCopyrightText: 2024 Volodymyr Shymanskyy
 * SPDX-License-Identifier: MIT
 *
 * The software is provided "as is", without any warranties or guarantees (explicit or implied).
 * This includes no assurances about being fit for any specific purpose.
 */

:root {
    --fg-color: #cccccc;
    --fg-color-highlight: #4fc1ff;
    --accent-color: #007acc;
    --bg-color: #1e1e1e;
    --bg-color-menu: #252526;
    --bg-color-edit: #1e1e1e;
    --font-size: 14px;
    --connected-passive: #4ec9b0;
    --connected-active: #007acc;
    --connected-color: var(--connected-passive);
    --animation: 0.3s ease-in-out;
}

/*
 * Sensible defaults
 */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overscroll-behavior: none;
    box-sizing: border-box;
    background: var(--bg-color);
    color: var(--fg-color);
    font-family: system-ui;
    font-weight: normal;
    font-size: var(--font-size);
    transition: font-size var(--animation),
                background-color var(--animation),
                color var(--animation),
                opacity var(--animation);
}

/* Only the IDE takes over scrolling and gestures wholesale. The standalone
   pages (bridge, benchmark) are ordinary documents and must stay pannable. */
body#app {
    touch-action: none;
}

*, *:before, *:after {
    box-sizing: inherit;
}

*     { margin: 0; }
p, hr { margin: revert; }

@media (prefers-reduced-motion: reduce) {
    :root { --animation: 1ms linear; }
    *, *:before, *:after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
}

/* Firefox has no ::-webkit-scrollbar, so it needs the standard properties to
   get anything close to the flat scrollbars below. This must stay guarded:
   Chromium 121+ supports scrollbar-width/-color and drops every
   ::-webkit-scrollbar rule as soon as either is set to a non-auto value. */
@supports not selector(::-webkit-scrollbar) {
    html {
        scrollbar-width: thin;
        scrollbar-color: hsla(0, 0%, 60%, .8) transparent;
    }
}

::-webkit-scrollbar {
    height: .5rem;
    width:  .5rem;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: hsla(0, 0%, 60%, .8);
}

::-webkit-scrollbar-corner {
    background-color: transparent;
}

/* Nothing here draws a default focus ring (buttons and links are unstyled),
   so keyboard navigation needs an explicit one. */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 1px;
}

a {
    color: unset;
    text-decoration: none;
}

a.link {
    font-weight: 600;
    text-decoration: underline dotted 1px;
    text-underline-offset: 0.2rem;
    -webkit-text-decoration: underline dotted 1px;
}

/* A link that was deliberately not made clickable (a package readme). It still
   reads as a link and names its target on hover, but it goes nowhere. */
.link-dead {
    cursor: default;
}

label {
    user-select: none;
    cursor: pointer;
}

input[type="checkbox" i] {
    /* Sized in em so the checkbox tracks the zoom setting like everything else */
    width: 1em;
    height: 1em;
    margin: 0 3px 0 0;
    vertical-align: -0.1em;
    cursor: pointer;
}

button {
    padding: 5px 5px;
    background: none;
    border: none;
    color: unset;
    cursor: pointer;
    font-size: 1.3rem;
}

button.connected {
    color: var(--connected-color);
}

/* The device dropped and is being waited for. It keeps the colour of a connection
   because the session is not over yet - the board is expected back. */
button.reconnecting {
    color: var(--connected-color);
    animation: reconnecting-pulse 1.2s ease-in-out infinite;
}

@keyframes reconnecting-pulse {
    50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    button.reconnecting {
        animation: none;
        opacity: 0.6;
    }
}

/* Buttons here draw neither background nor border, so being disabled would not
   show at all otherwise */
button:disabled {
    opacity: 0.4;
    cursor: default;
}

/*
 * Inactive panels should feel visually detached from the active UI, while still
 * keeping their content readable.
 *
 * Only opacities change, and both of them are declared on either side of the
 * switch: a pseudo-element that comes and goes along with the selector has nothing
 * to fade, and a property that exists in one state only cannot be transitioned
 * back. The stacking context is set up here rather than with the state, so
 * becoming inert does not rebuild it mid-transition.
 */
#menu-files,
#menu-pkg,
#menu-tools {
    position: relative;
    isolation: isolate;
    opacity: 1;
    transition: opacity var(--animation);
}

#menu-files::before,
#menu-pkg::before,
#menu-tools::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity var(--animation);
    background-image: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.08) 0,
        rgba(255, 255, 255, 0.08) 8px,
        transparent 8px,
        transparent 16px
    );
    background-size: 100% 100%;
    background-repeat: no-repeat;
    mix-blend-mode: screen;
}

/* The hatching is painted behind the content it covers */
#menu-files > *,
#menu-pkg > *,
#menu-tools > * {
    position: relative;
    z-index: 1;
}

:is(#menu-files, #menu-pkg, #menu-tools):is([inert], .inert) {
    opacity: 0.4;
}

:is(#menu-files, #menu-pkg, #menu-tools):is([inert], .inert)::before {
    opacity: 1;
}

select {
    border: none;
}

input, select, option {
    font: unset;
    color: unset;
    background-color: unset;
}

option {
    background-color: var(--bg-color);
}

/*
 * UI Helpers
 */

.windows {
    font-family: Segoe WPC,Segoe UI,sans-serif;
}

.macos {
    font-family: -apple-system,BlinkMacSystemFont,sans-serif;
}

.linux {
    font-family: system-ui,Ubuntu,Droid Sans,sans-serif;
}

.fa-power-off { color: #ffcc4d; }
.fa-bug { color: #ffcc4d; }
.fa-download { color: #4ec9b0; }
.fa-circle-play { color: #3794ff; }
.fa-circle-stop { color: #ff7272; }
.fa-circle-info { color: #3794ff; }
.fa-file { color: #3794ff; }
.fa-file-circle-exclamation { color: #ed4337; }
.fa-folder, .fa-folder-open { color: #ffcc4d; }
.fa-certificate { color: #ba0311; }
.fa-cube { color: #ba9066; }
.fa-cubes { color: #ba9066; }
.fa-gauge-high { color: #4ec9b0; }
.fa-tools { color: #ccd6dd; }
/*.fa-arrows-rotate { color: #3b88c3; }*/
.fa-sliders { color: #ccd6dd }
.fa-trash-can { color: #ccd6dd }
.fa-star { color: #ffcc4d; }

.highlight {
    background: var(--bg-color-edit);
    border-radius: 3px;
    padding: 3px 5px 3px 5px;
    line-height: 1.35;
    white-space: nowrap;
}

.hidden {
    display: none;
}

.space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.monospace {
    font-family: ui-monospace, "Droid Sans Mono", "Cascadia Mono", Consolas, Menlo, monospace;
    font-weight: normal;
    white-space: pre;
    font-size: 0.9rem;
    line-height: 1.35;
}

/* Title-lines */

.title-lines {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-align: center;
}

.title-lines:before, .title-lines:after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background-color: #cccccc88;
}

/* Tabs */

.tabs {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    user-select: none;
    font-size: 1.1rem;
}

.tab {
    /* inline-flex, not inline: an inline box ignores the vertical padding,
       which let the active background bleed out of the line box. The gap
       stands in for the markup whitespace that flex layout drops. */
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 5px 10px;
}

.tab.active {
    background: var(--bg-color-edit);
    box-shadow: inset 0 2px 0 var(--accent-color);
}

.tab-content {
    display: none;
    flex: 1;
    padding: 5px 0px 5px 5px;
}

.tab-content.active {
    display: block;
}

/*
 * Standalone pages (bridge, benchmark)
 */

body.page {
    height: auto;
    min-height: 100%;
    padding: 20px;
    line-height: 1.8;
}

body.page h1 {
    font-size: 1.5em;
}

/* Keeps buttons and checkboxes on one baseline where they sit inline in a
   sentence, and lets them wrap as a unit on narrow screens. The gaps stand in
   for the markup whitespace that flex layout drops. */
.button-row, .check-row {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    vertical-align: middle;
}

.button-row {
    gap: 0 4px;
}

.check-row {
    gap: 0 1em;
}

/*
 * SPDX-FileCopyrightText: 2024 Volodymyr Shymanskyy
 * SPDX-License-Identifier: MIT
 */

.steps {
    max-width: 640px;
}

/*
 * Accordion steps
 *
 * Each step is a header (always visible - title, plus a one-line recap once collapsed)
 * over a body. The body's height is animated via the grid-template-rows trick (0fr <->
 * 1fr on a single-row grid) rather than max-height: that needs no measured/guessed
 * pixel value and still collapses a body of any size to exactly 0.
 * flasher.js drives .collapsed to roll a finished step up when the next one opens;
 * clicking a header only ever opens it back up (never collapses it from here), so an
 * earlier choice stays reachable without a click on the step you're currently using
 * accidentally rolling it up on you.
 */
.step-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    cursor: default;
    user-select: none;
    padding: 2px 0;
}

.step.collapsed .step-header {
    cursor: pointer;
}

.step-title {
    font-weight: 600;
}

.step-recap {
    display: none;
    opacity: 0.75;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.step.collapsed .step-recap {
    display: inline;
}

/* An icon in front of a recap's text (the chosen family's), sized to the text. */
.step-recap img, .step-recap svg {
    height: 1.1em;
    width: auto;
    margin-right: 6px;
    vertical-align: -0.2em;
}

.step-recap svg {
    color: #3b88c3;
}

/* .button-row (app_common.css) sets display after .hidden does, at the same specificity,
   and so wins: without this a hidden button row - the Flash controls, the download
   button - would stay on screen. */
.button-row.hidden {
    display: none;
}

/* A step that was skipped because it cannot work here: its recap says why, in amber. */
.step.warning .step-recap {
    color: #f0ad4e;
    opacity: 1;
}

.step-body-wrap {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows var(--animation);
}

.step.collapsed .step-body-wrap {
    grid-template-rows: 0fr;
}

.step-body {
    overflow: hidden;
    min-height: 0;
}

/* Three columns at most - the 140px cards are fixed-width, so the grid never needs more
   than the cards' own widths, and below 470px it drops to two rather than overflow. */
.family-row {
    display: grid;
    grid-template-columns: repeat(4, 140px);
    gap: 8px;
    margin-top: 8px;
}

@media (max-width: 650px) {
    .family-row {
        grid-template-columns: repeat(2, 140px);
    }
}

/*
 * The same card look (background, radius, padding, icon colour) under two layouts:
 * .family-btn stacks icon over a short label, fixed-width so three sit in a row;
 * .action-btn is a single line (icon beside the label, which here runs much longer -
 * "Connect via USB / Serial"), fixed at 400px so Connect and Flash line up underneath.
 */
.card-btn {
    position: relative;   /* lets #btn-flash layer a progress fill behind its content - see below */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 6px;
    background: var(--bg-color-edit);
    font-size: 1rem;
}

/* A positioned ::before paints above plain in-flow content regardless of DOM order -
   only another positioned element paints over it (in tree order), so the icon/label
   need lifting onto that same layer to stay above #btn-flash's fill below. `> *`, not
   `> i, > span`: FontAwesome's dom.watch() replaces the <i> with an <svg> (class
   svg-inline--fa, not a tag this could keep matching by name), which used to fall back
   to painting under the fill while the still-untouched <span> stayed above it - the
   bug this rule is actually here to prevent. */
.card-btn > * {
    position: relative;
    z-index: 1;
}

.card-btn i {
    font-size: 1.8rem;
    color: #3b88c3;
}

/* Sized to match .card-btn i above, so a logo - the "Open Codemicro" button's, or a
   vendor's on a family card (assets/vendors, all 512x512) - sits the same as every
   icon-led card-btn around it rather than at the image's own native size. */
.btn-logo {
    height: 1.8rem;
    width: auto;
}

.family-btn {
    flex-direction: column;
    width: 140px;
}

.family-btn.selected {
    box-shadow: inset 0 0 0 2px var(--accent-color);
}

.action-btn {
    width: 400px;
}

/* A deliberately secondary look next to .action-btn: erasing is its own small, plain
   action beside the big primary one, not another card competing with it for attention. */
.small-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--bg-color-edit);
    font-size: 0.85rem;
}

.small-btn i {
    color: #e0a040;   /* a warm, "be careful" tone - short of the alarm red of an error */
}

.board-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 8px 0;
}
.board-row .form-grid {
    flex: 1 1 auto;
    margin: 0;
}
.board-img {
    flex: none;
    width: 96px;
    height: 96px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.board-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.board-img img.placeholder { opacity: 0.2; }

.form-grid {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 10px;
    align-items: center;
    margin: 8px 0;
    max-width: 480px;
}

.hint {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 6px;
}

#file-local {
    max-width: 55vw;
}

/*
 * The Flash button doubles as its own progress bar: a fill behind the icon/label,
 * width driven by the --progress custom property flasher.js sets as esptool-js reports
 * real bytes-written progress. Only exists at all while .flashing - otherwise this is
 * a plain .card-btn, not a slightly-different-looking one stuck at 0%.
 *
 * It stays `disabled` the whole time (flasher.js - a second click mid-flash must not
 * start another one), but the generic button:disabled in app_common.css would wash the
 * fill out to 40% opacity on top of its own - a progress bar has no business looking
 * greyed out. This button alone keeps its normal look while disabled.
 */
#btn-flash.flashing:disabled {
    opacity: 1;
    cursor: progress;
}

#btn-flash.flashing::before {
    content: '';
    position: absolute;
    inset: 0;
    width: var(--progress, 0%);
    background: var(--accent-color);
    opacity: 0.45;
    transition: width 0.2s ease-out;
}

/* Drive writes report no midpoint (see flasher.js) - a moving stripe reads as "still
   going" without claiming a percentage that isn't known. */
#btn-flash.flashing.indeterminate::before {
    width: 100%;
    background: repeating-linear-gradient(135deg,
        var(--accent-color) 0, var(--accent-color) 10px,
        transparent 10px, transparent 20px);
    background-size: 28px 100%;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    to { background-position: 28px 0; }
}

@media (prefers-reduced-motion: reduce) {
    #btn-flash.flashing.indeterminate::before {
        animation: none;
    }
}

/*
 * Log drawer
 *
 * Slides in from the right rather than sitting inline - the connect/pick/flash flow
 * above is the interface; the log is detail for when something needs explaining.
 * Kept in normal flow (never display:none) and only translated off-screen, so xterm's
 * FitAddon always sees a real size to fit into, open or not.
 */

/* The report-a-bug link and the log button, side by side in the top right corner. */
.top-actions {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 20;
    display: flex;
    gap: 8px;
}

.top-action {
    /* The same look for the link and the button: the global button rule's padding and
       size, which an <a> does not get on its own. */
    display: flex;
    align-items: center;
    padding: 5px;
    background: var(--bg-color-edit);
    border-radius: 6px;
    line-height: 1;
    font-size: 1.3rem;
}

.log-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(480px, 92vw);
    display: flex;
    flex-direction: column;
    background: var(--bg-color-edit);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform var(--animation);
    z-index: 30;
}

.log-drawer.open {
    transform: translateX(0);
}

.log-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 4px 4px 12px;
    font-weight: 600;
    border-bottom: 1px solid #ffffff22;
    flex: 0 0 auto;
}

.log-term {
    flex: 1 1 auto;
    min-height: 0;   /* lets the flex child shrink - otherwise it never gets smaller
                         than its content, and FitAddon never sees a reason to shrink it */
    padding: 4px;
}
