/* Color and spacing separate the sidebar from the lighter page surface. */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light;
  --background: #ffffff;
  --sidebar: #f7f7f8;
  --sidebar-label: rgba(0, 0, 0, 0.85);
  --sidebar-selection: rgba(0, 0, 0, 0.035);
  --sidebar-hover-surface: color-mix(in srgb, black 3.5%, var(--sidebar));
  --hairline: rgba(0, 0, 0, 0.05);
  --table-border: rgba(0, 0, 0, 0.1);
  --table-header: var(--sidebar);
  --nav-active: #e1e1e5;
  --surface: #ffffff;
  --subtle: #f4f4f5;
  --hover: #f0f0f2;
  --text: #202024;
  --muted: #64646f;
  --border: #e3e3e8;
  --divider: #ededf0;
  --accent: #ffb800;
  --accent-hover: #e8a800;
  --blue: #175cd3;
  --blue-bg: #e0edff;
  --amber: #895000;
  --amber-bg: #ffebad;
  --green: #087a48;
  --green-bg: #c9f7df;
  --red: #be185d;
  --red-bg: #ffe0ef;
  --queued: #7535c9;
  --queued-bg: #efe2ff;
  --live-indicator: #16c784;
  color: var(--text);
  background: var(--background);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #141414;
  --sidebar: #0e0e0e;
  --sidebar-label: rgba(255, 255, 255, 0.85);
  --sidebar-selection: rgba(255, 255, 255, 0.1089);
  --sidebar-hover-surface: color-mix(in srgb, white 10.89%, var(--sidebar));
  --hairline: rgba(255, 255, 255, 0.05);
  --table-border: rgba(255, 255, 255, 0.1);
  --table-header: color-mix(in srgb, black 3%, var(--sidebar-hover-surface));
  --nav-active: #242424;
  --surface: #181818;
  --subtle: #1c1c1c;
  --hover: #26262c;
  --text: #eeeef0;
  --muted: #a1a1ad;
  --border: #303036;
  --divider: #28282e;
  --blue: #80b7ff;
  --blue-bg: #18365b;
  --amber: #ffcf4a;
  --amber-bg: #49380f;
  --green: #62eda8;
  --green-bg: #123e2d;
  --red: #ff8cbc;
  --red-bg: #4b1b35;
  --queued: #c6a0ff;
  --queued-bg: #35214f;
  --live-indicator: #62eda8;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  font-size: 14px;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.brand {
  font-family: "SF Mono", SFMono-Regular, ui-monospace, monospace;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.4px;
}
.brand-icon {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}

