:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1d212a;
  --border: #272c38;
  --text: #e6e9ef;
  --muted: #8d97a8;
  --accent: #d97757;
  --accent-soft: rgba(217, 119, 87, 0.14);
  /* Text laid on the accent. The Server Color setting turns it white for a dark pick. */
  --accent-ink: #1b1207;
  --green: #4ec98a;
  --red: #f0716a;
  --amber: #e5b95c;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
  /* The server's color across the top, so which server this is shows before anything is read. */
  box-shadow: inset 0 3px 0 var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  flex: none;
  white-space: nowrap;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

/* Offers an update without taking one: amber, and a link to the Settings page. */
.badge-update {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(229, 185, 92, 0.4);
  color: var(--amber);
  background: rgba(229, 185, 92, 0.08);
  text-decoration: none;
  white-space: nowrap;
}

.badge-update:hover {
  background: rgba(229, 185, 92, 0.16);
}

.badge-update::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Beats the display above, which would otherwise defeat the hidden attribute. */
.badge-update[hidden] {
  display: none;
}

/*
 * Subscription usage: one small meter per limit window the account reports.
 * Severity comes from the API rather than a threshold picked here, so the
 * colours match what the CLI's own usage view shows.
 */
.usage {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Meters hold their width rather than squeezing into each other. When the
     header runs out of room a whole group is dropped instead, below. */
  flex: none;
}

.usage[hidden] {
  display: none;
}

.usage-meter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 62px;
  cursor: help;
}

.usage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}

.usage-pct {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.usage-track {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--green);
  transition: width 240ms ease;
}

.usage-meter.warning .usage-fill {
  background: var(--amber);
}

.usage-meter.warning .usage-pct {
  color: var(--amber);
}

.usage-meter.critical .usage-fill {
  background: var(--red);
}

.usage-meter.critical .usage-pct {
  color: var(--red);
}

/* The clock ahead of the meters, hovered for when the reading was pulled. */
.usage-stamp {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--muted);
  cursor: help;
}

.usage-stamp.stale {
  color: var(--amber);
}

/* Last-known numbers, dimmed: the server is serving its previous lookup. */
.usage-meter.stale {
  opacity: 0.55;
}

/* Same tooltip treatment as the cron field, anchored under the header instead. */
.usage-meter::after,
.usage-stamp::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: 260px;
  white-space: pre-line;
  text-align: left;
  background: #0b0d12;
  color: var(--text);
  border: 1px solid #3a4152;
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 11.5px;
  line-height: 1.45;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 90ms ease;
  z-index: 20;
}

/* The clock is the leftmost thing here, so its tooltip opens rightwards. */
.usage-stamp::after {
  right: auto;
  left: 0;
}

.usage-meter:hover::after,
.usage-stamp:hover::after {
  opacity: 1;
}

/*
 * The bell, and the count of what has not been read. The badge sits on the
 * button's corner, so it has to escape the button's box.
 */
.btn.bell {
  position: relative;
  overflow: visible;
}

.bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.bell-badge[hidden] {
  display: none;
}

/*
 * The notification drawer. It slides rather than appearing so it is obvious
 * where it came from, and it is never removed from the page — `visibility`
 * waits out the slide instead, which keeps it off the tab order while closed.
 */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 40px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 200ms ease, visibility 0s linear 200ms;
}

.drawer.open {
  transform: none;
  visibility: visible;
  transition: transform 200ms ease;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
}

.drawer-head h2 {
  margin: 0;
}

/* The filter and the mark-all button, under the title and above the list. */
.drawer-tools {
  display: flex;
  gap: 8px;
  padding: 10px 18px 0;
}

.drawer-sub {
  margin: 6px 18px 12px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  outline: none;
}

.drawer-empty {
  padding: 24px 18px;
  color: var(--muted);
  font-size: 13px;
}

/* Watched by the observer that pulls the next twenty in. */
.drawer-sentinel {
  height: 1px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 0s linear 200ms;
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease;
}

.note {
  display: flex;
  gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
}

/*
 * A notification that lands while the drawer is open slides in from the edge
 * it came from, so a list that changes under the reader says that it changed.
 */
.note.arriving {
  animation: note-in 220ms ease-out;
}

@keyframes note-in {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .drawer.open {
    transition: visibility 0s;
  }
  .note.arriving {
    animation: none;
  }
}

.note.linked {
  cursor: pointer;
}

