:root {
  --bg: #fafafb;
  --surface: #ffffff;
  --border: #ecedf0;
  --border-strong: #e3e5ea;
  --ink: #0f1115;
  --muted: #6b7080;
  /* Operate brand, same values as resources/css/tokens.css */
  --accent: #024ccb;
  --accent-hover: #023fa6;
  --accent-ink: #022a73;
  --accent-soft: #e4ebfd;
  --accent-mid: #8eacff;
  --accent-ring: #c3d3fa;
  --hover: #f4f6fa;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --bad: #b42318;
  --bad-soft: #fef2f2;
  --prod: #c2410c;
  --prod-soft: #fff1e8;
  --log-bg: #0f1115;
  --log-ink: #d7dce3;
  --radius: 12px;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

button {
  font: inherit;
  color: inherit;
}

.mono {
  font-family: var(--mono);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Layout */
.shell {
  display: flex;
  min-height: 100%;
}

.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
}

.brand__logo {
  height: 16px;
  width: auto;
}

.brand__tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 6px;
}

.nav,
#nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__label {
  font-size: 12px;
  color: var(--muted);
  padding: 0 8px 6px;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}

.nav__item:hover {
  background: var(--hover);
}

.nav__item[aria-current="true"] {
  background: var(--accent-soft);
}

.nav__item[aria-current="true"] .nav__name {
  color: var(--accent-ink);
}

/* Repositories in the sidebar, each opening its environments */
.repo {
  display: flex;
  flex-direction: column;
}

.repo__head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}

.repo__head:hover {
  background: var(--hover);
}

.repo__head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.repo__chev {
  display: grid;
  color: var(--muted);
  transition: transform 0.2s var(--ease);
}

.repo__head[aria-expanded="true"] .repo__chev {
  transform: rotate(90deg);
}

.repo__icon {
  display: grid;
  color: var(--muted);
}

.repo__name {
  flex-grow: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo__count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.repo__envs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 6px 14px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
  animation: rise 0.2s var(--ease);
}

.repo__envs[hidden] {
  display: none;
}

.repo__empty {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}

.nav__foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.nav__item--settings {
  min-height: 38px;
  color: var(--ink);
}

.nav__item--settings svg {
  color: var(--muted);
}

/* Fixed column so the badges and clocks line up across rows. */
.nav__badge {
  display: flex;
  justify-content: flex-end;
  min-width: 64px;
  flex-shrink: 0;
}

.nav__item:focus-visible,
.btn:focus-visible,
.link-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav__text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.nav__name {
  font-weight: 600;
}

.nav__branch {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pill--new {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.pill--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill--bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.running-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.user {
  margin-top: auto;
  position: relative;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.user__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}

.user__btn:hover,
.user__btn[aria-expanded="true"] {
  background: var(--hover);
}

.user__btn:focus-visible,
.menu__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.user__name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user__chev {
  color: var(--muted);
  flex-shrink: 0;
}

.menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 17, 21, 0.12);
  transform-origin: bottom center;
  animation: menu-in 0.16s var(--ease);
}

.menu[hidden] {
  display: none;
}

/* The top bar's menu hangs below the avatar, right-aligned. */
.menu--down {
  left: auto;
  right: 0;
  bottom: auto;
  top: calc(100% + 8px);
  width: min(280px, calc(100vw - 32px));
  transform-origin: top right;
}

/* Phones only: top bar with the drawer button and profile menu */
.topbar {
  display: none;
}

