/* The page frame shared by the application and Recent jobs pages: sidebar, top bar, and status pills. */

main {
  width: 100%;
  max-width: none;
}

/*
 * A status pill: one per displayed status on every page. The tone comes from
 * statusTones (internal/webui/status.go); colours from the status tokens.
 */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 1px 9px 1px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 560;
  line-height: 20px;
  white-space: nowrap;
}
.status-pill::before {
  width: 12px;
  font-size: 11px;
  text-align: center;
}
.status-pill.tone-ok {
  color: var(--s-ok);
  background: var(--s-ok-bg);
}
.status-pill.tone-ok::before {
  content: "✓";
}
.status-pill.tone-bad {
  color: var(--s-bad);
  background: var(--s-bad-bg);
}
.status-pill.tone-bad::before {
  content: "✕";
}
.status-pill.tone-run {
  color: var(--s-run);
  background: var(--s-run-bg);
}
.status-pill.tone-run::before {
  content: "▶";
}
.status-pill.tone-warn {
  color: var(--s-warn);
  background: var(--s-warn-bg);
}
.status-pill.tone-warn::before {
  content: "!";
}
.status-pill.tone-off {
  color: var(--s-off);
  background: var(--s-off-bg);
}
.status-pill.tone-off::before {
  content: "■";
}
.status-pill.carried {
  border: 1px dashed currentColor;
  background: transparent;
}
.status-pill.carried::before {
  content: "↩";
}
/* Sidebar: brand, views, and the basedir tree. */
.sidebar {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 260px;
  min-width: 190px;
  max-width: 520px;
  height: calc(100vh - var(--terminal-height, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  padding: 18px 12px 22px;
  border-right: 1px solid var(--line-soft);
  background: var(--surface);
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: 20px 15px;
  align-items: center;
  column-gap: 10px;
  margin: 0 4px 10px;
  padding: 2px 4px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  grid-row: 1 / 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in oklab, var(--logo-red) 40%, transparent);
  border-radius: 10px;
  background: color-mix(in oklab, var(--logo-red) 10%, var(--surface));
  line-height: 1;
}

.brand-mark .brand-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.brand-name {
  align-self: end;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-caption {
  align-self: start;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

/* Section headings are labels, not links: smaller, spaced out, and followed
   by a rule so they read apart from the clickable entries beneath them. */
.sidebar-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 8px 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: default;
  user-select: none;
}
.sidebar-section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.sidebar-section-note {
  margin: -2px 8px 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.sidebar-link,
.sidebar-project-link,
.sidebar-run {
  border-radius: 6px;
  text-decoration: none;
  transition:
    color 140ms ease,
    background 140ms ease;
}

.sidebar-link {
  display: block;
  padding: 5px 8px;
  color: var(--text-2);
  font-size: 13px;
}

.sidebar-link:hover,
.sidebar-project-row:hover,
.sidebar-run:hover {
  background: var(--surface-2);
}

.sidebar-link.active,
.sidebar-run.active,
.sidebar-project:not(.basedir-entry) .sidebar-project-link.active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}

.sidebar-project {
  min-width: 0;
}

.sidebar-project-row {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 2px;
  padding: 0 2px;
  border-radius: 6px;
}

.sidebar-project-link {
  flex: 1;
  min-width: 0;
  padding: 4px 6px 4px 8px;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A project with shells running, marked by web_shell.js: the icon of Open a terminal
   here, after the link so that a long name cut short does not hide it. */
.sidebar-project-row[data-terminal-shells]::after {
  flex: none;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  background: currentColor;
  color: var(--muted);
  content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 4-5 4'/%3E%3Cpath d='M12 17h7'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 4-5 4'/%3E%3Cpath d='M12 17h7'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* A basedir is labelled by its parent directory and its own name (basedirLabelHTML). */
.basedir-path {
  font-family: var(--font-mono);
  font-size: 12px;
}
.basedir-parent {
  font-weight: 600;
}
.basedir-name {
  color: var(--muted);
}
/* A registered basedir whose directory is gone. */
.basedir-missing {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--s-warn-bg);
  color: var(--s-warn);
  font-family: var(--font-sans);
  font-size: 11px;
}

/* The bell is a checkbox: notify about runs in this basedir. */
.basedir-bell {
  position: relative;
  display: grid;
  flex: none;
  width: 26px;
  height: 24px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}
.basedir-bell:hover {
  border-color: var(--line);
}
.basedir-bell input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.basedir-bell svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.basedir-bell:has(input:checked) {
  background: var(--accent-soft);
  color: var(--accent-text);
}
/* The heading bell is mixed while only some basedir bells are on. */
.basedir-bell:has(input:indeterminate) {
  border-color: var(--line);
  color: var(--accent-text);
}
.basedir-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.basedir-heading .basedir-bell {
  letter-spacing: normal;
  text-transform: none;
}
.basedir-bell[hidden] {
  display: none;
}
.basedir-bell:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.sidebar-toggle {
  display: flex;
  flex: 0 0 auto;
  width: 22px;
  height: 28px;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.sidebar-toggle-placeholder {
  display: block;
  flex: 0 0 22px;
  height: 28px;
}

.sidebar-toggle::before {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent currentColor;
  content: "";
  transition: transform 100ms ease;
}

.sidebar-project.expanded .sidebar-toggle::before {
  transform: rotate(90deg);
}

.sidebar-projects,
.sidebar-runs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-left: 10px;
  padding-left: 8px;
  border-left: 1px solid var(--line-soft);
}

.basedir-contents {
  margin-left: 20px;
  padding-left: 0;
  border-left: 0;
}

.sidebar-projects[hidden],
.sidebar-runs[hidden] {
  display: none;
}

.sidebar-run {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-run-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--s-off);
}
.sidebar-run-dot.tone-ok {
  background: var(--s-ok);
}
.sidebar-run-dot.tone-bad {
  background: var(--s-bad);
}
.sidebar-run-dot.tone-run {
  background: var(--s-run);
}
.sidebar-run-dot.tone-warn {
  background: var(--s-warn);
}

.brand-icon {
  width: 0.85em;
  height: 0.85em;
}

.sidebar-resizer {
  position: relative;
  z-index: 4;
  flex: 0 0 12px;
  align-self: stretch;
  margin-left: -6px;
  margin-right: -6px;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resizer::after {
  position: absolute;
  top: 0;
  right: 3px;
  bottom: 0;
  width: 2px;
  background: transparent;
  content: "";
  transition: background 120ms ease;
}

.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
.sidebar-resizer.dragging::after {
  background: color-mix(in oklab, var(--accent) 78%, transparent);
}

/* Top bar: breadcrumbs, then notifications, refresh, and the Settings menu. */
.content {
  --content-x: clamp(22px, 3.1vw, 48px);
  padding-top: 0;
}

.content > .topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 6;
  display: flex;
  flex-direction: row;
  min-height: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 0 calc(-1 * var(--content-x)) 24px;
  padding: 10px var(--content-x);
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
}

.crumbs {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.crumbs a {
  color: var(--text-2);
  text-decoration: none;
}
.crumbs a:hover {
  text-decoration: underline;
}
.crumb-basedir {
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.crumb-here {
  overflow: hidden;
  color: var(--text);
  font-weight: 500;
  text-overflow: ellipsis;
}
.crumb-sep {
  color: var(--line);
}
.crumbs .identity-copy,
.crumbs .jobs-copy {
  flex: none;
  width: 24px;
  height: 24px;
  min-height: 0;
  margin: 0;
  padding: 4px;
  border-color: transparent;
  background: transparent;
}

.content > .topbar .toolbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.content > .topbar .toolbar button {
  min-height: 32px;
  padding: 5px 11px;
}
#notify-toggle.notifications-on,
.notification-inbox > button.notifications-on {
  border-color: color-mix(in oklab, var(--accent) 60%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-text);
}

.settings-menu {
  position: relative;
}
.settings-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  width: 270px;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.settings-panel[hidden] {
  display: none;
}
/* Which rotari serves the page, at the foot of the Settings menu. Its buttons are drawn
   here too, since the application page does not have the Recent jobs page's styles, and
   their selectors outweigh the top bar's toolbar buttons (.content > .topbar .toolbar
   button), whose padding would leave a 24-pixel button no room for its picture. */
.settings-about {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
}
.settings-about-path {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
/* A long path loses its start rather than the binary's name. */
.settings-about-path code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  direction: rtl;
  font-family: var(--font-mono);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-about-path code bdi {
  direction: ltr;
  unicode-bidi: isolate;
}
.settings-menu .settings-panel .settings-about button.jobs-copy {
  flex: none;
  width: 24px;
  height: 24px;
  min-height: 0;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.settings-menu .settings-panel .settings-about button.jobs-copy:hover {
  background: var(--surface-2);
}
.settings-menu .settings-panel .settings-about button.jobs-copy.copied {
  border-color: var(--s-ok);
  color: var(--s-ok);
}
.settings-about .jobs-copy svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  pointer-events: none;
}
.settings-about-unknown {
  color: var(--muted);
  font-style: italic;
}
.theme-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
}
.theme-choice select {
  min-width: 0;
  min-height: 30px;
  padding: 3px 8px;
  font-size: 12px;
}
.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.settings-actions:empty {
  display: none;
}
.content > .topbar .settings-actions button {
  width: 100%;
  min-height: 0;
  padding: 7px 8px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}
.content > .topbar .settings-actions button:hover:not(:disabled) {
  background: var(--surface-2);
}
/* Stop server, above the About section; its selectors outweigh both top bars' toolbar
   buttons, as the About section's do. */
.settings-editor {
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.settings-editor label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--text-2);
  font-size: 13px;
}
.settings-editor select,
.editor-form select {
  min-width: 0;
  min-height: 30px;
  padding: 3px 8px;
  font-size: 12px;
}
/* Not shown in this browser, whose Settings chose no editor. */
html[data-editor-hidden] button.editor-action {
  display: none;
}
html[data-editor-hidden] .log .log-path {
  text-decoration: none;
  cursor: auto;
}
.settings-panel .settings-editor button {
  width: 100%;
  min-height: 0;
  padding: 7px 8px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}
.settings-panel .settings-editor button:hover {
  background: var(--surface-2);
}
.settings-stop {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.settings-panel .settings-stop button {
  width: 100%;
  min-height: 0;
  padding: 7px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--s-bad);
  text-align: left;
}
.settings-panel .settings-stop button:hover:not(:disabled) {
  background: var(--surface-2);
}
.settings-stop-status {
  color: var(--text-2);
  font-size: 12px;
}
.settings-stop-status:empty {
  display: none;
}

/* The page's title and its facts. */
.page-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 20px;
}
.page-head[hidden] {
  display: none;
}
.page-head h1 {
  display: block;
  margin: 0;
  font-size: clamp(22px, 2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  color: var(--text-2);
  font-size: 13px;
}

/* Below 760px the sidebar is a drawer over the page (web_shell.js). */
.drawer-toggle,
.drawer-scrim {
  display: none;
}

@media (max-width: 760px) {
  .content {
    --content-x: 18px;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(300px, 86vw) !important;
    max-width: none;
    height: 100%;
    visibility: hidden;
    transform: translateX(-100%);
    transition:
      transform 160ms ease,
      visibility 160ms;
    box-shadow: var(--shadow-pop);
  }
  body.drawer-open .sidebar {
    visibility: visible;
    transform: none;
  }
  body.drawer-open .drawer-scrim {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    background: var(--overlay);
  }
  .sidebar-resizer {
    display: none;
  }
  .content > .topbar .drawer-toggle {
    display: inline-flex;
    min-height: 32px;
    padding: 5px 9px;
  }
  .content > .topbar .toolbar button {
    padding: 5px 8px;
  }
  .crumbs > .crumb-basedir,
  .crumbs > .crumb-basedir + button,
  .crumbs > .crumb-basedir + button + .crumb-sep {
    display: none;
  }
}

/* On a phone the page refreshes itself; its breadcrumb needs the room. */
@media (max-width: 520px) {
  .content > .topbar #refresh-button {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
}

/* A long ID shown by its end with a leading ellipsis; the text and title
   keep the whole ID (idTailHTML in assets.go, idTailHTML in
   web_app_core.js). The line height leaves room for underscores. */
.id-tail {
  display: inline-block;
  max-width: 16ch;
  overflow: hidden;
  direction: rtl;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  line-height: 1.5;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.id-tail > bdi {
  direction: ltr;
  unicode-bidi: isolate;
}
.notification-inbox {
  position: relative;
}
#notification-inbox-panel {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  width: min(26rem, 80vw);
  max-height: 60vh;
  overflow: auto;
  padding: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
}
.notification-inbox-list article {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.notification-inbox-list p {
  white-space: pre-wrap;
  margin: 0.5rem 0 0;
}
.notification-inbox-list .notification-inbox-error {
  color: var(--s-bad);
  overflow-wrap: anywhere;
}
.notification-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 760px) {
  #notification-inbox-panel {
    position: fixed;
    top: 4rem;
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

/* The terminal panel along the bottom of the page; web_shell.js adds it. The page
   keeps clear of it, so nothing it shows ends up underneath, and a job's log in a dialog
   stays beside the shell. */
html.terminal-open {
  --terminal-height: var(--terminal-saved-height, 320px);
}
/* At a side, it has the window's height, and the whole page takes the rest of the width. */
html.terminal-open[data-terminal-place] {
  --terminal-height: 0px;
}
html.terminal-open[data-terminal-place="left"] {
  --terminal-left: var(--terminal-saved-width, 480px);
}
html.terminal-open[data-terminal-place="right"] {
  --terminal-right: var(--terminal-saved-width, 480px);
}
/* The top bar is over the panel, for its menus, so what is in it must not run under the
   panel in the room left: it wraps. */
html.terminal-open[data-terminal-place] .content > .topbar,
html.terminal-open[data-terminal-place] .content > .topbar .toolbar {
  flex-wrap: wrap;
}
html.terminal-open[data-terminal-place] .content > .topbar .toolbar {
  justify-content: flex-end;
  max-width: 100%;
}
html.terminal-open body {
  min-height: calc(100vh - var(--terminal-height));
  padding-bottom: var(--terminal-height);
  padding-left: var(--terminal-left, 0px);
  padding-right: var(--terminal-right, 0px);
}
html.terminal-open main {
  min-height: calc(100vh - var(--terminal-height));
}
html.terminal-open .output-modal {
  right: var(--terminal-right, 0px);
  bottom: var(--terminal-height);
  left: var(--terminal-left, 0px);
}
/* A dialog fits the room left above the panel, so none of it is out of reach. */
html.terminal-open .output-panel {
  height: min(760px, 100%);
  max-height: 100%;
}
html.terminal-open .output-panel.compact {
  height: auto;
}
html.terminal-open .artifact-view {
  max-height: 100%;
}
#terminal-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  /* Over the page, and under the top bar, whose Settings and Inbox open over it. */
  z-index: 5;
  display: flex;
  flex-direction: column;
  height: var(--terminal-height);
  /* A <section>, but not a card like the page's: it reaches the window's edges. */
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: var(--terminal-background);
}
html.terminal-open[data-terminal-place] #terminal-panel {
  top: 0;
  height: auto;
  border-top: 0;
}
html.terminal-open[data-terminal-place="left"] #terminal-panel {
  right: auto;
  width: var(--terminal-left);
  border-right: 1px solid var(--line);
}
html.terminal-open[data-terminal-place="right"] #terminal-panel {
  left: auto;
  width: var(--terminal-right);
  border-left: 1px solid var(--line);
}
#terminal-panel[hidden] {
  display: none;
}
/* The panel over the whole page, top bar included. Only an open panel does this, and
   the page behind keeps its size and does not scroll. */