.note.linked:hover {
  background: var(--panel-2);
}

/* Unread carries the accent edge; read is the same row without the emphasis. */
.note.unread {
  background: rgba(217, 119, 87, 0.06);
  box-shadow: inset 2px 0 0 var(--accent);
}

.note-dot {
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.note-dot.warn {
  background: var(--amber);
}

.note-dot.bad {
  background: var(--red);
}

.note-body {
  min-width: 0;
}

.note-message {
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.note.unread .note-message {
  font-weight: 600;
}

.note-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/*
 * Running jobs: the leftmost meter, and the only one about the app's own work
 * rather than the machine or the account. It carries the same rule the machine
 * group does so the three groups read as three.
 */
.usage.jobs {
  padding-right: 14px;
  border-right: 1px solid var(--border);
}

.jobs-meter {
  min-width: 82px;
}

.jobs-meter .usage-fill {
  background: var(--accent);
}

/* The text tooltip is for the usage meters; this one carries a panel instead. */
.jobs-meter::after {
  display: none;
}

/*
 * The panel under the jobs meter. Width follows the longest row so the numbers
 * sit against the right edge whatever they read.
 */
.jobs-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  min-width: 150px;
  background: #0b0d12;
  border: 1px solid #3a4152;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 90ms ease;
  z-index: 20;
  cursor: default;
}

.jobs-meter:hover .jobs-pop {
  opacity: 1;
}

.jobs-pop-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.jobs-pop-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* What is running now, above; what is merely armed, below. */
.jobs-pop-rule {
  margin: 6px 0;
  border-top: 1px solid var(--border);
}

/*
 * Machine stats: the same meter as above, drawn from this computer rather than
 * the account, and separated from the subscription ones by a rule so the two
 * groups do not read as one row of eight.
 */
.usage.system {
  gap: 14px;
  padding-right: 14px;
  border-right: 1px solid var(--border);
}

.system-meter {
  min-width: 76px;
}

/* The text tooltip above is for the usage meters; these carry a chart instead. */
.system-meter::after {
  display: none;
}

.system-meter .usage-fill {
  background: var(--accent);
}

/*
 * The chart, under the meter on hover. Fixed width so the SVG's viewBox and the
 * box it is drawn in agree, which is what keeps the line from stretching.
 */
.metric-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 252px;
  background: #0b0d12;
  border: 1px solid #3a4152;
  border-radius: 8px;
  padding: 9px 11px 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 90ms ease;
  z-index: 20;
  cursor: default;
}

.system-meter:hover .metric-pop {
  opacity: 1;
}

.pop-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

