/* The site's shell, drawn as VS Code is, with its theme's variables
   (theme.css): a title bar, the side bar, the tabs and their editors, the
   status bar; the notifications and the dialogs. */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--vscode-font-family);
  font-size: var(--vscode-font-size);
  color: var(--vscode-foreground);
  background: var(--vscode-editor-background);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--vscode-button-border, transparent);
  border-radius: 2px;
  padding: 3px 10px;
  background: var(--vscode-button-secondaryBackground);
  color: var(--vscode-button-secondaryForeground);
}

button:hover {
  background: var(--vscode-button-secondaryHoverBackground);
}

button.primary {
  background: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
}

button.primary:hover {
  background: var(--vscode-button-hoverBackground);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 1px solid var(--vscode-focusBorder);
  outline-offset: 1px;
}

a {
  color: var(--vscode-textLink-foreground);
}

input[type="text"] {
  font: inherit;
  width: 100%;
  padding: 4px 6px;
  color: var(--vscode-input-foreground);
  background: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
}

.spacer {
  flex: 1 1 auto;
}

/* the parts of one mode only: the demo site's, or the local one's */
body.local [data-demo],
body:not(.local) [data-local] {
  display: none !important;
}

/* --- title bar ------------------------------------------------------------ */

#titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--vscode-sideBar-background);
  border-bottom: 1px solid var(--vscode-panel-border);
  flex-wrap: wrap;
}

#titlebar nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

#titlebar nav button,
#titlebar #theme {
  background: transparent;
  color: var(--vscode-foreground);
}

#titlebar nav button:hover,
#titlebar #theme:hover {
  background: var(--vscode-toolbar-hoverBackground);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-right: 12px;
}

.tag {
  font-weight: normal;
  font-size: 11px;
  padding: 0 5px;
  border-radius: 8px;
  border: 1px solid var(--vscode-panel-border);
  color: var(--vscode-descriptionForeground);
}

/* --- side bar and editors -------------------------------------------------- */

#main {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

#sidebar {
  flex: 0 0 300px;
  overflow: auto;
  background: var(--vscode-sideBar-background);
  border-right: 1px solid var(--vscode-panel-border);
}

#sidebar h3 {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 6px 8px 4px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vscode-sideBarSectionHeader-foreground);
}

.section-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 2px;
}

.section-actions button,
.item-actions button {
  background: transparent;
  color: var(--vscode-foreground);
  padding: 0 5px;
  line-height: 18px;
}

.section-actions button:hover,
.item-actions button:hover {
  background: var(--vscode-toolbar-hoverBackground);
}

.tree {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.item {
  display: flex;
  align-items: center;
  min-height: 22px;
}

.item:hover {
  background: var(--vscode-list-hoverBackground);
}

.item.current {
  background: var(--vscode-list-inactiveSelectionBackground);
}

.item-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  background: transparent;
  color: inherit;
  border: 0;
  text-align: left;
  padding: 2px 4px 2px 14px;
}

.item-main:hover {
  background: transparent;
}

.item.depth1 .item-main {
  padding-left: 30px;
}

.item .icon {
  flex: 0 0 auto;
  width: 16px;
  text-align: center;
}

/* the codicons beside a text, and in the small buttons */
.section-actions .codicon,
.item-actions .codicon {
  vertical-align: middle;
}

.tab .kind.codicon,
.tab .close .codicon {
  vertical-align: text-bottom;
}

.item .label {
  flex: 0 0 auto;
}

.item .description {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--vscode-descriptionForeground);
  font-size: 12px;
}

.item-actions {
  display: none;
  padding-right: 6px;
}

.item:hover .item-actions,
.item:focus-within .item-actions {
  display: inline-flex;
}

.welcome {
  padding: 0 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.welcome[hidden] {
  display: none;
}

.welcome p {
  margin: 0;
  color: var(--vscode-descriptionForeground);
}

#editor-area {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#tabs {
  flex: 0 0 auto;
  display: flex;
  overflow-x: auto;
  background: var(--vscode-sideBar-background);
  border-bottom: 1px solid var(--vscode-editorGroup-border);
}

.tab {
  display: flex;
  align-items: center;
  border-right: 1px solid var(--vscode-editorGroup-border);
  color: var(--vscode-descriptionForeground);
}

.tab.active {
  background: var(--vscode-editor-background);
  color: var(--vscode-foreground);
}

.tab .label,
.tab .close {
  background: transparent;
  color: inherit;
  border: 0;
}

.tab .label {
  padding: 6px 4px 6px 10px;
  white-space: nowrap;
}

.tab .kind {
  margin-right: 6px;
}

.tab .close {
  padding: 0 8px 0 4px;
  opacity: 0.6;
}

.tab .close:hover {
  opacity: 1;
}

.tab.dirty .close::before {
  content: "●";
  margin-right: 4px;
}

#panes {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
}

.pane {
  position: absolute;
  inset: 0;
}

.pane[hidden] {
  display: none;
}

iframe.editor {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.text-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.text-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  border-bottom: 1px solid var(--vscode-panel-border);
}

.text-pane pre {
  flex: 1 1 auto;
  margin: 0;
  padding: 10px 14px;
  overflow: auto;
  font-family: var(--vscode-editor-font-family);
  font-size: var(--vscode-editor-font-size);
}

#empty {
  max-width: 560px;
  margin: 12vh auto 0;
  padding: 0 24px;
  color: var(--vscode-descriptionForeground);
}

#empty h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--vscode-foreground);
}

#empty[hidden] {
  display: none;
}

/* --- status bar ------------------------------------------------------------ */

#statusbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 10px;
  font-size: 12px;
  background: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
}

#statusbar a,
#statusbar button {
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 12px;
}