.account {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.environment {
  border: 0;
  border-radius: 5px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--subtle);
  font-size: 12px;
}
main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 110px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 32px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.6px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 12px;
}
h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.8px;
  font-weight: 600;
}
h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.connection {
  font-size: 14px;
  margin: 0 0 4px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.connection[data-live="true"]::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 100%;
  background: var(--live-indicator);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--live-indicator) 14%, transparent);
}
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--muted);
}
.summary p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}
.summary strong {
  font-weight: 600;
  color: var(--text);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.blue {
  background: var(--blue);
}
.amber {
  background: var(--amber);
}
.table-shell {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 0 0 0.5px var(--table-border);
  background: var(--surface);
}
.table-shell {
  overflow-x: auto;
}
table {
  width: 100%;
  table-layout: fixed;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
}
thead {
  background: var(--table-header);
}
th {
  color: var(--muted);
  background: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  padding: 15px 20px;
  border-bottom: 0;
  white-space: nowrap;
}
td {
  padding: 17px 20px;
  font-size: 14px;
  vertical-align: top;
  border-bottom: 0;
}
tr:last-child td {
  border-bottom: 0;
}
.threads-table {
  min-width: 1250px;
}
.threads-table .job-column {
  width: 320px;
}
.threads-table .repository-column {
  width: 330px;
}
.threads-table .state-column {
  width: 180px;
}
.threads-table .worker-column {
  width: 200px;
}
.threads-table .updated-column {
  width: 220px;
}
.threads-table th,
.threads-table td {
  padding-right: 28px;
}
.threads-table .worker {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.threads-table time {
  white-space: nowrap;
}
.job-title {
  margin: 0 0 7px;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.job-id {
  font-size: 12px;
  color: var(--muted);
}
.repository {
  display: block;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.base-ref {
  margin-top: 6px;
  font-family: "SF Mono", SFMono-Regular, ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.base-ref a {
  color: inherit;
  text-decoration: none;
}
.base-ref a:hover {
  color: var(--text);
  text-decoration: underline;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
  white-space: nowrap;
}
.status-icon {
  flex-shrink: 0;
}
.badge-unavailable {
  color: var(--muted);
  background: var(--queued-bg);
}
.badge-queued {
  color: var(--queued);
  background: var(--queued-bg);
}
.badge-running {
  color: var(--blue);
  background: var(--blue-bg);
}
.badge-waiting_for_input {
  color: var(--amber);
  background: var(--amber-bg);
}
.badge-succeeded,
.thread-progress-icon-succeeded {
  color: var(--green);
}
.badge-succeeded {
  background: var(--green-bg);
}
.badge-failed {
  color: var(--red);
  background: var(--red-bg);
}
.lease-warning {
  display: block;
  font-size: 12px;
  color: var(--red);
  line-height: 1.4;
  margin-top: 8px;
}
.worker {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
time {
  display: block;
  white-space: nowrap;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}
.footer-note {
  font-size: 12px;
  color: var(--muted);
  margin: 18px 0;
}
.quiet-button {
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 14px;
}
.primary-button {
  color: #201800;
  background: var(--accent);
  border: 0;
  border-radius: 7px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
}
.primary-button:hover {
  background: var(--accent-hover);
}
.new-job-button {
  color: #fff;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: 0.16px;
  white-space: nowrap;
  text-decoration: none;
}
.new-job-button:hover:not(:disabled) {
  background: #1a1a1a;
}
:root[data-theme="dark"] .new-job-button {
  color: #000;
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}
:root[data-theme="dark"] .new-job-button:hover:not(:disabled) {
  background: #f5f5f5;
}
.new-job-icon {
  width: 18px;
  height: 22px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("/sidebar/plus.svg") center / 14px 14px no-repeat;
  mask: url("/sidebar/plus.svg") center / 14px 14px no-repeat;
}
.sign-in-panel {
  padding: 48px 30px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}
.sign-in-panel h2 {
  margin: 0 0 12px;
}
.sign-in-panel p {
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.6;
}
.error {
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.5;
}
.empty {
  padding: 70px 24px;
  text-align: center;
}
.empty-icon {
  color: var(--muted);
  font-size: 28px;
}
.worker-empty-icon {
  display: inline-block;
  width: 28px;
  height: 34px;
  vertical-align: bottom;
  background: currentColor;
  -webkit-mask: url("/sidebar/workers.svg") center / contain no-repeat;
  mask: url("/sidebar/workers.svg") center / contain no-repeat;
}
.empty h2 {
  margin: 14px 0 8px;
  font-size: 18px;
}
.empty p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
@media (max-width: 680px) {
  .account {
    gap: 8px;
    max-width: 55%;
  }
  #account-name {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  main {
    padding: 32px 20px;
  }
  h1 {
    font-size: 30px;
  }
  .page-heading {
    margin-bottom: 24px;
  }
  .summary {
    gap: 14px;
  }
  th,
  td {
    padding: 16px 14px;
  }
  table {
    min-width: 760px;
  }
  .connection {
    text-align: right;
  }
  .sign-in-panel {
    padding: 28px 22px;
  }
}

tbody tr:hover {
  background: var(--table-header);
}
.quiet-button:hover {
  background: var(--hover);
}
@media (max-width: 480px) {
  .account {
    max-width: 100%;
    justify-content: flex-start;
  }
  .page-heading {
    align-items: center;
  }
  .connection {
    font-size: 12px;
  }
}

.app-layout {
  background: var(--sidebar);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 14px 16px;
  background: var(--sidebar);
  border-right: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand-row {
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar .brand {
  font-family: "SF Mono", SFMono-Regular, ui-monospace, monospace;
  font-size: 16px;
  gap: 10px;
}
.sidebar .brand-icon {
  width: 26px;
  height: 26px;
}
.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.nav-section {
  margin-top: 36px;
}
.nav-section-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  margin: 0 10px 10px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.nav-link:hover {
  background: var(--nav-active);
  color: var(--text);
}
.nav-link[aria-current="page"] {
  background: var(--nav-active);
  color: var(--text);
}
.nav-link[aria-current="page"] svg {
  color: var(--amber);
}
.workspace {
  min-width: 0;
  background: var(--background);
  border-radius: 0;
  overflow: hidden;
  margin-top: 4px;
}

.nav-toggle {
  display: none;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 5;
  padding: 12px;
  background: var(--accent);
  color: #201800;
  border-radius: 6px;
}
.skip-link:focus {
  top: 12px;
}
.back-link {
  color: var(--amber);
}
@media (min-width: 521px) and (max-width: 900px) {
  .app-layout {
    background: var(--sidebar);
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .account {
    max-width: 100%;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}
@media (max-width: 520px) {
  .app-layout {
    background: var(--sidebar);
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 0;
    padding: 16px 10px;
  }
  .nav-toggle {
    display: block;
  }
  .sidebar-content {
    display: none;
  }
  .sidebar-content.is-open {
    display: flex;
  }
  .nav-section {
    margin-top: 24px;
  }
}

.sidebar-footer {
  margin-top: auto;
  padding: 28px 10px 0;
}
.sidebar-footer .account {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 100%;
  font-size: 12px;
}
.sidebar-footer #account-name {
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.sidebar-content {
  min-height: 0;
}
.sidebar {
  overflow-y: auto;
}

.theme-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  margin-top: 20px;
  border-radius: 999px;
  background: var(--subtle);
}
.theme-toggle button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}
.theme-toggle button:hover {
  color: var(--text);
}
.theme-toggle button[aria-pressed="true"] {
  background: var(--sidebar-selection);
  color: var(--amber);
}

.jobs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.jobs-toolbar .summary {
  margin-bottom: 0;
}
.job-scope {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--sidebar);
}
.job-scope button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-label);
  background: transparent;
}
.job-scope button:hover {
  background: var(--sidebar-selection);
}
.job-scope button[aria-pressed="true"] {
  background: rgba(0, 0, 0, 0.065);
}
:root[data-theme="dark"] .job-scope button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.15);
}
.scope-icon {
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: var(--scope-symbol) center / contain no-repeat;
  -webkit-mask: var(--scope-symbol) center / contain no-repeat;
}
.scope-icon-everyone {
  --scope-symbol: url("/sidebar/everyone.png");
}
.scope-icon-mine {
  --scope-symbol: url("/sidebar/mine.png");
}
.scope-icon-open {
  --scope-symbol: url("/sidebar/open.png");
}
.scope-icon-closed {
  --scope-symbol: url("/thread/archivebox.png");
}

/* Figma sidebar: 280px wide, 40px rows, and a compact profile footer. */
.sidebar {
  padding: 26px 10px;
  overflow: visible;
}
.sidebar-brand-row {
  padding: 0 8px;
  min-height: 28px;
}
.sidebar .brand {
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--muted);
}
.sidebar .brand-icon {
  width: 24px;
  height: 24px;
}
.sidebar-content {
  padding-top: 24px;
}
.sidebar-content nav {
  overflow-y: auto;
  min-height: 0;
}
.nav-section {
  margin-top: 0;
}
.nav-section-title {
  margin: 0;
  padding: 9px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  letter-spacing: 0.16px;
}
.nav-link {
  width: 100%;
  min-height: 40px;
  padding: 9px;
  gap: 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: 0.16px;
  text-align: left;
}
.nav-icon {
  display: block;
  width: 25px;
  height: 22px;
  flex-shrink: 0;
  object-fit: none;
  filter: invert(1);
}
:root[data-theme="dark"] .nav-icon {
  filter: none;
}
.nav-link[aria-current="page"] {
  background: var(--nav-active);
}
.sidebar-footer {
  margin-top: auto;
  padding: 24px 7px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-footer .theme-toggle {
  margin: 0;
  padding: 0;
  gap: 0;
  background: transparent;
  flex-shrink: 0;
}
.sidebar-footer .theme-toggle button {
  width: 25px;
  height: 27px;
}
.profile-menu {
  position: relative;
  min-width: 0;
  flex: 1;
}
.profile-button {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.profile-button::-webkit-details-marker {
  display: none;
}
.profile-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 5px;
}
.profile-avatar {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.profile-initial {
  display: grid;
  place-items: center;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 13px;
  font-weight: 600;
}
.profile-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
}
.profile-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  width: 230px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  box-shadow: 0 8px 30px #0003;
  border-radius: 12px;
  z-index: 5;
}
.profile-email {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  max-width: 100%;
}
.workspace {
  border-radius: 0;
  margin-top: 0;
}
@media (max-width: 520px) {
  .sidebar {
    padding: 16px 10px;
  }
  .sidebar-content {
    padding-top: 16px;
  }
  .sidebar-footer {
    padding-top: 24px;
  }
}

/* Exact sidebar type and label hierarchy from Figma node 1:254. */
.sidebar {
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-label: rgba(0, 0, 0, 0.85);
  --sidebar-heading: rgba(0, 0, 0, 0.4);
  --sidebar-brand: var(--sidebar-label);
}
:root[data-theme="dark"] .sidebar {
  --sidebar-label: rgba(255, 255, 255, 0.85);
  --sidebar-heading: rgba(255, 255, 255, 0.4);
  --sidebar-brand: var(--sidebar-label);
}
.sidebar .brand {
  font-family: "SF Pro Rounded", ui-rounded, -apple-system, sans-serif;
  font-weight: 800;
  font-size: 18px;
  line-height: 28px;
  letter-spacing: 0;
  color: var(--sidebar-brand);
}
.sidebar .nav-link,
.sidebar .profile-name {
  color: var(--sidebar-label);
}
.sidebar .nav-section-title {
  color: var(--sidebar-heading);
}
.sidebar .profile-name {
  letter-spacing: 0.16px;
}

:root[data-theme="dark"] .sidebar .nav-link:hover,
:root[data-theme="dark"] .sidebar .nav-link[aria-current="page"] {
  background: var(--sidebar-selection);
}

/* Sidebar typography reduced by 2px from the original Figma sizes. */
.sidebar {
  font-size: 12px;
}
.sidebar .brand {
  font-size: 16px;
}
.sidebar .nav-section-title,
.sidebar .nav-link,
.sidebar .profile-name {
  font-size: 14px;
}
.sidebar .profile-initial {
  font-size: 11px;
}
.sidebar .profile-email,
.sidebar .environment {
  font-size: 10px;
}
.sidebar .quiet-button {
  font-size: 12px;
}

:root:not([data-theme="dark"]) .sidebar .nav-link:hover,
:root:not([data-theme="dark"]) .sidebar .nav-link[aria-current="page"] {
  background: var(--sidebar-selection);
}

.coming-soon-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.coming-soon-page .page-heading {
  flex-shrink: 0;
}
.coming-soon-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
}
.coming-soon-placeholder h2 {
  margin-top: 0;
}
.coming-soon-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 20px;
  opacity: 0.5;
  filter: invert(1);
}
:root[data-theme="dark"] .coming-soon-icon {
  filter: none;
}
@media (max-width: 520px) {
  .coming-soon-page {
    min-height: calc(100dvh - 60px);
  }
}