/* What the top of the chart is worth, which a rate needs and a percentage says anyway. */
.spark-top {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pop-sub {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.spark {
  display: block;
  width: 228px;
  height: 52px;
  margin: 8px 0 2px;
  overflow: visible;
}

.spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.spark-area {
  fill: var(--accent-soft);
  stroke: none;
}

.pop-axis {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

.pop-stats {
  display: flex;
  gap: 14px;
  margin: 8px 0 0;
}

.pop-stats div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pop-stats dt {
  font-size: 10px;
  color: var(--muted);
}

.pop-stats dd {
  margin: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pop-detail {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pop-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--amber);
}

.pop-detail[hidden],
.pop-note[hidden] {
  display: none;
}

/*
 * The header runs out of room from the left: the machine meters go first, the
 * subscription ones next, since the second group is about the account and stays
 * useful on a laptop screen.
 */
@media (max-width: 1160px) {
  .usage.system {
    display: none;
  }
}

/* The meters are the first thing to go when the header runs out of room. */
@media (max-width: 900px) {
  .usage {
    display: none;
  }
}

.conn {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.conn.live {
  color: var(--green);
  border-color: rgba(78, 201, 138, 0.4);
}

.conn.down {
  color: var(--red);
  border-color: rgba(240, 113, 106, 0.4);
}

/* Connected, but the server has moved to newer code than this page. */
.conn.stale {
  color: var(--amber);
  border-color: rgba(229, 185, 92, 0.5);
  background: rgba(229, 185, 92, 0.1);
  cursor: help;
}

/*
 * Wide enough that the date columns keep a time on one line. A run's "Sep 23,
 * 3:00:00 AM" breaking after the comma, or worse before the AM, was the whole
 * reason this is not 1080px.
 */
.view {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 22px 64px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* Pause control and New cron sit together, and wrap as a pair on a phone. */
.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Sized to its own content rather than filling the row like a form select. */
.select.pause-select {
  flex: 0 0 auto;
  width: auto;
  padding: 8px 10px;
}

h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

h2 {
  font-size: 16px;
  margin: 0 0 10px;
}

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

.btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: #3a4152;
  background: #232834;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.btn.primary:hover {
  filter: brightness(1.08);
}

.btn.danger {
  color: var(--red);
  border-color: rgba(240, 113, 106, 0.4);
}

.btn.danger:hover {
  background: rgba(240, 113, 106, 0.12);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn.small {
  padding: 5px 10px;
  font-size: 12px;
}

/*
 * Icon only. The glyph carries the meaning on its own, so it takes the room the
 * label used to, and the name it answers to lives in title and aria-label.
 */
.btn.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

/* The two home tabs. A row of links rather than buttons, so each is a real URL
   that can be opened, bookmarked and reloaded. */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  /* Sits on the container's border so the selected tab can cover it. */
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.tab.selected {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
  border-bottom: 1px solid var(--panel);
  box-shadow: inset 0 2px 0 var(--accent);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* The foot of the one-time list: one more page, and how far down you are. */
.load-more {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 600;
  background: var(--panel-2);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.cron-name {
  font-weight: 600;
}

.cron-desc {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/*
 * A description is two lines on the page and the whole thing in the tooltip.
 * Some of them are a paragraph, and a paragraph in a table cell makes one row
 * three times the height of its neighbours.
 */
.cron-desc.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 560px;
  cursor: help;
}

/* Dates and countdowns read as one thing; a wrap splits "3:00:00 AM" in two. */
.time-cell {
  white-space: nowrap;
}

/* A next run time that could start late: the warning in front, the reason on hover. */
.delay-risk {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: help;
}

.delay-risk svg {
  display: block;
  color: var(--amber);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.pill .led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.pill.active {
  color: var(--green);
  border-color: rgba(78, 201, 138, 0.35);
}

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

.pill.running {
  color: var(--amber);
  border-color: rgba(229, 185, 92, 0.4);
}

.pill.running .led {
  animation: pulse 1.1s ease-in-out infinite;
}

/* Held by a pause: distinct from deactivated, which is the cron's own setting. */
.pill.held {
  color: var(--accent);
  border-color: rgba(217, 119, 87, 0.4);
}

/* Waiting on a usage limit. Amber like a live run because something is pending,
   dashed because nothing is actually executing yet. */
.pill.delayed {
  color: var(--amber);
  border-style: dashed;
  border-color: rgba(229, 185, 92, 0.5);
}

.pill.delayed .led {
  animation: pulse 2.4s ease-in-out infinite;
}

/* A finished-but-interrupted outcome: amber, and not pulsing like a live run. */
.pill.warn {
  color: var(--amber);
  border-color: rgba(229, 185, 92, 0.4);
}

/* Live run length: amber like a running run, but steady — the ticking digits
   are the movement. Tabular figures keep the column from twitching each second. */
.pill.runtime {
  color: var(--amber);
  border-color: rgba(229, 185, 92, 0.4);
  font-variant-numeric: tabular-nums;
}

.pill.failed {
  color: var(--red);
  border-color: rgba(240, 113, 106, 0.35);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

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

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}

form.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  font-size: 12.5px;
  color: var(--muted);
}

input[type="text"],
textarea {
  background: #12151b;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  width: 100%;
}

textarea {
  min-height: 190px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
}

/* A short list of patterns rather than a prompt. */
textarea.compact {
  min-height: 110px;
}

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

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

.hint a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hint.ok {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hint.warn {
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Settings page */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

/* Two readings in one card: a rule across it, rather than a second card. */
.card-divider {
  height: 1px;
  background: var(--border);
  margin: 0 -20px;
}

.card h3 {
  font-size: 11.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.path-value {
  color: var(--text);
  font-size: 12.5px;
  word-break: break-all;
}

input.narrow {
  width: 72px;
  text-align: center;
  padding: 5px 8px;
  font-size: 12.5px;
}

/* Model dropdown */
.select-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.select {
  flex: 1;
  min-width: 0;
  background: #12151b;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
  color-scheme: dark;
}

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

/* Holds a disabled button so the pause explanation can be hovered: pointer
   events are suppressed on the button itself, so the wrapper gets the hover. */
.btn-hold {
  display: inline-flex;
  cursor: not-allowed;
}

.btn-hold > .btn:disabled {
  pointer-events: none;
  cursor: not-allowed;
}

.select:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: progress;
}

/* Cron field legend, each name explaining itself on hover */
.legend {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

.cron-field {
  position: relative;
  color: var(--text);
  border-bottom: 1px dotted var(--muted);
  text-decoration: none;
  cursor: help;
}

.cron-field::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 230px;
  white-space: normal;
  text-align: center;
  background: #0b0d12;
  color: var(--text);
  border: 1px solid #3a4152;
  border-radius: 7px;
  padding: 6px 9px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 11.5px;
  line-height: 1.45;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 90ms ease;
  z-index: 20;
}

.cron-field:hover::after {
  opacity: 1;
}

/* Cron field shortcuts */
.preset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* A long common command is cut short on its button; the title carries all of it. */
.command-button {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
}

.preset-label {
  font-size: 12.5px;
  color: var(--muted);
}

/* The Server Color picks: a row of dots, the chosen one ringed. */
.swatch,
.swatch-custom {
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--border);
}

.swatch[aria-pressed="true"],
.swatch-custom.selected {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text);
}

.swatch-custom {
  background: none;
}

.swatch-custom::-webkit-color-swatch-wrapper {
  padding: 0;
}

.swatch-custom::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.swatch-custom::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

.time-entry {
  background: #12151b;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 5px 9px;
  font: inherit;
  font-size: 12.5px;
  /* Renders the native clock picker in dark. */
  color-scheme: dark;
}

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

/* Working Directory picker */
.combo {
  position: relative;
}

.combo-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--panel-2);
  border: 1px solid #3a4152;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  max-height: 244px;
  overflow-y: auto;
  padding: 4px;
}

.combo-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text);
  padding: 7px 9px;
  cursor: pointer;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-item:hover,
.combo-item.active {
  background: var(--accent-soft);
  color: var(--text);
}

.combo-item.active {
  box-shadow: inset 0 0 0 1px rgba(217, 119, 87, 0.45);
}

/* Lifetime totals under the cron name on the logs page. Wraps rather than
   squeezing, so a narrow window stacks them instead of clipping the digits. */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  min-width: 132px;
}

.stat-value {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  /* Tabular figures so a total that ticks up does not shift the label under it. */
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

/* Delay for usage: the checkboxes wrap on a narrow window rather than forcing
   the form wider. */
.delay-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 2px 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
}

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

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.form-actions .spacer {
  flex: 1;
}

.error {
  background: rgba(240, 113, 106, 0.1);
  border: 1px solid rgba(240, 113, 106, 0.35);
  color: #ffb4ae;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.logs-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 16px;
  align-items: start;
}

.run-list {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 70vh;
  overflow: auto;
}

.run-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  cursor: pointer;
  font: inherit;
}

.run-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.run-item.selected {
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
}

.run-item .when {
  font-size: 13px;
}

.run-item .meta {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 3px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.log-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: 70vh;
}

.log-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  flex-wrap: wrap;
}

.log-runtime {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.log-head .spacer {
  flex: 1;
}

.log-body {
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: #cfd6e2;
  flex: 1;
}

.breadcrumb {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 10px;
}

.breadcrumb a:hover {
  color: var(--text);
  text-decoration: underline;
}

.toasts {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 30;
  pointer-events: none;
  max-width: min(560px, calc(100vw - 32px));
}

.toast {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  text-align: center;
  animation: toast-in 160ms ease-out;
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.leaving {
  opacity: 0;
  transform: translateY(6px);
}

.toast.bad {
  border-color: rgba(240, 113, 106, 0.5);
  color: #ffb4ae;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .logs-layout {
    grid-template-columns: 1fr;
  }
  table {
    font-size: 13px;
  }
  th.hide-sm,
  td.hide-sm {
    display: none;
  }
}

/* The live queue on the Settings page: what is running under the concurrent
   job limit, and what is waiting behind it. */
.queue-body {
  display: grid;
  gap: 12px;
}

.queue-list {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}

.queue-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: var(--panel);
}

/* The place in line, which is the one number the row is really about. */
.queue-pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.queue-pos.running {
  border-color: transparent;
  color: var(--accent);
}

.queue-when {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* A name that goes somewhere reads as a link; the row is not clickable itself. */
.queue-row .link:hover {
  color: var(--accent);
}

.login {
  max-width: 380px;
  margin: 12vh auto 0;
  padding: 0 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