html.terminal-open.terminal-maximized {
  overflow: hidden;
}
html.terminal-open.terminal-maximized #terminal-panel {
  top: 0;
  z-index: 50;
  right: 0;
  left: 0;
  width: auto;
  height: auto;
}
html.terminal-open.terminal-maximized .terminal-resizer {
  display: none;
}
/* The panel in a window of its own fills it, with no page to make room for. */
html[data-terminal-window] {
  overflow: hidden;
}
html[data-terminal-window] body {
  min-height: 0;
  margin: 0;
  padding: 0;
}
html[data-terminal-window] #terminal-panel {
  top: 0;
  height: auto;
  border-top: 0;
}
/* No shell to show yet: an empty terminal would read as something broken. */
#terminal-panel.terminal-empty,
#terminal-panel.terminal-empty .terminal-viewport {
  background: var(--surface);
}
#terminal-panel.terminal-empty .xterm {
  visibility: hidden;
}
/* What a send button did, which outlives the page redrawing the button. */
.terminal-send-note {
  position: fixed;
  right: calc(var(--terminal-right, 0px) + 16px);
  bottom: calc(var(--terminal-height, 0px) + 12px);
  /* Over a maximized panel too. */
  z-index: 60;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
}
.terminal-send-note[hidden] {
  display: none;
}
.editor-note {
  overflow-wrap: anywhere;
}
.terminal-send-note button,
.editor-note button {
  min-height: 0;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 12px;
}
.editor-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.editor-form label {
  display: block;
}
.editor-form .editor-host {
  padding-left: 22px;
}
.editor-form p {
  margin: 0;
}
.editor-form p:empty {
  display: none;
}
.terminal-font-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.terminal-font-form label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.terminal-font-form label[hidden] {
  display: none;
}
.terminal-font-form input,
.terminal-font-form select {
  flex: 1;
  min-width: 0;
}
.terminal-font-form p {
  margin: 0;
  overflow-wrap: anywhere;
}
.terminal-font-form p:empty {
  display: none;
}
.terminal-font-preview {
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--terminal-foreground);
  background: var(--terminal-background);
  font-size: 15px;
  white-space: nowrap;
}
.terminal-resizer {
  flex: none;
  height: 5px;
  margin-top: -3px;
  cursor: row-resize;
  touch-action: none;
}
html.terminal-open[data-terminal-place] .terminal-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 12;
  width: 6px;
  height: auto;
  margin: 0;
  cursor: col-resize;
}
html.terminal-open[data-terminal-place="left"] .terminal-resizer {
  right: -3px;
}
html.terminal-open[data-terminal-place="right"] .terminal-resizer {
  left: -3px;
}
.terminal-resizer:hover,
.terminal-resizer:focus-visible {
  background: var(--line);
  outline: none;
}
/* Too narrow for one row, the bar wraps: between its parts, and within one wider than it. */
.terminal-bar {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-height: 30px;
  padding: 2px 8px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
}
.terminal-bar-lead,
.terminal-bar-tabs,
.terminal-bar-tools {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}
.terminal-bar-tools {
  flex-grow: 1;
}
/* A project's page's own tabs, with their label and +. */
.terminal-own {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
/* Too many for one row at a side: the tabs have a row of their own under the buttons. */
html.terminal-open[data-terminal-place]:not(.terminal-maximized)
  .terminal-bar-tabs {
  order: 1;
  flex: 1 0 100%;
}
.terminal-title {
  color: var(--text);
  font-weight: 600;
}
.terminal-groups {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 200px;
  font-size: 12px;
}
.terminal-tabs {
  display: flex;
  flex: 0 1 auto;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}
/* Every tab is outlined, so that one not shown still reads as a tab. */
.terminal-tab {
  display: flex;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.terminal-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}
.terminal-tab:has([aria-selected="true"]) {
  border-color: var(--muted);
  background: var(--terminal-background);
  color: var(--text);
}
/* A project's page's state directory's own tabs, with their divider and +. */
.terminal-shared {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.terminal-shared[hidden] {
  display: none;
}
.terminal-shared-tabs {
  display: flex;
  flex: 0 1 auto;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}
/* Names the project's own tabs, when a state directory's own follow. */
.terminal-own-label {
  flex: none;
  align-self: center;
  color: var(--muted);
  font-size: 0.85em;
  white-space: nowrap;
}
/* Before a state directory's own tabs on a project's page. */
.terminal-tab-divider {
  flex: none;
  align-self: center;
  margin-left: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85em;
  white-space: nowrap;
}
/* Shown too, in the pane the keys are not going to. */
.terminal-tab-other-pane {
  border-color: var(--muted);
  border-style: dashed;
}
.terminal-bar .terminal-tab button {
  padding: 1px 6px;
  border: 0;
  background: none;
  color: inherit;
}
.terminal-bar .terminal-tab .terminal-tab-close {
  padding: 1px 5px 1px 0;
  color: var(--text-2);
}
/* Where a dragged tab would land. */
.terminal-drop-before {
  box-shadow: inset 2px 0 0 var(--text);
}
.terminal-drop-after {
  box-shadow: inset -2px 0 0 var(--text);
}
/* A tab whose shell runs a command in its foreground, before any dot or bell. */
.terminal-tab-running::before {
  content: "";
  flex: none;
  align-self: center;
  width: 7px;
  height: 8px;
  margin-left: 6px;
  background: var(--s-run);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
/* A tab with output nobody has seen. */
.terminal-tab-unseen {
  box-shadow: inset 0 -2px 0 var(--s-run);
}
.terminal-tab-unseen [role="tab"]::before {
  content: "\2022\00a0";
  color: var(--s-run);
}
/* A tab, or a card, whose command finished out of sight: a bell, in place of the dot. */
.terminal-tab-finished {
  box-shadow: inset 0 -2px 0 var(--s-ok);
}
.terminal-tab-finished [role="tab"]::before,
.terminal-overview-finished .terminal-overview-name::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  vertical-align: -1px;
  background: var(--s-ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
/* A command that ended out of sight with a failure: the bell in red. */
.terminal-tab-failed {
  box-shadow: inset 0 -2px 0 var(--s-bad);
}
.terminal-tab-failed [role="tab"]::before,
.terminal-overview-failed .terminal-overview-name::before {
  background: var(--s-bad);
}
/* A card's line on how its shell's last command ended. */
.terminal-overview-last {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-overview-last[hidden] {
  display: none;
}
.terminal-overview-last-failed {
  color: var(--s-bad);
}
.terminal-tab [role="tab"] {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* With what runs in it after its number or name, which gives way first. A button centres
   its text in the page's least height for one, which a flex one does only when told. */
.terminal-tab [role="tab"].terminal-tab-labelled {
  display: flex;
  align-items: center;
  gap: 5px;
}
.terminal-tab [role="tab"].terminal-tab-labelled::before {
  flex: none;
  margin-right: 0;
}
.terminal-tab-name {
  flex: 0 1 auto;
  min-width: 1ch;
  overflow: hidden;
  text-overflow: ellipsis;
}
.terminal-tab-program {
  flex: none;
  max-width: 12ch;
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
}
.terminal-tab-menu {
  position: fixed;
  z-index: 70;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  font-size: 12px;
}
.terminal-tab-menu button {
  border: 0;
  padding: 4px 10px;
  background: none;
  color: var(--text);
  font-size: 12px;
  text-align: left;
}
.terminal-tab-menu button:hover:not(:disabled),
.terminal-tab-menu button:focus-visible {
  background: var(--surface-2);
}
.terminal-tab-menu button[aria-checked="true"]::before {
  content: "\2713\00a0";
}
.terminal-tab-menu button:disabled {
  color: var(--muted);
}
/* Over the screen, so that a message coming and going does not resize the shell. */
.terminal-pane-status {
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 16px);
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
}
.terminal-pane-status[hidden] {
  display: none;
}
#terminal-panel.terminal-empty .terminal-pane-status {
  right: auto;
  left: 8px;
  border: 0;
}
.terminal-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-bar button,
.terminal-pane-status button {
  flex: none;
  padding: 2px 8px;
  font-size: 12px;
}
/* No frame, as the Table viewer's, and centered: the page's buttons are taller than this. */
.terminal-bar button.terminal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 3px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-2);
}
.terminal-bar button.terminal-icon:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}
.terminal-bar button.terminal-icon:disabled {
  background: none;
  opacity: 0.4;
}
/* The pointer is over the button, not its picture, so that the button's title shows as
   it did when the buttons were words. */
.terminal-icon svg {
  pointer-events: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
}
.terminal-spacer {
  flex: 1;
}
/* The terminal's dialogs, All shells and Launch, look like the application page's log
   dialog but bring their own frame: the Recent jobs page and the panel's own window load
   web_shell.css and not web_styles.css, which holds .output-modal's. They leave the
   panel's room as a log's does (html.terminal-open .output-modal), and the panel's own
   window has no room to leave. */
.terminal-overview-modal,
.terminal-launch-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--overlay);
}
html[data-terminal-window] .terminal-overview-modal,
html[data-terminal-window] .terminal-launch-modal {
  inset: 0;
}
.terminal-overview,
.terminal-launch {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(1100px, 96vw);
  max-height: min(760px, 90vh);
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  color: var(--text);
}
.terminal-launch {
  width: min(760px, 96vw);
}
.terminal-overview > header,
.terminal-launch > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}
.terminal-overview > header .modal-actions,
.terminal-launch > header .modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* As tall as its cards, up to a log's height. */
.output-panel.terminal-overview,
html.terminal-open .output-panel.terminal-overview {
  height: auto;
  overflow: hidden;
  font-size: 12px;
}
.terminal-overview-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.terminal-overview header button {
  padding: 2px 8px;
  font-size: 12px;
}
.terminal-overview-group + .terminal-overview-group {
  margin-top: 12px;
}
.terminal-overview-group h3 {
  display: flex;
  align-items: center;
  gap: 6px;
}
.terminal-overview-heading {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.terminal-overview-basedir {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.terminal-overview-project {
  color: var(--text);
}
.terminal-overview-end-all {
  min-height: 0;
  margin-left: auto;
  padding: 0 6px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 400;
  line-height: 18px;
}
.terminal-overview-add {
  min-height: 0;
  padding: 0 6px;
  font-size: 12px;
  line-height: 18px;
}
.terminal-overview-group h3 {
  margin: 0 0 6px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}
.terminal-overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
/* Rename and End sit in the card's top corner, beside the button that chooses it. */
/* The box is the item's, holding the button that chooses the shell, the line of what runs
   in it, and that line's process tree. */
.terminal-overview-item {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
.terminal-overview-item:hover,
.terminal-overview-item:focus-within {
  border-color: color-mix(in oklab, var(--accent) 60%, var(--line));
}
.terminal-overview-item:has(.terminal-overview-current) {
  box-shadow: inset 2px 0 0 var(--focus);
}
.terminal-overview-item > .terminal-overview-card {
  flex: none;
}
/* A card being dragged to another project, and the group it would move to. */
.terminal-overview-dragged {
  opacity: 0.5;
}
.terminal-overview-group.terminal-overview-drop {
  outline: 2px dashed var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.terminal-overview-run {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 0 8px 6px;
  font-size: 12px;
}
.terminal-overview-run[hidden],
.terminal-overview-process-list[hidden],
.terminal-overview-processes[hidden] {
  display: none;
}
.terminal-overview-run .terminal-overview-command {
  min-width: 0;
}
.terminal-overview-processes {
  flex: none;
  min-height: 0;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 11px;
  text-decoration: underline dotted;
  cursor: pointer;
}
.terminal-overview-processes:hover:not(:disabled) {
  color: var(--text);
}
.terminal-overview-processes[aria-expanded="true"] {
  color: var(--text);
}
.terminal-overview-run
  .terminal-overview-command:not([hidden])
  + .terminal-overview-processes::before {
  content: "\00b7\00a0";
}
.terminal-overview-process-list {
  margin: 0;
  padding: 0 8px 8px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 11px;
}
.terminal-overview-process-list li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-overview-pid {
  display: inline-block;
  min-width: 6ch;
  margin-right: 6px;
  color: var(--muted);
  text-align: right;
}
.terminal-overview-item .terminal-overview-top {
  padding-right: 112px;
}
.terminal-overview-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
}
.terminal-overview-actions button.terminal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 2px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-2);
}
.terminal-overview-actions button.terminal-icon:hover,
.terminal-overview-actions button.terminal-icon:focus-visible {
  background: var(--surface-2);
  color: var(--text);
}
.terminal-overview-actions button.terminal-icon:disabled {
  opacity: 0.4;
  background: none;
}
/* The launch dialog's own parts; its frame is the overview's. */
.output-panel.terminal-launch,
html.terminal-open .output-panel.terminal-launch {
  height: auto;
  overflow: auto;
  font-size: 13px;
}
.terminal-launch header button,
.terminal-launch-choices button,
.terminal-launch-commands button {
  padding: 3px 10px;
  font-size: 12px;
}
.terminal-launch-viewer {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
}
.terminal-launch-viewer:hover {
  border-color: var(--muted);
}
.terminal-launch-commands,
.terminal-launch-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.terminal-launch-choices {
  margin-top: 10px;
}
.terminal-launch-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 0;
}
.terminal-launch-details dt {
  color: var(--text-2);
}
.terminal-launch-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.terminal-launch-command {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-mono);
}
.terminal-launch-problem {
  color: var(--s-bad);
}
.terminal-launch-hint {
  color: var(--text-2);
}
.terminal-launch-open {
  align-self: center;
}