.theme-toggle button[data-theme-option] {
  color: var(--muted);
}
.theme-toggle button[data-theme-option="light"]:hover {
  color: var(--accent);
}
.theme-toggle button[data-theme-option="dark"]:hover {
  color: #a78bfa;
}

.sidebar .nav-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar .nav-section + .nav-section {
  margin-top: 1px;
}

.sidebar .nav-link,
.sidebar .nav-section-title {
  padding-top: 8px;
  padding-bottom: 8px;
}
.sidebar .nav-link {
  min-height: 38px;
}

.sidebar {
  box-shadow: inset -0.5px 0 var(--hairline);
}
:root[data-theme="dark"] .sidebar {
  box-shadow: inset -0.5px 0 var(--hairline);
}
@media (max-width: 520px) {
  .sidebar,
  :root[data-theme="dark"] .sidebar {
    box-shadow: none;
  }
}

.nav-job-counts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-job-count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav-job-count-single {
  width: 20px;
  min-width: 20px;
  height: 20px;
  padding: 0;
}
.nav-job-count-running {
  background: var(--blue);
  color: var(--blue-bg);
}
.nav-job-count-input {
  background: var(--amber);
  color: var(--amber-bg);
}
.summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.summary-total {
  color: var(--queued);
}
.summary-running {
  color: var(--blue);
}
.summary-waiting {
  color: var(--amber);
}

