/* Results: readable details and full-size actions beside the existing preview. */
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row {
  gap: 0 28px !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-main {
  padding: 6px 2px 20px !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-main h3 {
  margin: 0 0 17px !important;
  font-size: 16px !important;
  font-weight: 550 !important;
  line-height: 1.75 !important;
  letter-spacing: 0 !important;
  -webkit-line-clamp: 4;
  overflow-wrap: anywhere;
  color: var(--studio-text) !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-parameter-chips {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px !important;
  margin: 0 0 12px !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-parameter-chips span {
  min-height: 27px;
  padding: 5px 9px !important;
  border: 1px solid var(--studio-line) !important;
  border-radius: 7px !important;
  color: var(--studio-sub) !important;
  background: var(--studio-soft) !important;
  font-size: 12px !important;
  line-height: 16px !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-status-row {
  display: flex !important;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 9px !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-status-row :is(.badge,.project-chip) {
  display: inline-flex;
  align-items: center;
  height: 25px !important;
  max-width: 200px;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 19px !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-meta {
  margin: 3px 14px 5px 0 !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  color: var(--studio-muted) !important;
  overflow-wrap: anywhere;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-failure-reason {
  font-size: 13px !important;
  line-height: 1.65 !important;
  margin: 9px 0 12px;
  overflow-wrap: anywhere;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-actions {
  gap: 9px !important;
  padding: 14px 0 0 !important;
  border-top: 1px solid var(--studio-line) !important;
  align-self: end !important;
  justify-content: flex-start !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 84px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 16px !important;
  border-radius: 9px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 20px !important;
  white-space: nowrap !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-actions > .menu-btn { min-width: 64px !important; }
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(.job-actions,.card-actions) > .download-action {
  border-color: var(--studio-primary) !important;
  color: var(--studio-on-accent,#fff) !important;
  background: var(--studio-primary) !important;
  font-weight: 600 !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(.job-actions,.card-actions) > .download-action:hover {
  border-color: var(--studio-accent) !important;
  background: color-mix(in srgb,var(--studio-primary) 88%,white) !important;
  color: var(--studio-on-accent,#fff) !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(.job-actions,.card-actions) > button:focus-visible {
  outline: 2px solid var(--studio-accent);
  outline-offset: 3px;
}

/* Grid view keeps its density, while allowing every action label to fit. */
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) .work-card .work-title {
  font-size: 15px !important;
  font-weight: 550 !important;
  line-height: 1.65 !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) .work-card :is(.work-status,.work-params,.work-cost,.work-project .project-chip) {
  font-size: 12px !important;
  line-height: 1.6 !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) .work-card .card-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  margin-top: 14px !important;
  padding-top: 12px;
  border-top: 1px solid var(--studio-line);
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) .work-card .card-actions > button {
  flex: 1 0 auto !important;
  width: auto !important;
  min-width: 64px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 11px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 18px !important;
  white-space: nowrap;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) .work-card .card-actions > .menu-btn { flex-grow: 0 !important; }

/* Each generated image keeps its own preview and download target. */
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(.thumb,.work-media,.project-work-media) .job-image-gallery {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  grid-auto-rows: minmax(0,1fr);
  align-items: stretch;
  gap: 7px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 33px 8px 8px;
  background: #101114;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #555b6c #101114;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) .job-image-gallery:has(.job-image-cell:nth-child(n+5)) { grid-auto-rows: minmax(108px,1fr); }
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) .job-image-cell {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  border: 1px solid #ffffff14;
  border-radius: 7px;
  background: #191b21;
  overflow: hidden;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(.thumb,.work-media,.project-work-media) .job-image-item {
  position: relative !important;
  display: grid !important;
  place-items: center;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: #101114 !important;
  overflow: hidden;
  cursor: zoom-in;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(.thumb,.work-media,.project-work-media) .job-image-item img {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) .job-image-item > span {
  position: absolute;
  z-index: 2;
  left: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid #ffffff2b;
  border-radius: 6px;
  background: #14171fe6;
  color: #e1e7f4;
  font-size: 10px;
  font-weight: 500;
  line-height: 20px;
  pointer-events: none;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(.thumb,.work-media,.project-work-media) .job-image-download {
  position: absolute !important;
  right: 5px;
  bottom: 5px;
  z-index: 3;
  display: grid !important;
  place-items: center;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid #ffffff35 !important;
  border-radius: 7px !important;
  background: #1a2239e8 !important;
  color: #e7edff !important;
  font-size: 14px !important;
  line-height: 1 !important;
  cursor: pointer;
}
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) .job-image-download svg { width: 15px; height: 15px; }
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) .job-image-download:hover { background: var(--studio-primary) !important; }
html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(.job-image-item,.job-image-download):focus-visible { outline: 2px solid #a3b5ff; outline-offset: -3px; }

@container history-list (max-width: 640px) {
  html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row { gap: 17px 0 !important; }
  html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-main { padding: 0 !important; }
  html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-main h3 { margin-bottom: 14px !important; font-size: 15px !important; }
  html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-actions { padding-top: 13px !important; gap: 8px !important; }
  html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-actions > button { flex: 1 0 auto !important; min-width: 68px !important; padding: 0 12px !important; font-size: 13px !important; }
  html body.reference-ui-shell[data-studio-ui] :is(#view-work,#view-projects) :is(#jobBoard[data-view-mode="list"],.project-work-grid.is-list) .job-row .job-actions > .menu-btn { flex-grow: 0 !important; min-width: 60px !important; }
}