/* A shell in a project with none yet, under the cards. */
.terminal-overview-new {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.terminal-overview-new select {
  max-width: 320px;
  font-size: 12px;
}
.terminal-overview-new button {
  padding: 2px 8px;
  font-size: 12px;
}
.terminal-overview-new-note {
  color: var(--muted);
}
.terminal-overview-problem {
  margin: 0 0 8px;
  color: var(--s-bad);
}
.terminal-overview-problem[hidden] {
  display: none;
}
/* The button that chooses the shell; the box around it is its item's. */
.terminal-overview-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  min-height: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text);
  font-size: 12px;
  text-align: left;
}
.terminal-overview-card:hover,
.terminal-overview-card:focus-visible {
  background: var(--surface-2);
}
.terminal-overview-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.terminal-overview-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-overview-unseen .terminal-overview-name::before {
  content: "\2022\00a0";
  color: var(--s-run);
}
.terminal-overview-state {
  flex: none;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
/* A long path loses its start rather than its end, which is where the shell is. */
.terminal-overview-dir {
  overflow: hidden;
  color: var(--text-2);
  direction: rtl;
  font-family: var(--font-mono);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-overview-dir bdi {
  direction: ltr;
  unicode-bidi: isolate;
}
.terminal-overview-command {
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-overview-command::before {
  content: "\25b6\00a0";
  color: var(--s-run);
}
.terminal-overview-command[hidden] {
  display: none;
}
.terminal-overview-times {
  color: var(--muted);
  font-size: 11px;
}
.terminal-overview-times[hidden] {
  display: none;
}
.terminal-overview-command-unknown {
  color: var(--muted);
  font-style: italic;
}
.terminal-overview-command-unknown::before {
  content: none;
}
.terminal-overview-dir-unknown {
  color: var(--muted);
  font-style: italic;
}
/* web_shell.js places what is inside by position, so that no screen moves in the page. */
.terminal-panes {
  position: relative;
  flex: 1;
  min-height: 0;
}
.terminal-pane {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
/* Which pane the keys go to, in the theme's own focus colour. */
.terminal-panes-split .terminal-pane {
  border-top: 2px solid transparent;
}
.terminal-panes-split .terminal-pane-focused {
  border-top-color: var(--focus);
}
.terminal-split-handle {
  position: absolute;
  background: var(--line-soft);
  cursor: col-resize;
  touch-action: none;
}
.terminal-split-handle:hover,
.terminal-split-handle:focus-visible {
  background: var(--line);
  outline: none;
}
.terminal-split-handle-rows {
  cursor: row-resize;
}
.terminal-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 4px 0 0 6px;
  background: var(--terminal-background);
}
/* The line over the first row that keeps a scrolled command's line in sight; its mark sits
   in the gutter, as the prompt's does. */
.terminal-sticky {
  position: absolute;
  z-index: 6;
  top: 4px;
  left: 0;
  right: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding-left: 16px;
  overflow: hidden;
  border-bottom: 1px solid
    color-mix(in oklab, var(--terminal-bright-black) 60%, transparent);
  background: var(--terminal-background);
  color: var(--terminal-foreground);
  white-space: pre;
  cursor: pointer;
}
.terminal-sticky[hidden] {
  display: none;
}
.terminal-sticky:hover {
  background: color-mix(
    in oklab,
    var(--terminal-foreground) 8%,
    var(--terminal-background)
  );
}
.terminal-sticky-mark {
  position: absolute;
  left: 4px;
}
.terminal-sticky-command {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Blocks: a shell that marks its commands gets a gutter left of the text, where each
   prompt's mark says how its command ended, and a line between commands. */
.terminal-viewport.terminal-viewport-blocks {
  padding-left: 16px;
}
.xterm-screen .xterm-decoration-container .xterm-decoration.terminal-block {
  left: 0;
  pointer-events: none;
}
.terminal-block-separated::before {
  content: "";
  position: absolute;
  top: 0;
  left: -10px;
  right: 0;
  border-top: 1px solid var(--terminal-bright-black);
  opacity: 0.35;
}
.terminal-block-mark {
  position: absolute;
  top: 50%;
  left: -13px;
  box-sizing: border-box;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  pointer-events: auto;
  cursor: default;
}
.terminal-block-mark[hidden] {
  display: none;
}
.terminal-block-mark[data-state="ok"],
.terminal-commands-state[data-state="ok"] {
  background: var(--terminal-green);
}
.terminal-block-mark[data-state="failed"],
.terminal-commands-state[data-state="failed"] {
  background: var(--terminal-red);
}
.terminal-block-mark[data-state="running"],
.terminal-commands-state[data-state="running"] {
  background: var(--terminal-white);
}
.terminal-block-mark[data-state="unknown"],
.terminal-commands-state[data-state="unknown"] {
  border: 1.5px solid var(--terminal-white);
}
/* Copy command and Copy output, at the right of a prompt's line while the pointer is over its block. */
.terminal-block-actions {
  position: absolute;
  top: 0;
  right: 4px;
  display: flex;
  gap: 4px;
  height: 100%;
  pointer-events: auto;
}
.terminal-block-copy,
.terminal-block-copy-command,
.terminal-block-fold {
  box-sizing: border-box;
  height: 100%;
  padding: 0 6px;
  border: 1px solid var(--terminal-bright-black);
  border-radius: 3px;
  background: var(--terminal-background);
  color: var(--terminal-foreground);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
.terminal-block-actions[hidden],
.terminal-block-copy[hidden],
.terminal-block-copy-command[hidden],
.terminal-block-fold[hidden] {
  display: none;
}
/* The hovered command's buttons, at the pane's top right while its prompt is above the
   view; over the sticky line's right end when that shows. */
.terminal-block-actions.terminal-block-float {
  z-index: 7;
  top: 4px;
  right: 8px;
  height: 1.2em;
}
/* A prompt gone to from Commands is lit up for a moment. */
.terminal-block-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--terminal-selection);
  opacity: 0.6;
}
/* Commands, under the bar's button: each command's state, line, and end, and its copies. */
.terminal-commands-state {
  flex: none;
  box-sizing: border-box;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.terminal-dirs-actions.terminal-commands-actions button {
  width: auto;
  height: auto;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 11px;
  white-space: nowrap;
}
.terminal-dirs-actions.terminal-commands-actions button:disabled {
  opacity: 0.5;
}
/* A project's last run, under its name in All shells: its lifecycle in the run's tone, and
   its jobs in progress, pending, and failed, a zero dimmed. */
.terminal-overview-project-state {
  margin: -4px 0 6px;
  color: var(--muted);
  font-size: 11px;
}
.terminal-overview-project-state[hidden] {
  display: none;
}
.terminal-overview-project-state-error {
  color: var(--s-bad);
}
.terminal-overview .terminal-overview-project-state-run {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  text-align: left;
  white-space: normal;
}
.terminal-overview button.terminal-overview-project-state-run {
  cursor: pointer;
}
.terminal-overview
  button.terminal-overview-project-state-run:hover
  .terminal-overview-project-state-lifecycle,
.terminal-overview
  button.terminal-overview-project-state-run:focus-visible
  .terminal-overview-project-state-lifecycle {
  text-decoration: underline;
}
.terminal-overview-project-state-run
  .terminal-overview-project-state-lifecycle::before {
  content: "\25cf\00a0";
}
.terminal-overview-project-state-run.tone-ok
  .terminal-overview-project-state-lifecycle::before {
  color: var(--s-ok);
}
.terminal-overview-project-state-run.tone-bad
  .terminal-overview-project-state-lifecycle::before,
.terminal-overview-project-state-count.tone-bad {
  color: var(--s-bad);
}
.terminal-overview-project-state-run.tone-run
  .terminal-overview-project-state-lifecycle::before,
.terminal-overview-project-state-count.tone-run {
  color: var(--s-run);
}
.terminal-overview-project-state-run.tone-warn
  .terminal-overview-project-state-lifecycle::before {
  color: var(--s-warn);
}
.terminal-overview-project-state-run.tone-off
  .terminal-overview-project-state-lifecycle::before {
  color: var(--muted);
}
.terminal-overview-project-state-none {
  color: var(--muted);
  opacity: 0.7;
}

/* The Explorer: a column at the left of the panel's body, beside the panes. */
.terminal-body {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}
.terminal-body .terminal-panes {
  min-width: 0;
}
.terminal-explorer {
  position: relative;
  display: flex;
  flex: none;
  flex-direction: column;
  width: var(--terminal-explorer-width, 260px);
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-sunken);
  color: var(--text);
  font-size: 12.5px;
}
.terminal-explorer[hidden] {
  display: none;
}
.terminal-explorer-head {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px 2px 10px;
}
.terminal-explorer-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-explorer button.terminal-icon,
.terminal-bar button.terminal-explorer-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 3px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-2);
}
.terminal-explorer button.terminal-icon:hover,
.terminal-explorer button[aria-pressed="true"],
.terminal-bar button.terminal-explorer-toggle[aria-pressed="true"],
.terminal-bar button.terminal-project-link[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text);
}
.terminal-explorer button[aria-pressed="true"],
.terminal-bar button.terminal-explorer-toggle[aria-pressed="true"],
.terminal-bar button.terminal-project-link[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px var(--line);
}
.terminal-explorer-where {
  overflow: hidden;
  padding: 0 10px 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-explorer-where {
  cursor: pointer;
}
.terminal-explorer-where:hover,
.terminal-explorer-where:focus-visible {
  color: var(--text);
}
/* Recent directories, under the bar's button or the Explorer's path. */
.terminal-dirs {
  position: fixed;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 16px));
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  font-size: 12px;
}
.terminal-dirs-filter {
  flex: none;
  margin: 6px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}