.status-spinner {
  animation: status-spin 0.9s linear infinite;
  transform-origin: center;
}
.summary-icon .status-spinner {
  animation: none;
}
@keyframes status-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .status-spinner {
    animation: none;
  }
}

thead th {
  box-shadow: inset 0 -0.5px var(--table-border);
}

.job-search-field {
  position: relative;
  width: 220px;
  max-width: 100%;
  margin-left: auto;
}
.job-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
  background: var(--muted);
  -webkit-mask: url("/sidebar/search.png") center / contain no-repeat;
  mask: url("/sidebar/search.png") center / contain no-repeat;
}
.job-search {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 0.5px solid var(--table-border);
  outline: none;
  border-radius: 999px;
  background: var(--sidebar);
  color: var(--sidebar-label);
  font: inherit;
  font-size: 14px;
}
.job-search::placeholder {
  color: var(--muted);
}
.job-search:focus {
  outline: none;
  box-shadow: none;
  border-color: var(--table-border);
  background: var(--sidebar-hover-surface);
}

.job-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sign-in-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100dvh;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--background);
}
.sign-in-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.floating-hearts {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.floating-heart {
  position: absolute;
  left: var(--left);
  rotate: none;
  bottom: -60px;
  width: var(--size);
  height: var(--size);
  opacity: 0;
  animation: heart-float var(--duration) var(--delay) linear infinite;
}
.floating-heart-symbol {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  background: var(--muted);
  -webkit-mask: url("/sidebar/floating-heart.png") center / contain no-repeat;
  mask: url("/sidebar/floating-heart.png") center / contain no-repeat;
  animation: heart-rotate 90s linear infinite;
}
@keyframes heart-float {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  15%,
  70% {
    opacity: 0.12;
  }
  100% {
    opacity: 0;
    transform: translateY(calc(-100dvh - 120px));
  }
}
@keyframes heart-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(var(--rotation));
  }
}
@media (prefers-reduced-motion: reduce) {
  .floating-hearts {
    display: none;
  }
}
.sign-in-logo {
  display: block;
  margin: 0 auto 24px;
  filter: invert(1);
}
:root[data-theme="dark"] .sign-in-logo {
  filter: none;
}
.sign-in-arrow {
  width: 18px;
  height: 22px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("/sidebar/arrow-right.png") center / 18px 18px no-repeat;
  mask: url("/sidebar/arrow-right.png") center / 18px 18px no-repeat;
}
.sign-in-card p {
  margin: 16px 0 24px;
  font-size: 20px;
  color: var(--muted);
  line-height: 1.5;
}
.sign-in-card .new-job-button {
  padding: 10px 12px;
  border-radius: 12px;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.sign-in-card .new-job-button:hover:not(:disabled) {
  background: #333;
  border-color: #555;
}
:root[data-theme="dark"] .sign-in-card .new-job-button:hover:not(:disabled) {
  background: #d4d4d4;
  border-color: #b8b8b8;
}
.sign-in-page > .error {
  max-width: 400px;
  margin-top: 24px;
}

.new-job-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.new-job-composer {
  width: min(100%, 620px);
}
.new-job-composer h1 {
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  margin: 0 0 36px;
}
.new-job-composer textarea {
  display: block;
  width: 100%;
  resize: none;
  min-height: 150px;
  padding: 18px;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--table-border);
  border-radius: 16px;
  outline: none;
  background: transparent;
  color: var(--sidebar-label);
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
}
.new-job-composer textarea:focus {
  outline: none;
  box-shadow: none;
  border-color: var(--table-border);
}
.new-job-composer textarea::placeholder {
  color: rgba(0, 0, 0, 0.2);
  opacity: 1;
}
:root[data-theme="dark"] .new-job-composer textarea::placeholder {
  color: rgba(255, 255, 255, 0.2);
}
.new-job-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}
.new-job-actions .new-job-button {
  padding: 8px 12px;
}
.new-job-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}
@media (max-width: 700px) {
  .new-job-page {
    min-height: calc(100dvh - 76px);
  }
  .new-job-composer h1 {
    font-size: 24px;
  }
}

.workers-page {
  width: 100%;
}
.worker-command {
  overflow-x: auto;
  padding: 18px;
  border: 0;
  box-shadow: 0 0 0 0.5px var(--table-border);
  background: var(--sidebar);
  border-radius: 12px;
  font-size: 13px;
}
.worker-table-shell {
  margin-top: 32px;
}
.workers-table .worker-name-column {
  width: 26%;
}
.workers-table .worker-state-column {
  width: 24%;
}
.workers-table .worker-actions-column {
  width: 18%;
}
.workers-table tbody tr:hover {
  background: transparent;
}
.workers-table td {
  overflow-wrap: anywhere;
}
.workers-table .badge {
  white-space: normal;
}
.worker-approval {
  max-width: 640px;
  margin: 32px auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.worker-approval h1 {
  font-size: 26px;
}
.worker-approval p {
  line-height: 1.6;
}
.worker-approval-details {
  margin: 28px 0;
  padding: 20px;
  border: 1px solid var(--table-border);
  border-radius: 12px;
  background: var(--sidebar);
}
.worker-approval-details h2 {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 600;
}
.worker-detail-list {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px 16px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.worker-detail-list dt {
  color: var(--muted);
}
.worker-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}
.worker-detail-list code {
  font-family: "SF Mono", SFMono-Regular, ui-monospace, monospace;
  font-size: 13px;
}
.worker-code-instruction {
  margin: 0;
  color: #fff;
}
@media (max-width: 520px) {
  .worker-detail-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .worker-detail-list dd + dt {
    margin-top: 12px;
  }
}
.worker-code {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--table-border);
  border-radius: 12px;
  background: var(--sidebar);
  font-family: "SF Mono", SFMono-Regular, ui-monospace, monospace;
  font-size: clamp(18px, 4.5vw, 30px);
  letter-spacing: 0.1em;
  line-height: 1.3;
  margin: 24px 0;
}
.worker-code-confirm {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 24px 0;
  line-height: 1.5;
  cursor: pointer;
}
.worker-code-confirm input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: inherit;
}
.worker-actions {
  display: flex;
  gap: 12px;
}
@media (max-width: 760px) {
  .worker-approval {
    padding: 20px;
  }
}

