
.today-ops{
  margin-top: 6px;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(138,180,255,.26);
  background: linear-gradient(180deg, rgba(21, 31, 50, .84), rgba(15, 23, 39, .82));
  box-shadow: inset 0 0 0 1px rgba(138,180,255,.06);
}

.today-ops__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.today-ops__title{
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #dbe8ff;
  letter-spacing: .01em;
}

.today-ops__state{
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #c4d4ee;
  background: rgba(255,255,255,.03);
}

.today-ops__state.is-ready{
  border-color: rgba(118, 246, 208, .34);
  color: #abffdf;
}

.today-ops__state.is-running{
  border-color: rgba(255, 214, 104, .34);
  color: #ffe8ab;
}

.today-ops__state.is-error{
  border-color: rgba(255, 120, 143, .34);
  color: #ffb6c5;
}

.today-ops__state.is-muted{
  border-color: rgba(138,180,255,.24);
  color: #a4b5d2;
}

.today-ops__text{
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #ccdaef;
}

.today-ops__kpis{
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.today-ops__kpi{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(138,180,255,.24);
  background: rgba(255,255,255,.03);
  color: #cfe0f8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .01em;
}

.today-ops__kpi b{
  font-size: 11px;
  color: #f1f7ff;
}

.today-ops__kpi.is-ready{
  border-color: rgba(118, 246, 208, .34);
  color: #b7ffe5;
}

.today-ops__kpi.is-running{
  border-color: rgba(255, 214, 104, .34);
  color: #ffe8ab;
}

.today-ops__kpi.is-error{
  border-color: rgba(255, 120, 143, .34);
  color: #ffb6c5;
}

.today-ops__kpi.is-uploaded{
  border-color: rgba(118, 246, 208, .34);
  color: #abffdf;
}

.today-ops__actions{
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.today-ops__action{
  margin-top: 0;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.03);
  color: #d6e4fb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.today-ops__action:hover{
  border-color: rgba(138,180,255,.42);
  box-shadow: 0 0 0 1px rgba(138,180,255,.14);
}

.today-ops__action.is-primary{
  border-color: rgba(138,180,255,.40);
  background: linear-gradient(160deg, rgba(59,116,211,.30), rgba(32,169,209,.24));
  color: #eef8ff;
}

.today-ops__action.is-success{
  border-color: rgba(118, 246, 208, .34);
  background: rgba(26, 150, 114, .16);
  color: #d8fff3;
}

.today-ops__action.is-neutral{
  border-color: rgba(138,180,255,.24);
  color: #c6d4ec;
}

.job-history{
  margin-top: 6px;
  border: 1px solid rgba(138,180,255,.24);
  border-radius: 12px;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(19, 28, 46, .84), rgba(12, 18, 31, .80));
}

.job-history > summary{
  cursor: pointer;
  user-select: none;
  font-weight: 650;
  font-size: 13px;
  color: #e8f2ff;
}

.job-history__body{
  margin-top: 6px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(138,180,255,.45) rgba(255,255,255,.06);
  overscroll-behavior: contain;
  padding-right: 4px;
}

.job-history__body::-webkit-scrollbar{
  width: 8px;
  height: 8px;
}

.job-history__body::-webkit-scrollbar-thumb{
  border-radius: 999px;
  background: rgba(138,180,255,.42);
}

.job-history__body::-webkit-scrollbar-track{
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}

.job-history__body::-webkit-scrollbar-button{
  display: none;
  width: 0;
  height: 0;
}