.scrim {
  display: none;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.crumb:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.menu__head {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.menu__name {
  font-weight: 600;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.12s var(--ease);
}

.menu__item:hover {
  background: var(--hover);
  color: var(--ink);
}

.menu__item svg {
  color: var(--muted);
}

.menu__note {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

.menu__item--bad,
.menu__item--bad svg,
.menu__item--bad:hover {
  color: var(--bad);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}

.avatar--grey {
  background: #f3f4f6;
  color: #3b3f4a;
}

.user__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-grow: 1;
}

.user__email {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main--enter > * {
  animation: rise 0.32s var(--ease) both;
}

.main--enter > :nth-child(2) {
  animation-delay: 40ms;
}

.main--enter > :nth-child(3) {
  animation-delay: 80ms;
}

.main--enter > :nth-child(4) {
  animation-delay: 120ms;
}

.main--enter > :nth-child(n + 5) {
  animation-delay: 160ms;
}

.main {
  flex-grow: 1;
  min-width: 0;
  padding: 32px 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1100px;
}

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.head__title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.head__site {
  color: var(--muted);
  text-decoration: none;
}

.head__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}

.btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(2, 76, 203, 0.2);
}

.btn:active:not([disabled]) {
  transform: scale(0.97);
}

.btn--prod {
  background: var(--prod);
}

.btn--prod:hover {
  background: #9a3412;
  box-shadow: 0 2px 8px rgba(194, 65, 12, 0.2);
}

.btn--quiet {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}

.btn--quiet:hover {
  background: var(--hover);
  box-shadow: none;
}

.btn[disabled] {
  box-shadow: none;
  cursor: default;
  background: #f4f5f7;
  color: var(--muted);
  border: 1px solid var(--border-strong);
}

.btn--busy[disabled] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 0;
}

.link-btn {
  white-space: nowrap;
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s var(--ease);
}

.link-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn--quiet {
  color: var(--muted);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.stat__label {
  font-size: 12px;
  color: var(--muted);
}

.stat__value {
  font-size: 18px;
  font-weight: 600;
}

.stat__value.mono {
  font-weight: 500;
}

/* Only as wide as the commit, not the whole card. */
.stat__link {
  align-self: flex-start;
  color: inherit;
  text-decoration: none;
}

.stat__link:hover {
  color: var(--accent);
}

.stat__note {
  font-size: 12px;
  color: var(--muted);
}

.ok {
  color: var(--ok);
}

.bad {
  color: var(--bad);
}

.head__source {
  font-size: 12px;
  color: var(--muted);
}

/* Settings */
.settings-card {
  padding: 4px 20px 12px;
}

.settings-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 10px;
}

.settings-card__head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.settings-card__note {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  max-width: 60ch;
}

.settings-group {
  margin-top: 10px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.settings-empty {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #f3f4f6;
  flex-wrap: wrap;
}

.env-row .setting-row {
  border-top: 0;
  padding-bottom: 6px;
}

.env-row {
  border-top: 1px solid #f3f4f6;
}

.setting-row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 220px;
  min-width: 0;
}

.setting-row__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.setting-row__link {
  color: var(--ink);
  text-decoration: none;
}

.setting-row__link:hover {
  color: var(--accent);
}

.setting-row__id {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 5px;
}

.setting-row__meta {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.setting-row__actions {
  display: flex;
  gap: 14px;
}

.link-btn--danger {
  color: var(--bad);
}

.link-btn--danger:hover {
  color: #8f1d14;
}

.link-btn[disabled] {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
  opacity: 0.6;
}

.env-row__setup {
  margin: 0 0 12px 20px;
  font-size: 12px;
  color: var(--muted);
}

.env-row__setup summary {
  cursor: pointer;
  width: fit-content;
}

.env-row__setup p {
  margin: 8px 0 4px;
}

.code {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--log-bg);
  color: var(--log-ink);
  font: 12px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.inline-form {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.input {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 13px var(--mono);
  min-width: 0;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.inline-form .input {
  flex: 1 1 auto;
  max-width: 360px;
}

.input:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input[disabled] {
  background: #f4f5f7;
  color: var(--muted);
}

.form-dialog {
  width: min(620px, calc(100vw - 32px));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field label {
  font-size: 12px;
  font-weight: 600;
}

.field__hint {
  font-size: 11px;
  color: var(--muted);
}

.check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.form-error {
  margin: 0;
  padding: 10px 24px;
  background: var(--bad-soft);
  color: #7f1d1d;
  font-size: 13px;
}

.source-select {
  min-width: 260px;
  padding-right: 32px;
  cursor: pointer;
}

.source-select[disabled] {
  cursor: default;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #f3f4f6;
}

.segmented__item {
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--mono);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.segmented__item:hover:not([disabled]) {
  color: var(--ink);
}

.segmented__item[aria-checked="true"] {
  background: var(--surface);
  color: var(--accent-ink);
  box-shadow: 0 1px 3px rgba(15, 17, 21, 0.12);
}

.segmented__item[disabled] {
  cursor: default;
}

.segmented__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Running */
.run {
  border-color: var(--accent-ring);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.run__top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.run__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
  min-width: 0;
}

.run__title {
  font-weight: 600;
  font-size: 15px;
}

.run__clock {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--accent-ink);
  letter-spacing: -0.02em;
}

.run__step {
  animation: fade-in 0.3s var(--ease);
}

.run__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
}

.run__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-mid), var(--accent));
  background-size: 200% 100%;
  animation: slide 1.6s linear infinite;
  transition: width 0.8s var(--ease);
}

