.production-help-launch {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line));
}

.ad-studio-head-actions,
.production-help-project {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}

.production-help-project {
  justify-content: flex-end;
  margin-block: .75rem .5rem;
}

.production-help-dialog {
  --director-inset: clamp(.9rem, 3vw, 1.4rem);
  width: min(45rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  padding: 0;
  color: var(--text);
  background: var(--surface, #15131e);
  border: 1px solid var(--line-2);
  border-radius: 1.1rem;
  box-shadow: 0 1.5rem 4rem #0007;
}

.production-help-dialog::backdrop {
  background: #090713cf;
}

.production-help-dialog form {
  display: grid;
  grid-template-rows: auto minmax(5.5rem, 1fr) auto;
  height: min(42rem, calc(100dvh - 1.75rem));
}

.production-help-dialog form:has(#productionHelpRepairRow:not([hidden])) {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.production-help-header,
.production-help-body,
.production-help-footer {
  padding: .9rem var(--director-inset);
}

.production-help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: .8rem;
}

.production-help-header :is(h3, p),
.production-help-welcome :is(h4, p) {
  margin: 0;
}

.production-help-header h3 {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.production-help-header h3 .ic {
  color: var(--accent-2);
}

.production-help-header p {
  color: var(--muted);
  font-size: .85rem;
  margin-top: .25rem;
}

.production-help-header .x {
  position: static;
  flex: none;
}

.production-help-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.production-help-context {
  display: grid;
  gap: .15rem;
  padding: .65rem .75rem;
  margin-bottom: .8rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  overflow-wrap: anywhere;
}

.production-help-context span {
  color: var(--muted);
  font-size: .8rem;
}

.production-help-context p {
  margin: 0;
}

.production-help-context > button {
  justify-self: start;
  margin-top: .35rem;
}

.production-help-dialog[data-references] .production-help-footer {
  display: none;
}

.production-help-references {
  display: grid;
  gap: .65rem;
  overflow-wrap: anywhere;
}

.production-help-references :is(h4, h5, p) {
  margin: 0;
}

.production-help-reference-progress {
  font-weight: 650;
}

.production-help-reference-consent {
  display: flex;
  align-items: start;
  gap: .55rem;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  font-size: .85rem;
}

.production-help-reference-consent input {
  flex: none;
  margin-top: .22rem;
  accent-color: var(--accent-2);
}

.production-help-reference-group ul {
  list-style: none;
  margin: .35rem 0 0;
  padding: 0;
}

.production-help-reference-group li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .65rem;
  padding: .42rem 0;
  border-bottom: 1px solid var(--line);
}

.production-help-reference-group img {
  width: 2rem;
  height: 2rem;
  border-radius: .3rem;
  object-fit: cover;
}

.production-help-reference-group strong {
  flex: 1 1 9rem;
}

.production-help-welcome {
  padding: clamp(.75rem, 3vh, 1.65rem) 0;
}

.production-help-welcome h4 {
  margin-bottom: .3rem;
  font-size: clamp(1.1rem, 3.7vw, 1.4rem);
  line-height: 1.25;
}

.production-help-messages {
  display: grid;
  gap: .65rem;
}

.production-help-bubble {
  min-width: 0;
  max-width: 96%;
  width: fit-content;
  padding: .65rem .8rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: .75rem;
  font-size: .9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.production-help-bubble.from-user {
  justify-self: end;
  background: color-mix(in srgb, var(--accent-2) 12%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent-2) 35%, var(--line));
  border-bottom-right-radius: .25rem;
}

.production-help-bubble.from-director {
  border-bottom-left-radius: .25rem;
}

.production-help-bubble b {
  display: block;
  margin-bottom: .2rem;
  font-size: .77rem;
  color: var(--text-2);
}

.production-help-bubble p,
.production-help-bubble pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.production-help-bubble details {
  margin-top: .55rem;
}

.production-help-bubble summary {
  cursor: pointer;
  font-weight: 650;
}

.production-help-bubble pre {
  max-height: min(15rem, 35vh);
  margin-top: .45rem;
  padding: .55rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--surface);
  font: inherit;
}

.production-help-action-list,
.production-help-quick,
.production-help-options,
.production-help-send-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

.production-help-action-list {
  margin-top: .6rem;
}

.production-help-action-list .btn {
  white-space: normal;
  text-align: start;
}

.production-help-image {
  display: block;
  max-width: 100%;
  max-height: 20rem;
  margin-top: .6rem;
  border-radius: .55rem;
  object-fit: contain;
}

.production-help-sources {
  margin-block: .25rem 0;
  padding-inline-start: 1.2rem;
}

.production-help-status {
  margin: .65rem 0 0;
  color: var(--text-2);
  font-size: .85rem;
}

.production-help-status:empty {
  display: none;
}

.director-video-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem .65rem;
  margin-top: .45rem;
}
.director-video-options label { min-width: 0; font-size: .78rem; color: var(--text-2); }
.director-video-options select { display: block; width: 100%; max-width: 100%; margin-top: .2rem; }
.director-video-job { margin-block: .65rem; }
.director-video-job video { width: 100%; max-height: 38vh; display: block; margin-top: .5rem; background: #111; border-radius: .5rem; }
.director-video-job progress { width: 100%; accent-color: var(--accent-2); }
.director-video-job .btn { margin: .3rem .4rem 0 0; }

.production-help-status[data-error] {
  color: var(--warn, #fbbf24);
}

.production-help-footer {
  display: grid;
  gap: .6rem;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.production-help-fields {
  display: grid;
  min-width: 0;
  gap: .55rem;
}

.production-help-quick button,
.production-help-options label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
}

.production-help-quick button {
  padding: .35rem .6rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: .55rem;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}

.production-help-quick button[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 14%, var(--surface));
}

.production-help-quick button:disabled {
  opacity: .62;
  cursor: default;
}

.production-help-quick .ic {
  width: .9rem;
  height: .9rem;
}

.production-help-composer .label {
  margin: 0 0 .2rem;
}

.production-help-composer textarea {
  width: 100%;
  min-height: 3.4rem;
  max-height: 7rem;
  resize: vertical;
}

#productionHelpRepairRow {
  margin-bottom: .45rem;
}

.production-help-options {
  margin-top: .25rem;
  font-size: .82rem;
  color: var(--text-2);
}

.production-help-options input[type="number"] {
  width: 4.25em;
  padding: .3rem;
}

.production-help-options input[type="checkbox"] {
  width: 1em;
  height: 1em;
  accent-color: var(--accent-2);
}

.production-help-cost {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .45rem .8rem;
  font-size: .84rem;
}

.production-help-cost > span {
  display: grid;
}

.production-help-cost strong + span {
  color: var(--muted);
}

.production-help-note {
  margin: 0;
  line-height: 1.3;
}

@media (max-width: 460px) {
  .production-help-dialog {
    width: calc(100% - .75rem);
    max-height: calc(100dvh - .75rem);
    border-radius: .9rem;
  }

  .production-help-dialog form {
    height: calc(100dvh - 1rem);
  }

  .production-help-quick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(4.8rem, 1fr));
  }

  .production-help-quick button {
    justify-content: center;
    padding-inline: .2rem;
  }
}

@media (max-width: 335px) {
  .production-help-quick .ic { display: none; }
}
