@charset "UTF-8";

/* Shared tokens and accessible defaults */
:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --ink: #192e34;
  --text: #384d55;
  --muted: #687b84;
  --line: #dfe6e9;
  --line-soft: #eaf0f2;
  --brand: #0e7567;
  --brand-hover: #095e54;
  --brand-soft: #e8f4f1;
  --focus: #91c9bd;
  --warning-bg: #fff6e4;
  --danger: #a34439;
  --danger-bg: #fff0ed;
  --radius: 12px;
  --sidebar-width: 232px;
  --shadow: 0 1px 3px rgb(22 44 53 / 4%);
}

* {

  box-sizing: border-box;

}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select {
  font: inherit;
}
button, a, input, textarea, select {
  touch-action: manipulation;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: .52;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
button, a {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--surface);
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: translateY(0);
}
/* Application shell */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 28px 18px 24px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 8px 36px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
}
.brand-mark svg {
  width: 30px;
  height: 30px;
  stroke: none;
}
.brand strong {
  display: block;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 1px;
}
.brand small {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
  letter-spacing: .2px;
}
.workspace-label {
  margin-bottom: 12px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #536771;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
}
.nav-item:hover {
  background: var(--surface-subtle);
}
.nav-item.active {
  border-color: #d8ebe5;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.nav-arrow {
  margin-left: auto;
  font-size: 18px;
}
.nav-count {
  min-width: 23px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 5px;
  background: #cfe7df;
  color: #226354;
  font-size: 13px;
  text-align: center;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 22px 12px 0;
  border-top: 1px solid var(--line-soft);
}
.shared-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.sidebar-bottom p {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.version {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #218c72;
}
.status-dot.neutral {
  background: #93a0a7;
}
.status-dot.warning {
  background: #c89128;
}
.app-shell {
  margin-left: var(--sidebar-width);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px 36px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.breadcrumb span {
  color: #a2afb6;
}
.breadcrumb strong {
  color: var(--text);
  font-weight: 500;
}
.service-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 30px 36px 40px;
  outline: none;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
h1 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -.5px;
}
.page-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.eyebrow {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .6px;
}
.heading-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid #d9e8e3;
  border-radius: 6px;
  color: #4c7568;
  background: #f0f8f4;
  font-size: 13px;
  white-space: nowrap;
}
/* Research form */
.create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  align-items: start;
  gap: 24px;
}
.form-panel, .queue-summary, .jobs-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.form-panel, .jobs-panel {
  overflow: hidden;
}
fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.form-section {
  padding: 26px 30px;
  border-bottom: 1px solid var(--line-soft);
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 22px;
}
.step-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid #d8e9e3;
  border-radius: 7px;
  background: #eef6f3;
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
}
.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}
.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f4f7f8;
}
.segment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #687b83;
  font-size: 15px;
  line-height: 1.5;
}
.segment:hover {
  color: var(--brand);
}
.segment svg {
  width: 18px;
  height: 18px;
}
.segment.active {
  border-color: #d6e4df;
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgb(22 44 53 / 6%);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 22px;
}
.field:last-child {
  margin-bottom: 0;
}
.field label {
  color: #334b55;
  font-size: 16px;
  font-weight: 500;
}
.optional {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.required {
  margin-left: 3px;
  color: #af5147;
  font-size: 14px;
}
input:not([type="checkbox"]):not([type="file"]), textarea, select {
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid #cfd9de;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:not([type="checkbox"]):not([type="file"]), select {
  height: 48px;
}
select {
  padding-right: 32px;
  cursor: pointer;
}
select:invalid {
  color: #8a99a2;
}
select option {
  color: var(--ink);
}
textarea {
  min-height: 120px;
  resize: vertical;
}
input::placeholder, textarea::placeholder {
  color: #8a99a2;
  opacity: 1;
}
input:not([type="checkbox"]):not([type="file"]):hover, textarea:hover, select:hover {
  border-color: #9eb1ba;
}
input:not([type="checkbox"]):not([type="file"]):focus, textarea:focus, select:focus {
  border-color: var(--brand);
  outline: 0;
  box-shadow: 0 0 0 3px #e2f1ec;
}
input:disabled, textarea:disabled, select:disabled {
  background: #f4f6f7;
}
.field small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 22px;
}
.field-row .field {
  margin: 0;
}
.compact-field {
  max-width: 300px;
}
.input-affix {
  position: relative;
}
.input-affix span {
  position: absolute;
  top: 14px;
  left: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  pointer-events: none;
}
.input-affix input {
  padding-left: 55px !important;
}
.upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px;
  border: 1px dashed #a9c4bd;
  border-radius: 9px;
  background: #f6faf9;
  text-align: center;
  cursor: pointer;
}
.upload-zone svg {
  width: 28px;
  height: 28px;
  color: #537e72;
}
.upload-zone strong {
  color: var(--brand);
  font-size: 16px;
  font-weight: 500;
}
.upload-zone span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  font-weight: 400;
}
.upload-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.upload-zone:focus-within, .upload-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.image-preview {
  position: relative;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #425c64;
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 1px 4px #152d3826;
}
.submit-section {
  padding: 24px 30px;
  background: #fafcfc;
}
.submit-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 0;
}
.submit-row > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
/* Buttons and queue sidebar */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid #ccd8dd;
  border-radius: 7px;
  background: var(--surface);
  color: #3a535c;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.button:hover:not(:disabled) {
  border-color: #a5b9bd;
  background: #f3f7f7;
}
.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.button.primary:hover:not(:disabled) {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}
.button svg {
  width: 19px;
  height: 19px;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: #6d818a;
  font-size: 26px;
  line-height: 1;
}
.icon-button svg {
  width: 19px;
  height: 19px;
}
.icon-button:hover {
  border-color: #b9cbce;
  background: #f3f7f7;
  color: var(--brand);
}
.context-column {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.queue-summary {
  padding: 22px;
}
.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-topline h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}
.live-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.live-label .status-dot {
  width: 6px;
  height: 6px;
}
.queue-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.queue-metrics > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.queue-metrics > div + div {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.queue-metrics strong {
  color: #26474c;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.queue-metrics span {
  color: var(--muted);
  font-size: 14px;
}
.active-task {
  padding: 17px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  line-height: 1.6;
}
.active-task .active-task-title {
  display: block;
  margin-bottom: 6px;
  overflow: hidden;
  color: #36565b;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-task .active-task-stage {
  color: var(--muted);
  font-size: 13px;
}
.active-task button {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
.quiet {
  color: var(--muted);
  font-size: 13px;
}
.text-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin-top: 9px;
  padding: 8px 0 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.text-button span {
  font-size: 19px;
}
.text-button:hover {
  color: var(--brand-hover);
}
.submission-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.notice {
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid #ead8b8;
  border-radius: 8px;
  background: var(--warning-bg);
  color: #805d22;
  font-size: 14px;
  line-height: 1.7;
}
/* Task center */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.stat-card > span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}
.stat-card > strong {
  color: var(--ink);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat-card small {
  color: var(--muted);
  font-size: 13px;
}
.stat-card.green {
  border-color: #b9dcd0;
  background: #edf7f3;
}
.stat-card.green > span, .stat-card.green > strong {
  color: #176c57;
}
.jobs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.filter {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #6f8089;
  font-size: 14px;
  line-height: 1.6;
  white-space: nowrap;
}
.filter.active {
  border-color: #d6e9e2;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.filter:hover {
  background: #f2f6f5;
  color: var(--brand);
}
.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px 136px 72px;
  align-items: center;
  gap: 22px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.job-row:last-child {
  border-bottom: 0;
}
.job-row:hover {
  background: #fbfcfd;
}
.job-row > div {
  min-width: 0;
}
.job-title {
  padding: 0;
  border: 0;
  background: none;
  color: #284b54;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.65;
  text-align: left;
  overflow-wrap: anywhere;
}
.job-title:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.job-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.job-stage {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.job-date {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.row-open {
  min-height: 42px;
  padding: 8px 3px;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 14px;
  white-space: nowrap;
}
.row-open:hover {
  color: var(--brand-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #eef2f5;
  color: #677781;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}
.badge.running {
  border-color: #cae6dc;
  background: #e9f6f0;
  color: #1e7a5f;
}
.badge.completed {
  border-color: #d0e8da;
  background: #eff8f1;
  color: #347b4b;
}
.badge.queued {
  border-color: #efe1c1;
  background: #fff8e9;
  color: #9c762e;
}
.badge.failed, .badge.interrupted {
  border-color: #f0d9d3;
  background: var(--danger-bg);
  color: var(--danger);
}
.badge.needs_review, .badge.waiting_review, .badge.partial,
.badge.needs_credentials, .badge.waiting_credentials,
.badge.needs_approval, .badge.waiting_approval, .badge.needs_vision_approval {
  border-color: #eadbc5;
  background: #fff6e9;
  color: #966a32;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 40px 24px;
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid #dbe6e5;
  border-radius: 12px;
  background: #f0f6f4;
  color: #75978b;
  font-size: 28px;
  line-height: 1;
}
.empty-state h3 {
  margin: 20px 0 8px;
  color: #526f74;
  font-size: 18px;
  font-weight: 500;
}
.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 15px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
/* Task details and notifications */
dialog {
  width: min(740px, calc(100% - 40px));
  max-height: calc(100vh - 64px);
  padding: 0;
  overflow: auto;
  border: 1px solid #d5e0e3;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgb(21 45 56 / 24%);
}
dialog::backdrop {
  background: rgb(24 44 53 / 40%);
  backdrop-filter: blur(2px);
}
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 30px;
  border-bottom: 1px solid var(--line);
}
.dialog-header .eyebrow {
  margin-bottom: 7px;
  font-size: 13px;
}
.dialog-header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
#detail-content {
  padding: 26px 30px 30px;
}
.detail-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.detail-status > span:last-child {
  color: var(--muted);
  font-size: 14px;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 28px;
  margin: 0 0 26px;
}
.detail-grid > div {
  min-width: 0;
}
.detail-grid dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
}
.detail-grid dd {
  margin: 0;
  color: #35535d;
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.detail-grid .full-width {
  grid-column: 1 / -1;
}
.detail-grid dd a {
  color: var(--brand);
  text-underline-offset: 4px;
}
.detail-error {
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid #edd8cf;
  border-radius: 8px;
  background: #fff6f1;
  color: #965d44;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.detail-subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
.publication-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.artifact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.artifact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 56px;
  padding: 15px 16px;
  border: 1px solid #dce7e3;
  border-radius: 8px;
  background: #f7faf9;
  text-decoration: none;
}
.artifact:hover {
  border-color: #b9d6cb;
  background: #edf6f2;
}
.artifact-name {
  min-width: 0;
}
.artifact-name span {
  display: block;
  color: #356452;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.artifact small {
  display: block;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.artifact-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 14px;
  flex-shrink: 0;
}
.artifact-links a {
  color: var(--brand);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.artifact-links a:hover {
  text-decoration: underline;
}
.artifact-links .artifact-download {
  color: var(--muted);
}
.no-artifacts {
  margin: 0;
  padding: 10px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 100;
  max-width: min(600px, calc(100% - 32px));
  padding: 15px 22px;
  border-radius: 8px;
  background: #235e50;
  color: #fff;
  font-size: 15px;
  line-height: 1.7;
  box-shadow: 0 8px 30px rgb(21 45 56 / 18%);
  transform: translateX(-50%);
}
.toast.error {
  background: #995646;
}
.busy {
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive layout: keep text readable and reflow controls instead. */
@media (min-width: 1600px) {
  main {
    padding-top: 36px;
  }
  .create-layout {
    grid-template-columns: minmax(0, 1fr) 312px;
    gap: 28px;
  }
  .form-section, .submit-section {
    padding-left: 34px;
    padding-right: 34px;
  }
}

@media (max-width: 1220px) {
  :root {
    --sidebar-width: 216px;
  }
  .sidebar {
    padding-left: 14px;
    padding-right: 14px;
  }
  .brand {
    margin-left: 6px;
    gap: 9px;
  }
  .brand strong {
    font-size: 18px;
  }
  .brand small {
    font-size: 13px;
  }
  .topbar {
    padding-left: 28px;
    padding-right: 28px;
  }
  main {
    padding-left: 28px;
    padding-right: 28px;
  }
  .create-layout {
    grid-template-columns: minmax(0, 1fr) 268px;
    gap: 20px;
  }
  .form-section, .submit-section {
    padding-left: 24px;
    padding-right: 24px;
  }
  .queue-summary {
    padding: 20px;
  }
  .card-topline {
    flex-wrap: wrap;
  }
  .queue-metrics > div + div {
    padding-left: 16px;
  }
  .segment {
    padding-left: 7px;
    padding-right: 7px;
    font-size: 15px;
  }
  .segment svg {
    width: 17px;
    height: 17px;
  }
  .stats-grid {
    gap: 14px;
  }
  .stat-card {
    padding: 20px;
  }
  .job-row {
    grid-template-columns: minmax(0, 1fr) 126px 70px;
    gap: 16px;
  }
  .job-date {
    display: none;
  }
}

@media (max-width: 1080px) {
  .create-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .context-column {
    position: static;
  }
  .queue-summary {
    padding: 22px 24px;
  }
  .queue-metrics {
    max-width: 360px;
  }
  .active-task .active-task-title {
    white-space: normal;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .heading-tag {
    display: none;
  }
  .jobs-toolbar {
    align-items: flex-start;
    padding: 16px 18px;
  }
  .filters {
    gap: 4px;
  }
  .filter {
    padding-left: 11px;
    padding-right: 11px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 20px 22px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    margin: 0 0 18px;
  }
  .brand strong {
    font-size: 20px;
  }
  .brand small {
    font-size: 13px;
  }
  .workspace-label, .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    display: flex;
    gap: 10px;
  }
  .nav-item {
    width: auto;
    min-height: 48px;
    margin: 0;
    padding: 11px 16px;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    font-size: 16px;
  }
  .nav-arrow {
    display: none;
  }
  .app-shell {
    margin: 0;
  }
  .topbar {
    min-height: 58px;
    padding: 12px 22px;
  }
  .breadcrumb {
    gap: 8px;
    font-size: 13px;
  }
  .service-status {
    gap: 6px;
    font-size: 13px;
  }
  main {
    padding: 26px 22px 32px;
  }
  .page-heading {
    gap: 16px;
    margin-bottom: 22px;
  }
  h1 {
    font-size: 28px;
  }
  .page-heading > .button {
    padding-left: 15px;
    padding-right: 15px;
  }
  .form-section {
    padding: 24px;
  }
  .submit-section {
    padding: 22px 24px;
  }
  .job-row {
    padding: 20px;
  }
  .list-footer {
    padding: 15px 20px;
  }
}

@media (max-width: 520px) {
  .sidebar {
    padding: 18px 16px 0;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
  }
  .brand strong {
    font-size: 19px;
  }
  .sidebar nav {
    gap: 7px;
  }
  .nav-item {
    padding-left: 14px;
    padding-right: 14px;
  }
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 16px;
    min-height: 58px;
    padding: 12px 16px;
  }
  .breadcrumb {
    gap: 7px;
  }
  main {
    padding: 24px 16px 30px;
  }
  .page-heading {
    align-items: center;
    gap: 12px;
  }
  h1 {
    font-size: 28px;
  }
  .page-heading > .button {
    gap: 5px;
    padding: 10px 12px;
    font-size: 15px;
  }
  .form-section, .submit-section {
    padding: 22px 18px;
  }
  .section-heading {
    margin-bottom: 20px;
  }
  .segmented-control {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }
  .segment {
    min-height: 46px;
    padding: 11px 10px;
    font-size: 16px;
  }
  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .compact-field {
    max-width: none;
  }
  .field label {
    font-size: 16px;
  }
  .upload-zone {
    padding: 25px 14px;
  }
  .upload-zone span {
    font-size: 13px;
  }
  .image-preview {
    width: 82px;
    height: 82px;
  }
  .submit-row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .submit-row .button {
    width: 100%;
  }
  .queue-summary {
    padding: 22px;
  }
  .card-topline {
    flex-wrap: nowrap;
  }
  .queue-metrics {
    margin-top: 22px;
    margin-bottom: 22px;
  }
  .stats-grid {
    gap: 12px;
    margin-bottom: 20px;
  }
  .stat-card {
    gap: 10px;
    padding: 18px;
  }
  .stat-card > span {
    font-size: 15px;
  }
  .stat-card > strong {
    font-size: 32px;
  }
  .jobs-toolbar {
    gap: 8px;
    padding: 14px 12px;
  }
  .filters {
    flex: 1;
    gap: 4px;
  }
  .filter {
    min-height: 40px;
    padding: 7px 9px;
    font-size: 14px;
  }
  .icon-button {
    width: 42px;
    height: 42px;
  }
  .job-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 20px 18px;
  }
  .job-row > div:nth-child(2) {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
  }
  .job-stage {
    margin-top: 0;
  }
  .job-row > .row-open {
    display: none;
  }
  .job-title {
    font-size: 16px;
  }
  .job-subline {
    gap: 5px 12px;
  }
  .empty-state {
    min-height: 270px;
    padding: 32px 20px;
  }
  .list-footer {
    padding: 14px 18px;
  }
  dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 32px);
    border-radius: 12px;
  }
  .dialog-header {
    gap: 16px;
    padding: 22px;
  }
  .dialog-header h2 {
    font-size: 21px;
  }
  #detail-content {
    padding: 22px;
  }
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .artifact {
    gap: 12px;
    padding: 14px;
  }
  .artifact-name span {
    font-size: 15px;
  }
  .artifact-links {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
  .detail-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .detail-actions .button {
    width: 100%;
    white-space: normal;
  }
  .toast {
    bottom: 16px;
    width: max-content;
    padding: 14px 18px;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