.workers-page .new-job-button:disabled,
.worker-approval .new-job-button:disabled {
  opacity: 0.45;
  cursor: default;
}

:root .new-job-button.revoke-button {
  color: #fff;
  background: #dc2626;
  border-color: rgba(0, 0, 0, 0.1);
}
:root .new-job-button.revoke-button:hover:not(:disabled) {
  background: #b91c1c;
}

/* Apple's arrow.clockwise SF Symbol, exported from AppKit at 4x. */
.refresh-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("/sidebar/refresh.png") center / contain no-repeat;
  mask: url("/sidebar/refresh.png") center / contain no-repeat;
}

.worker-approval-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.worker-approval-page .worker-approval {
  width: 100%;
  margin: 0;
}
@media (max-width: 760px) {
  .worker-approval-page {
    min-height: calc(100dvh - 76px);
  }
}

.thread-question-reply {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.thread-question-reply .thread-answer-box {
  grid-column: auto;
}
.thread-question-reply .thread-feedback-input {
  height: 88px;
  min-height: 88px;
}
.thread-question-reply .thread-action[aria-pressed="true"] {
  background: var(--thread-secondary, var(--sidebar));
  border-color: var(--muted);
}
.thread-question-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}
.question-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}
.thread-question-reply .question-options {
  flex-direction: column;
  margin: 0;
}
.thread-question-reply .question-options .thread-action {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.thread-row {
  cursor: pointer;
}
.thread-title-link {
  color: inherit;
  text-decoration: none;
}
.thread-title-link:hover {
  text-decoration: underline;
}

.thread-details {
  --thread-panel: rgba(0, 0, 0, 0.035);
  --thread-secondary: rgba(0, 0, 0, 0.08);
  --thread-action-ink: #000;
  --thread-action-text: rgba(0, 0, 0, 0.85);
}
:root[data-theme="dark"] .thread-details {
  --thread-panel: rgba(255, 255, 255, 0.06);
  --thread-secondary: rgba(255, 255, 255, 0.2);
  --thread-action-ink: #fff;
  --thread-action-text: rgba(255, 255, 255, 0.85);
}
.workspace:has(.thread-details) {
  overflow: clip;
}
main:has(.thread-sticky-header) {
  padding-top: 0;
}
.thread-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-block: 48px 16px;
  background: var(--background);
}
.thread-sticky-header-scrolled {
  box-shadow: 0 1px 0 color-mix(in srgb, var(--table-border) 50%, transparent);
}
@media (max-width: 680px) {
  .thread-sticky-header {
    padding-top: 32px;
  }
}
.thread-detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.thread-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: var(--thread-secondary, var(--sidebar));
  color: var(--thread-action-text);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: 0.16px;
  text-decoration: none;
  white-space: nowrap;
}
:root:not([data-theme="dark"]) .thread-action:not(.thread-action-primary) {
  background: rgba(0, 0, 0, 0.035);
  border-color: rgba(0, 0, 0, 0.05);
}
:root:not([data-theme="dark"])
  .thread-action:not(.thread-action-primary):hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.1);
  filter: none;
}
.thread-action-primary {
  background: #000;
  --thread-action-ink: #fff;
  color: #fff;
}
:root[data-theme="dark"] .thread-action-primary {
  background: #fff;
  --thread-action-ink: #000;
  color: rgba(0, 0, 0, 0.85);
}
.thread-action:hover:not(:disabled) {
  filter: brightness(0.92);
}
.thread-action:disabled {
  opacity: 0.4;
  cursor: default;
}
.thread-symbol {
  display: inline-block;
  flex-shrink: 0;
  width: 19px;
  height: 22px;
  background: currentColor;
  mask: var(--symbol) center / auto 13px no-repeat;
  -webkit-mask: var(--symbol) center / auto 13px no-repeat;
}
.thread-symbol-xmark {
  width: 17px;
}
.thread-symbol-arrow-up-right {
  width: 16px;
}
.thread-symbol-download {
  mask-size: auto 17px;
  -webkit-mask-size: auto 17px;
}
.thread-action .thread-symbol {
  /* Exported glyphs carry Figma's 85% alpha; do not apply it twice. */
  background: var(--thread-action-ink);
}
.thread-detail-heading h1 {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: 0.26px;
  overflow-wrap: anywhere;
}
.thread-metadata {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: 0.14px;
  color: var(--muted);
}
.thread-metadata .badge,
.thread-audit .badge {
  padding: 4px 8px;
  font-size: 14px;
  line-height: 22px;
  gap: 6px;
}
.new-job-target,
.thread-branch-link {
  padding: 4px 8px;
  border-radius: 8px;
  font-family: "SF Mono", SFMono-Regular, ui-monospace, monospace;
  font-size: 14px;
  font-weight: 400;
  background: var(--blue-bg);
  color: var(--blue);
  text-decoration: none;
  overflow-wrap: anywhere;
  min-width: 0;
}
.new-job-target {
  font-size: 12px;
  background: var(--subtle);
  color: var(--muted);
}
.thread-branch-link:hover {
  text-decoration: underline;
}
.thread-updated {
  max-width: 100%;
}
.thread-updated,
.thread-message-time {
  color: rgba(0, 0, 0, 0.6);
}
:root[data-theme="dark"] .thread-updated,
:root[data-theme="dark"] .thread-message-time {
  color: rgba(255, 255, 255, 0.6);
}
.thread-updated-label {
  white-space: nowrap;
}
.thread-updated time {
  display: inline;
  white-space: normal;
  font: inherit;
  color: inherit;
}
.thread-results {
  margin-top: 24px;
}
.thread-results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.thread-results-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: 0.2px;
}
.thread-result-actions {
  display: flex;
  gap: 10px;
}
.thread-results-panel {
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.thread-result-summary,
.thread-audit {
  background: var(--thread-panel);
}
.thread-result-summary {
  padding: 18px;
}
.thread-detail-prose,
.thread-section-placeholder {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: 0.16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.thread-section-placeholder,
.thread-closed-label {
  color: var(--muted);
}
.thread-artifacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.thread-artifact {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--thread-panel);
  color: var(--muted);
}
.thread-artifact:hover {
  color: var(--text);
  background: var(--thread-secondary);
}
.thread-audit summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}
.thread-audit summary {
  transition: background-color 140ms ease;
}
.thread-audit:not([open]) summary:hover:not([data-hover-dismissed]) {
  background-color: rgba(0, 0, 0, 0.025);
}
:root[data-theme="dark"]
  .thread-audit:not([open])
  summary:hover:not([data-hover-dismissed]) {
  background-color: rgba(255, 255, 255, 0.035);
}
@media (prefers-reduced-motion: reduce) {
  .thread-audit summary {
    transition: none;
  }
}
.thread-audit[open] > summary {
  background: transparent;
  transition: none;
}
.thread-audit summary::-webkit-details-marker {
  display: none;
}
.thread-audit-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  overflow-wrap: anywhere;
}
.thread-audit .badge {
  white-space: normal;
  max-width: 45%;
}
.thread-audit .thread-symbol {
  width: 17px;
  mask-size: 12px auto;
  -webkit-mask-size: 12px auto;
}
.thread-audit[open] .thread-symbol {
  transform: rotate(180deg);
}
.thread-audit > p {
  padding: 0 18px 18px;
}
.thread-verdict-neutral {
  background: var(--thread-secondary);
  color: var(--muted);
}
@media (max-width: 640px) {
  .thread-results-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .thread-detail-toolbar {
    margin-bottom: 32px;
  }
  .thread-detail-heading h1 {
    font-size: 24px;
  }
  .thread-result-actions {
    flex-wrap: wrap;
  }
}