.run__bar--open .run__fill {
  width: 40%;
  animation: sweep 1.4s var(--ease) infinite;
}

.run__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent-ring);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}

.spinner--lg {
  width: 28px;
  height: 28px;
  border-width: 3px;
  border-color: var(--accent-soft);
  border-top-color: var(--accent);
}

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
}

.banner--ok {
  background: var(--ok-soft);
  color: #14532d;
}

.banner--bad {
  background: var(--bad-soft);
  color: #7f1d1d;
}

/* Lists */
.list {
  padding: 8px 20px 12px;
}

.list h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.list__total {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f3f4f6;
  padding: 1px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.list__foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0 4px;
  border-top: 1px solid #f3f4f6;
}

.list__count {
  margin-right: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  margin: 0 -8px;
  border-top: 1px solid #f3f4f6;
  border-radius: 8px;
  transition: background-color 0.15s var(--ease);
}

.is-new {
  animation: rise 0.3s var(--ease) both;
}

.row:hover {
  background: #fafbfc;
}

.row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
  min-width: 0;
}

.row__msg {
  overflow-wrap: anywhere;
}

.row__meta {
  font-size: 12px;
  color: var(--muted);
}

.row__sha {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.ticket {
  font-weight: 600;
  text-decoration: none;
  margin-right: 4px;
}

.empty {
  margin: 8px 0 12px;
  color: var(--muted);
}

/* Log drawer and confirm dialog */
dialog {
  border: 0;
  padding: 0;
  border-radius: 16px;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(15, 17, 21, 0.25);
}

dialog::backdrop {
  background: rgba(15, 17, 21, 0.45);
  animation: fade-in 0.2s var(--ease);
}

dialog[open] {
  animation: pop-in 0.22s var(--ease);
}

.log-dialog {
  width: min(960px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
  background: var(--log-bg);
}

.log-dialog[open] {
  display: flex;
  flex-direction: column;
}

.log-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #1e2129;
  color: #c7cad4;
}

.log-dialog__head .btn--quiet {
  background: #1c1f27;
  border-color: #2a2e38;
  color: #e5e7eb;
}

.log-dialog__head .btn--quiet:hover {
  background: #262a34;
}

.log {
  flex-grow: 1;
  overflow: auto;
  margin: 0;
  padding: 14px 18px;
  font: 12.5px/1.75 var(--mono);
  color: var(--log-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log .step {
  color: #93b4ff;
}

.log .err {
  color: #f87171;
}

.confirm-dialog {
  width: min(520px, calc(100vw - 32px));
  background: var(--surface);
}

.confirm-dialog form {
  display: flex;
  flex-direction: column;
}

.confirm__section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.confirm__section h2 {
  margin: 0;
  font-size: 19px;
}

.confirm__section input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font: 15px var(--mono);
}

.confirm__section input:focus {
  outline: 2px solid var(--prod);
  outline-offset: 0;
  border-color: var(--prod);
}

.confirm__actions {
  padding: 16px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 17, 21, 0.25);
  animation: toast-in 0.25s var(--ease);
}

.toast--out {
  animation: toast-out 0.2s var(--ease) forwards;
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.notice--error {
  background: var(--bad-soft);
  color: #7f1d1d;
}

/* Sign-in */
.signin {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}

.signin__card {
  width: min(400px, 100%);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.signin__logo {
  height: 18px;
  width: auto;
  align-self: flex-start;
}

.signin__card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}

.signin__card p {
  margin: 0;
  color: var(--muted);
}

.ms-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  transition: background-color 0.15s var(--ease);
  border: 1px solid #8c8c8c;
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.ms-btn:hover {
  background: #f6f7f9;
  color: var(--ink);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slide {
  to {
    background-position: -200% 0;
  }
}

@keyframes sweep {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(250%);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  dialog::backdrop {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }

  .spinner,
  .run__fill {
    animation-duration: 3s !important;
  }
}

@media (max-width: 760px) {
  /* Text follows the screen width: 12.5px on a small phone up to 14px. */
  html,
  body {
    font-size: clamp(12.5px, 3.5vw, 14px);
  }

  .head h1 {
    font-size: clamp(20px, 6vw, 26px);
  }

  .stat__value {
    font-size: clamp(15px, 4.4vw, 18px);
  }

  .run__clock {
    font-size: clamp(18px, 6vw, 26px);
  }

  .run__title,
  .settings-card__head h2 {
    font-size: clamp(13px, 3.8vw, 15px);
  }

  .btn,
  .link-btn,
  .menu__item,
  .segmented__item,
  .input {
    font-size: clamp(12px, 3.4vw, 13px);
  }

  .hint,
  .row__meta,
  .row__sha,
  .stat__label,
  .stat__note,
  .setting-row__meta,
  .settings-card__note,
  .nav__branch,
  .list__count,
  .pill {
    font-size: clamp(10.5px, 3vw, 12px);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  .topbar__menu,
  .topbar__avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s var(--ease);
  }

  .topbar__menu:hover,
  .topbar__avatar:hover,
  .topbar__avatar[aria-expanded="true"] {
    background: var(--hover);
  }

  .topbar__menu:focus-visible,
  .topbar__avatar:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .topbar__user {
    position: relative;
    margin-left: auto;
  }

  /* Three lines that turn into an X while the drawer is open. */
  .burger {
    position: relative;
    width: 18px;
    height: 14px;
  }

  .burger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 0.3s var(--ease), opacity 0.2s var(--ease), top 0.3s var(--ease);
  }

  .burger span:nth-child(1) {
    top: 0;
  }

  .burger span:nth-child(2) {
    top: 6px;
  }

  .burger span:nth-child(3) {
    top: 12px;
  }

  .drawer-open .burger span:nth-child(1) {
    top: 6px;
    transform: rotate(45deg);
  }

  .drawer-open .burger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.3);
  }

  .drawer-open .burger span:nth-child(3) {
    top: 6px;
    transform: rotate(-45deg);
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 25;
    width: min(300px, 86vw);
    height: auto;
    padding: 16px 14px;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(15, 17, 21, 0.18);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }

  .drawer-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.3s var(--ease), visibility 0s;
  }

  .sidebar .brand,
  .sidebar .user {
    display: none;
  }

  .scrim {
    position: fixed;
    inset: 56px 0 0;
    z-index: 20;
    display: block;
    background: rgba(15, 17, 21, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }

  .drawer-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .drawer-open {
    overflow: hidden;
  }

  .main {
    padding: 20px 16px 40px;
  }

  .stats,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

    .source-select {
    width: 100%;
    min-width: 0;
  }

  /* Add repository: input on one line, button under it. */
  .inline-form {
    flex-direction: column;
  }

  .inline-form .input {
    max-width: none;
    min-height: 38px;
  }

  .inline-form .btn {
    width: 100%;
  }

  .setting-row__text {
    flex: 1 1 120px;
  }

  .settings-card__head {
    flex-direction: column;
  }

  .head__actions {
    align-items: stretch;
    width: 100%;
  }
}