.job-history__tools{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.job-history__filters,
.job-history__kpis{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.job-history__filter{
  margin-top: 0;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
  color: #c9d7ee;
  font-size: 11px;
  font-weight: 650;
}

.job-history__filter:hover{
  border-color: rgba(138,180,255,.42);
}

.job-history__filter.is-active{
  border-color: rgba(138,180,255,.52);
  background: linear-gradient(160deg, rgba(59,116,211,.25), rgba(32,169,209,.20));
  color: #eef8ff;
  box-shadow: 0 0 0 1px rgba(138,180,255,.14);
}

.job-history__kpi{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
  color: #c9d7ee;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .01em;
}

.job-history__kpi b{
  font-size: 11px;
  color: #eef8ff;
}

.job-history__kpi.is-error{
  border-color: rgba(255, 120, 143, .34);
  color: #ffb6c5;
}

.job-history__kpi.is-running{
  border-color: rgba(255, 214, 104, .34);
  color: #ffe8ab;
}

.job-history__kpi.is-uploaded{
  border-color: rgba(118, 246, 208, .34);
  color: #abffdf;
}

.job-history__kpi.is-muted{
  border-color: rgba(138,180,255,.24);
  color: #a4b5d2;
}

.job-history__list{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 680px){
  .job-history__list{
    grid-template-columns: 1fr;
  }
}

.job-history__item{
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(138,180,255,.16);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(13, 20, 34, .86), rgba(10, 16, 28, .82));
  min-width: 0;      /* Grid-Item darf nicht über die minmax(0,1fr)-Zelle hinauswachsen */
  overflow: hidden;  /* harter Clip als Absicherung gegen überlaufende Inhalte */
  content-visibility: auto;
  contain-intrinsic-size: 0 110px;
  contain: layout style;
}

.job-history__item-body{
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: space-between;
}

.job-history__left{
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.job-history__main{
  font-size: 12px;
  color: #eef5ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-history__prompt{
  font-size: 11px;
  line-height: 1.35;
  color: #b7c8e4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-history__chips{
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.job-history__chip{
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .01em;
  color: #bdd0ee;
  text-transform: uppercase;
}

.job-history__chip.is-media{
  border-color: rgba(138,180,255,.30);
  color: #dbe8ff;
}

.job-history__chip.is-ok{
  border-color: rgba(118, 246, 208, .34);
  color: #abffdf;
}

.job-history__chip.is-error{
  border-color: rgba(255, 120, 143, .34);
  color: #ffb6c5;
}

.job-history__chip.is-running{
  border-color: rgba(255, 214, 104, .34);
  color: #ffe8ab;
}

.job-history__chip.is-uploaded{
  border-color: rgba(118, 246, 208, .34);
  color: #abffdf;
}

.job-history__chip.is-muted{
  border-color: rgba(138,180,255,.24);
  color: #a4b5d2;
}

.job-history__meta{
  margin-top: 1px;
  font-size: 10px;
  color: #a6b8d6;
  opacity: .92;
}

.job-history__error{
  margin-top: 2px;
  font-size: 10px;
  color: #ffb8c4;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-history__actions{
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
}

/* Gemeinsame Basis für alle Action-Buttons */
.job-history__download,
.job-history__captions,
.job-history__upload,
.job-history__delete{
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  height: 28px;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.job-history__download{
  margin-top: 0;
  flex: 0 0 auto;
  max-width: none;
  min-width: 32px;
  width: 32px;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid rgba(138,180,255,.30);
  background: rgba(92,138,209,.14);
  color: #dbe8ff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.job-history__download:hover{
  box-shadow: 0 0 0 1px rgba(138,180,255,.20), 0 0 10px rgba(63,233,255,.10);
}

.job-history__captions{
  margin-top: 0;
  min-width: 30px;
  padding: 3px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255, 214, 104, .34);
  background: rgba(118, 94, 26, .18);
  color: #ffe8ab;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.job-history__captions:hover{
  box-shadow: 0 0 0 1px rgba(255, 214, 104, .24), 0 0 10px rgba(255, 214, 104, .14);
}

.job-history__upload{
  margin-top: 0;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(118, 246, 208, .34);
  background: rgba(26, 150, 114, .16);
  color: #d8fff3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.job-history__upload:hover{
  box-shadow: 0 0 0 1px rgba(118, 246, 208, .26), 0 0 10px rgba(44, 245, 186, .14);
}

.job-history__upload:disabled{
  opacity: .65;
  cursor: wait;
}

/* Titel-Zeile: Text + kleiner Prompt-Button rechts */
.job-history__title-row{
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.job-history__title-row .job-history__main{
  flex: 1;
  min-width: 0;
}
.job-history__prompt-inline{
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(160, 195, 255, .55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: color .12s, background .12s;
  line-height: 1;
  font-size: 0;
  margin-top: 2px;
  align-self: flex-start;
}
.job-history__prompt-inline svg{
  width: 13px;
  height: 13px;
  display: block;
  flex-shrink: 0;
}
.job-history__prompt-inline:hover{
  color: #9ec8ff;
  background: rgba(138, 180, 255, .12);
}

.job-history__delete{
  margin-top: 0;
  flex: 0 0 auto;
  max-width: none;
  min-width: 32px;
  width: 32px;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 120, 143, .36);
  background: rgba(122, 32, 52, .18);
  color: #ffd1dc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.job-history__delete:hover{
  box-shadow: 0 0 0 1px rgba(255, 120, 143, .24), 0 0 10px rgba(255, 120, 143, .14);
}

/* Icon span für mask-image basierte Icons */
.cd-icon-mask {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  flex-shrink: 0;
}
.cd-icon-mask--trash {
  width: 15px;
  height: 15px;
  -webkit-mask-image: url('/static/icons/trash.svg');
  mask-image: url('/static/icons/trash.svg');
}

.job-history__upload-arrow{
  color: #b9ffe9;
  opacity: .95;
}

.job-history__upload-icon{
  width: 13px;
  height: 13px;
  display: block;
}

.job-history__empty{
  font-size: 12px;
  opacity: .8;
  padding: 4px 0;
}

/* ── Thumbnail in history items ─────────────────────────────────────────── */
.job-history__thumb{
  flex-shrink: 0;
  width: 60px;
  border-radius: 8px;
  overflow: hidden;
  align-self: stretch;
  min-height: 96px;
  background: rgba(0,0,0,.35);
  cursor: pointer;
}
.job-history__thumb video{
  display: block;
  width: 60px;
  height: 100%;
  min-height: 96px;
  object-fit: cover;
  border-radius: 8px;
  transition: opacity .15s;
}
.job-history__thumb:hover video{
  opacity: .82;
}

/* ── Load-more button ───────────────────────────────────────────────────── */
.job-history__load-more{
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(138,180,255,.22);
  background: rgba(138,180,255,.04);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  color: #b8ceee;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.job-history__load-more:hover{
  border-color: rgba(138,180,255,.38);
  background: rgba(138,180,255,.09);
  color: #dbe8ff;
}

.job-history__toggle-wrap{
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.job-history__toggle{
  margin-top: 0;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(138,180,255,.30);
  background: rgba(62, 70, 108, .32);
  color: #dbe8ff;
  font-size: 11px;
  font-weight: 650;
}

.job-history__toggle:hover{
  border-color: rgba(138,180,255,.42);
  box-shadow: 0 0 0 1px rgba(138,180,255,.18), 0 0 10px rgba(63,233,255,.10);
}

.debug{ margin-top: 10px; opacity: .9; }

/* App: "Advanced" section */
.advanced__row{
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}
.advanced__item{
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  padding: 10px;
}

.advanced__item-help{
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.35;
  opacity: .75;
}

#clear{
  margin-top: 0;
  align-self: flex-start;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(138,180,255,.30);
  background: linear-gradient(160deg, rgba(62, 70, 108, .50), rgba(34, 40, 64, .62));
  color: #dbe8ff;
  font-size: 12px;
  font-weight: 600;
}

#clear:hover{
  border-color: rgba(138,180,255,.44);
  box-shadow: 0 0 0 1px rgba(138,180,255,.20), 0 0 14px rgba(63,233,255,.12);
}
.advanced__health{
  margin-top: 10px;
  opacity: .82;
  font-size: 12px;
}
.advanced__health a{
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(138,180,255,.26);
  background: rgba(62, 70, 108, .28);
  color: #cfe0ff;
  text-decoration: none;
  font-weight: 600;
}

.advanced__health a:hover{
  border-color: rgba(138,180,255,.40);
  box-shadow: 0 0 0 1px rgba(138,180,255,.16), 0 0 10px rgba(63,233,255,.10);
}

.advanced__meta-row{
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,.02);
}

.advanced__meta-label{
  font-size: 12px;
  color: #d0dbf7;
  opacity: .82;
}

.advanced__copy-btn{
  margin-top: 0;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(138,180,255,.35);
  background: rgba(92,138,209,.18);
  color: #dbe8ff;
  font-size: 12px;
  font-weight: 600;
}

.advanced__copy-btn:hover{
  box-shadow: 0 0 0 1px rgba(138,180,255,.25), 0 0 12px rgba(63,233,255,.12);
}

@media (max-width: 700px){
  .cd-top-controls{
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .cd-image-controls{
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }

  .cd-top-controls .cd-top-item:last-child{
    justify-self: end;
    min-width: 96px;
  }

  .advanced__meta-row{
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px){
  .cd-top-controls{
    grid-template-columns: 1fr;
  }

  .cd-image-controls{
    grid-template-columns: 1fr;
  }

  .cd-top-controls .cd-top-item:last-child{
    justify-self: start;
    min-width: 0;
  }

  /* History thumbnails kleiner auf kleinen Screens */
  .job-history__thumb{
    width: 54px;
    min-height: 96px;
  }
  .job-history__thumb video{
    width: 54px;
    min-height: 96px;
  }
}