.thread-conversation {
  margin-top: 40px;
}
.thread-conversation > h2 {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: 0.18px;
}
.thread-messages {
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.thread-message {
  --message-name-space: 26px;
  display: grid;
  grid-template-columns: 44.16px minmax(0, 1fr) 44.16px;
  align-items: start;
  gap: 16px;
}
.thread-messages > .thread-message {
  position: relative;
}
.thread-messages > .thread-message:has(~ .thread-message)::before {
  content: "";
  position: absolute;
  left: 22.08px;
  top: calc(44.16px + var(--message-name-space));
  bottom: calc(-30px - var(--message-name-space));
  width: 2.5px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    color-mix(in srgb, var(--muted) 15%, transparent) 0 6px,
    transparent 6px 11px
  );
  pointer-events: none;
}
.thread-message-avatar,
.thread-message-avatar img,
.thread-message-avatar-placeholder {
  display: block;
  width: 44.16px;
  height: 44.16px;
  border-radius: 50%;
}
.thread-message-avatar img {
  object-fit: cover;
}
.thread-message > .thread-message-avatar {
  margin-top: var(--message-name-space);
}
.thread-message-avatar {
  overflow: hidden;
  background: #e8e8eb;
  color: #000;
}
:root[data-theme="dark"] .thread-message-avatar {
  background: #353535;
  color: #fff;
}
.thread-message-avatar-placeholder {
  opacity: 0.4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14.72px;
  font-weight: 600;
}

.thread-message-content {
  min-width: 0;
}
.thread-message-body {
  display: inline-block;
  vertical-align: top;
  width: auto;
  max-width: 100%;
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--thread-panel);
}
.thread-message-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding-inline: 18px;
  min-height: 22px;
}
.thread-message-time {
  font-size: 12px;
  white-space: nowrap;
}
.thread-message-initial {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 10px;
  line-height: 14px;
  white-space: nowrap;
}
.thread-message-name {
  opacity: 0.85;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  letter-spacing: 0.16px;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .thread-message {
    gap: 10px;
  }
}

.thread-action .thread-symbol-archivebox {
  background: currentColor;
  mask-size: auto 16px;
  -webkit-mask-size: auto 16px;
}

.thread-test-changes {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 18px;
  background: var(--thread-panel);
}
.thread-test-changes h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: 0.16px;
}

@media (min-width: 761px) {
  .sign-in-page {
    padding-inline: 94px;
  }
}