.terminal-dirs-pickers {
  display: flex;
  flex: none;
  gap: 6px;
  margin: 0 6px 6px;
}
.terminal-dirs-pickers[hidden] {
  display: none;
}
.terminal-dirs-project {
  flex: 1 1 0;
  min-width: 0;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}
.terminal-dirs-project[hidden] {
  display: none;
}
.terminal-dirs-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 4px 4px;
}
.terminal-dirs-heading {
  padding: 6px 6px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.terminal-dirs-empty {
  padding: 2px 6px 4px;
  color: var(--muted);
}
.terminal-dirs-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 3px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.terminal-dirs-row[aria-selected="true"],
.terminal-dirs-row:hover:not([aria-disabled="true"]) {
  background: var(--line);
}
.terminal-dirs-row[aria-disabled="true"] {
  cursor: default;
  color: var(--muted);
}
.terminal-dirs-path {
  overflow: hidden;
  flex: 1;
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-dirs-detail {
  overflow: hidden;
  max-width: 45%;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-dirs-actions {
  display: flex;
  gap: 2px;
}
.terminal-dirs-actions button {
  width: 22px;
  height: 22px;
  padding: 3px;
  border: 0;
  background: none;
  color: var(--muted);
}
.terminal-dirs-actions button:hover {
  color: var(--text);
}
.terminal-dirs-actions svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
}
.terminal-explorer-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 4px 4px;
}
.terminal-explorer-tree:focus {
  outline: none;
}
.terminal-explorer-row {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 4px 0 calc(4px + var(--level, 0) * 14px);
  border-radius: 3px;
  white-space: nowrap;
  cursor: default;
}
.terminal-explorer-row:hover {
  background: var(--surface-2);
}
.terminal-explorer-row[aria-selected="true"] {
  background: var(--highlight);
  box-shadow: inset 2px 0 0 var(--focus);
}
.terminal-explorer-row:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: -1px;
}
.terminal-explorer-chevron,
.terminal-explorer-kind {
  display: inline-flex;
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--muted);
}
/* A file category colours what carries data-category: the Explorer's icons
   and the artifact listings. */