#statusbar .codicon {
  font-size: 14px;
  vertical-align: text-bottom;
  margin-right: 4px;
}

/* the license: a noncommercial one marked, none valid in the error colour */
#status-license {
  padding: 0 6px;
  border-radius: 2px;
}

#status-license.noncommercial {
  background: #cca700;
  color: #1e1e1e;
}

#status-license.error {
  background: #c72e2e;
  color: #ffffff;
}

#status-quota.closed {
  font-weight: 600;
}

#status-busy .busy {
  margin-right: 10px;
}

/* --- notifications and dialogs --------------------------------------------- */

#toasts {
  position: fixed;
  right: 14px;
  bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(460px, calc(100vw - 28px));
  z-index: 10;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 10px;
  align-items: start;
  padding: 10px 12px;
  background: var(--vscode-editorWidget-background);
  border: 1px solid var(--vscode-editorWidget-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.toast p {
  margin: 0;
  overflow-wrap: anywhere;
}

.toast .icon {
  color: var(--vscode-charts-blue);
}

.toast.warn .icon {
  color: var(--vscode-editorWarning-foreground);
}

.toast.error .icon {
  color: var(--vscode-editorError-foreground);
}

.toast .actions {
  grid-column: 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.toast .actions:empty {
  display: none;
}

.toast .close {
  grid-column: 3;
  grid-row: 1;
  background: transparent;
  color: var(--vscode-foreground);
  padding: 0 4px;
}

@media (prefers-reduced-motion: reduce) {
  .codicon-modifier-spin {
    animation: none;
  }
}

.modal-back {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(0, 0, 0, 0.4);
  z-index: 20;
}

.modal {
  width: min(720px, 100%);
  max-height: 76vh;
  overflow: auto;
  padding: 14px 18px;
  background: var(--vscode-editorWidget-background);
  border: 1px solid var(--vscode-editorWidget-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.modal h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
}

.modal p {
  margin: 0 0 10px;
  line-height: 1.45;
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal label.check {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
}

.modal .hint {
  color: var(--vscode-descriptionForeground);
  font-size: 12px;
  margin-top: 6px;
}

.modal .buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.pick {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pick button,
.pick label {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  padding: 5px 6px;
}

.pick button:hover,
.pick label:hover {
  background: var(--vscode-list-hoverBackground);
}

.pick small {
  color: var(--vscode-descriptionForeground);
}

.modal textarea {
  font: inherit;
  width: 100%;
  padding: 4px 6px;
  color: var(--vscode-input-foreground);
  background: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
  resize: vertical;
}

.modal input[type="text"],
.modal input[type="email"],
.modal select {
  font: inherit;
  padding: 3px 6px;
  color: var(--vscode-input-foreground);
  background: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border);
}

.modal .form {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.modal dl.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 4px 0 12px;
}

.modal dl.facts dt {
  color: var(--vscode-descriptionForeground);
}

.modal dl.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.modal ul.skipped {
  margin: 0 0 10px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* the end-user license agreement, read in its dialog */
.modal pre.eula-text {
  max-height: 45vh;
  overflow: auto;
  margin: 4px 0 12px;
  padding: 10px 12px;
  white-space: pre-wrap;
  font-family: var(--vscode-font-family);
  font-size: 12px;
  line-height: 1.5;
  background: var(--vscode-editorWidget-background);
  border: 1px solid var(--vscode-editorWidget-border);
  border-radius: 4px;
}

.modal a,
.modal button.link {
  color: var(--vscode-textLink-foreground);
}

.modal button.link {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.modal fieldset.kinds {
  border: 0;
  margin: 0 0 10px;
  padding: 0;
}

.modal fieldset.kinds legend {
  margin-bottom: 6px;
}

.modal fieldset.kinds label.check {
  margin: 0 0 4px;
}

table.runs {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

table.runs th,
table.runs td {
  text-align: left;
  padding: 4px 6px;
  border-bottom: 1px solid var(--vscode-panel-border);
  vertical-align: top;
}

table.runs th {
  color: var(--vscode-descriptionForeground);
  font-weight: 600;
}

table.runs td.flag {
  color: var(--vscode-editorWarning-foreground);
}

pre.details {
  max-height: 50vh;
  overflow: auto;
  padding: 8px;
  font-family: var(--vscode-editor-font-family);
  font-size: 12px;
  background: var(--vscode-editor-background);
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  #main {
    flex-direction: column;
  }

  #sidebar {
    flex: 0 0 auto;
    max-height: 38vh;
    border-right: 0;
    border-bottom: 1px solid var(--vscode-panel-border);
  }
}

/* --- menus: a button's (⋯) and a right-click's (intrepid-vscode's webview/menu.ts) --------------- */

.menu {
  position: fixed;
  z-index: 1000;
  min-width: 180px;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  color: var(--vscode-menu-foreground, var(--vscode-foreground, #cccccc));
  background: var(--vscode-menu-background, var(--vscode-editorWidget-background, #252526));
  border: 1px solid var(--vscode-menu-border, var(--vscode-editorWidget-border, #454545));
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.36);
}

.menu button {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 4px 12px 4px 8px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.menu button:hover:not(:disabled),
.menu button:focus-visible {
  outline: none;
  color: var(--vscode-menu-selectionForeground, var(--vscode-foreground, #ffffff));
  background: var(--vscode-menu-selectionBackground, var(--vscode-list-activeSelectionBackground, #04395e));
}

.menu button:disabled {
  opacity: 0.45;
  cursor: default;
}

.menu .menu-keys {
  padding-left: 18px;
  font-size: 0.9em;
  opacity: 0.7;
}

.menu-separator {
  height: 1px;
  margin: 4px 0;
  background: var(--vscode-menu-separatorBackground, var(--vscode-editorWidget-border, #454545));
}