.thread-details-with-feedback {
  padding-bottom: 120px;
}
.thread-feedback-dock {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 280px;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 64px 0 calc(28px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--background) 85%);
  pointer-events: none;
}
.thread-feedback-content {
  width: 100%;
  max-width: 1320px;
  padding-inline: 110px;
  display: grid;
  grid-template-columns: 44.16px minmax(0, 1fr) 44.16px;
  align-items: end;
  gap: 16px;
}
.thread-feedback-bar {
  grid-column: 2;
  pointer-events: auto;
  width: 100%;
  border: 1px solid var(--table-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
:root[data-theme="dark"] .thread-feedback-bar {
  background: #292929;
}
.thread-feedback-input {
  display: block;
  width: 100%;
  height: 64.5px;
  min-height: 64.5px;
  max-height: 160px;
  margin: 0;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 22px;
  resize: none;
}
.thread-feedback-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 12px;
}
.thread-feedback-input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.thread-feedback-input::placeholder {
  color: #000;
  opacity: 0.5;
}
:root[data-theme="dark"] .thread-feedback-input::placeholder {
  color: #fff;
}
.thread-feedback-input:focus {
  outline: none;
}
@media (max-width: 520px) {
  .thread-feedback-dock {
    left: 0;
  }
}

@media (max-width: 680px) {
  .thread-feedback-content {
    padding-inline: 20px;
  }
}
@media (max-width: 520px) {
  .thread-feedback-content {
    gap: 10px;
  }
}

.thread-message-agent .thread-message-body {
  max-width: min(100%, 72ch);
  background: rgba(255, 184, 0, 0.12);
}
.thread-message-agent .thread-message-name {
  color: #895000;
}
.thread-message-agent .thread-message-avatar,
:root[data-theme="dark"] .thread-message-agent .thread-message-avatar {
  background: var(--amber-bg);
  color: var(--amber);
}
.thread-message-agent .thread-message-avatar-placeholder {
  opacity: 1;
}
:root[data-theme="dark"] .thread-message-agent .thread-message-name {
  color: var(--accent);
}

.thread-agent-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}
.thread-agent-symbol {
  display: block;
  width: 25px;
  height: 25px;
  background: currentColor;
  opacity: 1;
  /* Optical centering for the asymmetric SF pointer symbol. */
  transform: translate(2px, -0.5px);
  mask: url("/thread/pointer-arrow-ipad.png") center / contain no-repeat;
  -webkit-mask: url("/thread/pointer-arrow-ipad.png") center / contain no-repeat;
}

.thread-artifact {
  overflow: hidden;
}
.thread-artifact img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thread-feedback-unavailable {
  margin-right: auto;
  align-self: center;
  padding-inline: 8px;
  font-size: 12px;
  color: #000;
  opacity: 0.6;
}
:root[data-theme="dark"] .thread-feedback-unavailable {
  color: #fff;
}

/* Inline answers share the question bubble, with a quiet inset composer. */
.thread-question-reply .thread-answer-box,
:root[data-theme="dark"] .thread-question-reply .thread-answer-box {
  border-radius: 12px;
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  border: 1px solid transparent;
  box-shadow: none;
}
.thread-question-reply .thread-action-primary,
:root[data-theme="dark"] .thread-question-reply .thread-action-primary {
  background: var(--amber);
  color: #fff;
  --thread-action-ink: #fff;
}
:root[data-theme="dark"] .thread-question-reply .thread-action-primary {
  color: #000;
  --thread-action-ink: #000;
}

.thread-question-reply .question-options .thread-action {
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 14px;
}

:root .thread-question-reply .question-options .thread-action {
  background: color-mix(in srgb, var(--amber) 10%, transparent);
}
:root
  .thread-question-reply
  .question-options
  .thread-action:hover:not(:disabled),
:root
  .thread-question-reply
  .question-options
  .thread-action[aria-pressed="true"] {
  background: color-mix(in srgb, var(--amber) 18%, transparent);
  filter: none;
}

:root .thread-question-reply .thread-answer-box:focus-within {
  border-color: var(--amber);
}
.thread-question-reply .thread-feedback-input {
  padding: 10px 14px;
}

.thread-question-approval .question-options {
  flex-direction: row;
}
.thread-question-approval .question-options .thread-action {
  width: auto;
}

.thread-progress .thread-results-panel {
  border: 1px solid var(--table-border);
}
.thread-progress .thread-result-summary {
  background: transparent;
}
.thread-progress-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.thread-progress-timeline li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 18px;
}
.thread-progress-timeline li:last-child {
  padding-bottom: 0;
}
.thread-progress-timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 9.5px;
  top: 22px;
  bottom: 0;
  width: 1px;
  background: var(--table-border);
}
.thread-progress-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  height: 22px;
}
.thread-progress-icon .status-icon {
  width: 18px;
  height: 18px;
}
.thread-progress-icon-running {
  color: var(--blue);
}
.thread-progress-icon-waiting_for_input {
  color: var(--amber);
}

.thread-diff-stats {
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.thread-diff-additions {
  color: var(--green);
}
.thread-diff-deletions {
  color: var(--red);
}

main:has(> .page-loading) {
  min-height: 100svh;
  display: grid;
  place-items: center;
}
.page-loading {
  display: grid;
  place-items: center;
  color: var(--muted);
}
.page-loading .status-icon {
  width: 28px;
  height: 28px;
}

/* UI chrome should not select on repeated clicks. Content stays copyable. */
button,
[role="button"],
label,
th,
.brand,
.nav-link,
.nav-section-title,
.profile-button,
.primary-button,
.new-job-button,
.quiet-button,
.thread-action,
.back-link,
.skip-link,
.badge,
.thread-message-initial,
.thread-message-avatar,
.page-heading h1,
.thread-results-heading h2,
.thread-conversation > h2,
.thread-test-changes > h3,
.thread-audit-title {
  -webkit-user-select: none;
  user-select: none;
}

/* Preserve selection in editable fields and useful data, including links. */
input,
textarea,
[contenteditable="true"],
pre,
code,
.profile-email,
.thread-detail-heading h1,
.thread-detail-prose,
.thread-title-link,
.thread-branch-link,
.job-title,
.job-id,
.repository,
.base-ref,
.worker,
.thread-message-name,
.thread-message-time,
.thread-updated,
.question-options button {
  -webkit-user-select: text;
  user-select: text;
}

.worker-removal-dialog {
  width: min(480px, calc(100vw - 40px));
  max-height: calc(100svh - 40px);
  margin: auto;
  padding: 24px;
  border: 1px solid var(--table-border);
  border-radius: 16px;
  background: var(--background);
  color: var(--text);
  box-shadow: 0 16px 64px #0003;
}
.worker-removal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}
.worker-removal-dialog h2 {
  margin: 0 0 12px;
  font-size: 20px;
}
.worker-removal-dialog p {
  line-height: 1.5;
}
.worker-removal-dialog .worker-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.worker-removal-dialog button:focus-visible {
  outline: none;
}