[data-category="dir"] {
  --category-color: var(--c3);
}
[data-category="table"] {
  --category-color: var(--c1);
}
[data-category="image"] {
  --category-color: var(--c7);
}
[data-category="text"] {
  --category-color: var(--c4);
}
[data-category="structured"] {
  --category-color: var(--c6);
}
[data-category="code"] {
  --category-color: var(--c5);
}
[data-category="archive"] {
  --category-color: var(--c2);
}
.terminal-explorer-kind[data-category] {
  color: var(--category-color);
}
.terminal-explorer-chevron svg,
.terminal-explorer-kind svg,
.terminal-explorer-actions svg {
  width: 14px;
  height: 14px;
}
.terminal-explorer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.terminal-explorer-link .terminal-explorer-name {
  font-style: italic;
}
.terminal-explorer-target {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
}
/* A control character in a name, shown as its escape. */
.terminal-explorer-escape {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--s-warn-bg);
  color: var(--s-warn);
  font-family: var(--font-mono);
  font-size: 11px;
}
.terminal-explorer-unnamed .terminal-explorer-name {
  color: var(--muted);
}
.terminal-explorer-actions {
  display: none;
  flex: none;
  gap: 2px;
  margin-left: auto;
}
.terminal-explorer-row:hover .terminal-explorer-actions,
.terminal-explorer-row[aria-selected="true"] .terminal-explorer-actions {
  display: flex;
}
.terminal-explorer .terminal-explorer-actions button.terminal-icon {
  padding: 2px;
}
.terminal-explorer-note {
  padding: 3px 4px 3px calc(22px + var(--level, 0) * 14px);
  color: var(--muted);
  font-size: 12px;
}
.terminal-explorer-problem {
  color: var(--s-bad);
}
.terminal-explorer-more,
.terminal-explorer-follow-link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.terminal-explorer-footer {
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
  padding: 4px 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.terminal-explorer-footer .terminal-explorer-follow-link {
  margin-left: auto;
}
.terminal-explorer-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  z-index: 12;
  width: 6px;
  cursor: col-resize;
  touch-action: none;
}
.terminal-explorer-resizer:hover,
.terminal-explorer-resizer:focus-visible {
  background: var(--line);
  outline: none;
}
/* Where a path dragged from the Explorer would go. */
.terminal-pane-drop {
  box-shadow: inset 0 0 0 2px var(--focus);
}
/* A folder, or the tree's empty part, that a dragged row would move into. */
.terminal-explorer-row.terminal-explorer-drop,
.terminal-explorer-tree.terminal-explorer-drop {
  background: var(--highlight);
  box-shadow: inset 0 0 0 1px var(--focus);
}
/* Cut, waiting to be pasted. */
.terminal-explorer-cut {
  opacity: 0.55;
}
/* How far an upload has come. */
.terminal-explorer-progress {
  flex: none;
  width: 72px;
  height: 6px;
  margin-left: auto;
  accent-color: var(--focus);
}