.nav-agent-icon {
  display: block;
  width: 25px;
  height: 22px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("/sidebar/threads-cursor-outline.svg") center / 22px 19px
    no-repeat;
  mask: url("/sidebar/threads-cursor-outline.svg") center / 22px 19px no-repeat;
}

/* Account footer and menu. */
.sidebar {
  padding-bottom: 12px;
}
.sidebar-footer {
  border-top: 1px solid var(--hairline);
  padding-top: 12px;
}
.profile-button {
  padding: 8px;
  margin-left: -8px;
  border-radius: 10px;
}
.profile-button:hover,
.profile-menu[open] > .profile-button,
.profile-button:focus-visible {
  background: var(--sidebar-selection);
  outline: none;
}
.profile-popover {
  width: 250px;
  max-width: calc(100vw - 40px);
  padding: 12px;
  gap: 8px;
  border: 1px solid var(--table-border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 36px #0003;
  z-index: 20;
}
.profile-popover-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 4px 2px 12px;
  border-bottom: 1px solid var(--table-border);
}
.profile-popover-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.profile-popover-name {
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.profile-sign-out {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 8px;
  border-radius: 8px;
  text-align: left;
}
.profile-sign-out-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("/sidebar/sign-out.png") center / contain no-repeat;
  mask: url("/sidebar/sign-out.png") center / contain no-repeat;
}

.sidebar .brand {
  gap: 8px;
}
.sidebar .brand .brand-icon {
  width: 24px;
  height: 24px;
  filter: none;
  opacity: 1;
}
.sidebar .brand-wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 7px;
  border-radius: 10px;
  background: rgba(255, 184, 0, 0.2);
  color: #ffb800;
  font-family: "SF Pro Rounded", ui-rounded, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 900;
  line-height: normal;
  letter-spacing: normal;
}

.thread-progress-toggle {
  justify-content: flex-start;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
}
.thread-progress-toggle::-webkit-details-marker {
  display: none;
}
.thread-progress-toggle .thread-symbol {
  width: 17px;
  mask-size: 12px auto;
  -webkit-mask-size: 12px auto;
  transform: rotate(0);
}
.thread-progress[open] > .thread-progress-toggle .thread-symbol {
  transform: rotate(180deg);
}
.thread-progress:not([open]) > .thread-progress-toggle {
  margin-bottom: 0;
}
.thread-progress-icon-failed {
  color: var(--red);
}

:root:not([data-theme="dark"]) .sidebar .brand .brand-icon {
  filter: brightness(0);
}
:root:not([data-theme="dark"]) .sidebar .brand-wordmark {
  color: #000;
  background: rgba(0, 0, 0, 0.08);
}

/* Image previews preserve their native proportions instead of square crops. */
.thread-artifact-image {
  width: fit-content;
  height: auto;
  max-width: 100%;
  align-self: flex-start;
}
.thread-artifact-image img {
  width: auto;
  height: auto;
  max-height: 240px;
  max-width: 100%;
  object-fit: contain;
}
.thread-artifact-image-placeholder {
  border: 0;
  box-shadow: none;
  padding: 0;
  width: 160px;
  height: 240px;
  max-width: 100%;
}
.thread-artifact-image-placeholder .status-spinner {
  width: 24px;
  height: 24px;
}

button.thread-artifact-image {
  padding: 0;
  border: 0;
  cursor: zoom-in;
}
.image-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 64px 32px 32px;
  border: 0;
  background: rgba(0, 0, 0, 0.92);
  box-sizing: border-box;
}
.image-overlay[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-overlay::backdrop {
  background: transparent;
}
.image-overlay > img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.image-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.image-overlay-close:focus-visible {
  outline: none;
  box-shadow: none;
}
.image-overlay-close:hover {
  background: rgba(255, 255, 255, 0.24);
}
.image-overlay-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.thread-activity {
  --message-name-space: 26px;
  --activity-color: var(--queued);
  --activity-background: var(--queued-bg);
  display: grid;
  grid-template-columns: 44.16px minmax(0, 1fr) 44.16px;
  align-items: start;
  gap: 16px;
}
.thread-activity-content {
  grid-column: 2;
  min-width: 0;
  text-align: left;
}
.thread-activity-content .thread-message-body {
  color: var(--activity-color);
  background: var(--activity-background);
  text-align: left;
}
.thread-activity-icon {
  margin-top: var(--message-name-space);
  grid-column: 1;
  grid-row: 1;
  width: 44.16px;
  height: 44.16px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}
.thread-activity-icon .status-icon {
  width: 20px;
  height: 20px;
}

.thread-activity[data-status="running"] {
  --activity-color: var(--blue);
  --activity-background: var(--blue-bg);
}
.thread-activity[data-status="waiting_for_input"] {
  --activity-color: var(--amber);
  --activity-background: var(--amber-bg);
}
.thread-activity .thread-message-name {
  color: var(--activity-color);
}

.thread-artifact-recording {
  display: block;
  width: 100%;
  max-width: 360px;
  max-height: 540px;
  border-radius: 12px;
  background: #000;
  object-fit: contain;
}