/* The line that stands for a folded output's middle unfolds it when clicked. */
.terminal-fold {
  cursor: pointer;
  pointer-events: auto;
}
.terminal-fold:hover {
  background: color-mix(in oklab, var(--accent) 14%, transparent);
}

/* Sticky notes, on the application pages and the Recent jobs page. */
#sticky-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
#sticky-layer[hidden] {
  display: none;
}
.sticky-note {
  --sticky-bg: var(--sticky-yellow);
  position: fixed;
  display: flex;
  flex-direction: column;
  width: 220px;
  height: 160px;
  border: 1px solid var(--sticky-edge);
  border-radius: 3px;
  background: var(--sticky-bg);
  color: var(--sticky-ink);
  box-shadow: 0 3px 10px var(--sticky-shadow);
  pointer-events: auto;
  overflow: hidden;
}
.sticky-pink {
  --sticky-bg: var(--sticky-pink);
}
.sticky-green {
  --sticky-bg: var(--sticky-green);
}
.sticky-blue {
  --sticky-bg: var(--sticky-blue);
}
.sticky-orange {
  --sticky-bg: var(--sticky-orange);
}
.sticky-error {
  outline: 2px solid var(--sticky-error);
}
.sticky-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  padding: 0 4px;
  background: var(--sticky-head);
  cursor: grab;
  touch-action: none;
}
.sticky-head button {
  min-height: 0;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: inherit;
  line-height: 18px;
  cursor: pointer;
}
.sticky-color::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px solid var(--sticky-ink);
  border-radius: 50%;
  background: var(--sticky-bg);
}
.sticky-text {
  flex: 1;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  resize: none;
  box-sizing: border-box;
}

/* Its own classes, not the Settings menu's: web_shell.js closes the Settings
   menu on a click outside the first .settings-menu of the page. */
.stickies-menu {
  position: relative;
}
.stickies-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  width: 320px;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.stickies-panel[hidden] {
  display: none;
}
.stickies-actions {
  display: flex;
  gap: 6px;
}
.stickies-search {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
}
.stickies-list {
  display: flex;
  max-height: 50vh;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.stickies-empty {
  padding: 6px;
  color: var(--text-2);
  font-size: 12px;
}
.stickies-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 8px;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
}
.stickies-item:hover,
.stickies-item:focus-visible {
  background: var(--surface-2);
}
.stickies-item-time {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.stickies-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stickies-item-page {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stickies-row {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}
.stickies-row .stickies-item {
  min-width: 0;
  flex: 1;
}
.stickies-item-remove {
  flex: none;
  min-height: 0;
  padding: 2px 6px;
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
}
.sticky-grip {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 12px;
  height: 12px;
  background: linear-gradient(
    135deg,
    transparent 45%,
    var(--sticky-ink) 45%,
    var(--sticky-ink) 55%,
    transparent 55%,
    transparent 70%,
    var(--sticky-ink) 70%,
    var(--sticky-ink) 80%,
    transparent 80%
  );
  opacity: 0.55;
  cursor: nwse-resize;
  touch-action: none;
}
.sticky-pin {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border: 1px solid var(--sticky-ink);
  border-radius: 50%;
  vertical-align: middle;
}
.sticky-pin-yellow {
  background: var(--sticky-yellow);
}
.sticky-pin-pink {
  background: var(--sticky-pink);
}
.sticky-pin-green {
  background: var(--sticky-green);
}
.sticky-pin-blue {
  background: var(--sticky-blue);
}
.sticky-pin-orange {
  background: var(--sticky-orange);
}
.sticky-pin-below {
  opacity: 0.45;
  background: transparent;
}
