.ingredient-modal {
  width: min(900px, calc(100vw - 32px));
  max-width: 900px;
  padding: 12px;
  border-radius: 24px;
  background: #151616;
  overflow: hidden;
}
.ingredient-top {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
}
.ingredient-top select {
  width: 150px;
  min-width: 100px;
  text-overflow: ellipsis;
}
.ingredient-top label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  background: #292a2b;
  border-radius: 12px;
  padding: 0 12px;
}
.ingredient-top input {
  border: 0;
  background: transparent;
  padding: 12px 0;
  outline: none;
  min-width: 0;
  width: 100%;
  color: var(--text);
}
.ingredient-top select,
.ingredient-sort select {
  border: 0;
  border-radius: 12px;
  background: #292a2b;
  color: var(--muted);
  padding: 10px;
  font: inherit;
}
.ingredient-body {
  display: grid;
  grid-template-columns: 132px minmax(190px, 1fr) minmax(280px, 1.5fr);
  height: min(570px, calc(100dvh - 160px));
  gap: 8px;
}
.ingredient-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}
.ingredient-tabs button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: #8c8d8e;
  text-align: left;
}
.ingredient-tabs button[aria-selected="true"] {
  background: #444746;
  color: white;
}
.ingredient-tabs span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.ingredient-tabs .icon {
  flex-shrink: 0;
  width: 19px;
}
.ingredient-tabs #ingredient-upload {
  margin-top: auto;
  color: var(--text);
}
.ingredient-list-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #353636;
  padding-right: 5px;
}
.ingredient-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8a8a8a;
  font-size: 12px;
  margin-bottom: 5px;
}
.ingredient-sort select {
  background: none;
  padding: 4px;
  font-size: 12px;
}
#ingredient-list {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}
#ingredient-list [role="option"] {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 5px;
  border: 0;
  border-radius: 15px;
  background: none;
  text-align: left;
  color: var(--text);
}
#ingredient-list [aria-selected="true"] {
  background: #444746;
}
#ingredient-list img,
#ingredient-list video,
.voice-art {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  object-fit: cover;
  flex-shrink: 0;
}
.voice-art {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #233050;
}
#ingredient-list strong,
#ingredient-list small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#ingredient-list strong {
  font-size: 14px;
  font-weight: 500;
}
#ingredient-list small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
#ingredient-list [role="option"] > span:last-child {
  min-width: 0;
}
#ingredient-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  background: #202222;
  border-radius: 18px;
  padding: 8px;
  scrollbar-width: thin;
}
.voice-preview {
  min-height: 128px;
  border-radius: 17px;
  display: grid;
  place-items: center;
}
.voice-preview button {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #182237;
  font-size: 13px;
  padding: 12px;
}
.voice-preview .icon {
  width: 26px;
  height: 26px;
  background: #ffffff30;
  border-radius: 7px;
  padding: 6px;
}
.voice-field {
  background: #292b2b;
  border-radius: 14px;
  padding: 12px;
}
.voice-field > span {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.voice-field textarea {
  display: block;
  resize: vertical;
  min-height: 72px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--text);
  outline: none;
  margin-top: 7px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}
.voice-name {
  font-size: 12px;
  color: var(--muted);
}
.voice-name[hidden] {
  display: none;
}
.voice-name input {
  display: block;
  width: 100%;
  border: 1px solid #444;
  background: #292b2b;
  color: var(--text);
  padding: 8px;
  border-radius: 9px;
  margin-top: 4px;
}
.voice-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.voice-actions .primary-button {
  flex: 1;
}
.ingredient-modal .primary-button {
  padding: 9px 14px;
  min-height: 36px;
  border-radius: 12px;
  justify-content: center;
}
.ingredient-note {
  font-size: 12px;
  line-height: 1.45;
  color: #929797;
  margin: 2px 4px;
}
.ingredient-empty {
  color: #8e9393;
  text-align: center;
  line-height: 1.6;
  font-size: 13px;
  padding: 24px 10px;
  margin: auto;
}
.ingredient-empty .icon {
  width: 30px;
  height: 30px;
}
.ingredient-empty h3 {
  color: var(--text);
}
.ingredient-media-preview {
  display: grid;
  place-items: center;
  min-height: 200px;
  flex: 1;
  max-height: 330px;
  background: #151616;
  border-radius: 13px;
  overflow: hidden;
}
.ingredient-media-preview img,
.ingredient-media-preview video {
  max-width: 100%;
  max-height: 330px;
  object-fit: contain;
}
.ingredient-description {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: 2px 4px;
  max-height: 100px;
  overflow: auto;
}
.ingredient-name {
  font-size: 14px;
  margin: 4px;
}
.voice-attachment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  min-width: 100px;
  max-width: 200px;
  height: 64px;
  background: #525580;
  border-radius: 12px;
  position: relative;
  color: white;
}
.voice-attachment small {
  padding-right: 12px;
}
.voice-attachment button {
  position: absolute;
  right: 3px;
  top: 3px;
  background: #0008;
  color: white;
  border: 0;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  padding: 3px;
}
.voice-attachment .icon {
  width: 18px;
}
.attachment-warning {
  color: #eab668;
  font-size: 12px;
  align-self: center;
  max-width: 180px;
}
@media (max-width: 720px) {
  .ingredient-modal {
    padding: 8px;
  }
  .ingredient-body {
    grid-template-columns: 46px 130px minmax(150px, 1fr);
    gap: 4px;
  }
  .ingredient-tabs span {
    display: none;
  }
  .ingredient-tabs button {
    padding: 11px;
  }
  .ingredient-top select {
    width: 110px;
    font-size: 12px;
  }
  #ingredient-list img,
  #ingredient-list video,
  .voice-art {
    width: 30px;
    height: 36px;
  }
  #ingredient-list strong {
    font-size: 12px;
  }
  #ingredient-list small {
    font-size: 12px;
  }
  .voice-preview {
    min-height: 90px;
  }
  .voice-preview button {
    font-size: 12px;
  }
  .voice-field {
    padding: 8px;
  }
  .voice-field textarea {
    font-size: 12px;
  }
  .ingredient-note {
    font-size: 12px;
  }
}
.ingredient-modal [hidden] {
  display: none !important;
}
.history-modal {
  max-width: 780px;
  width: calc(100vw - 32px);
}
.job-history article {
  border-top: 1px solid var(--line);
  padding: 15px 0;
}
.job-history small {
  display: block;
  color: var(--subtle);
  margin-top: 6px;
}
.job-history p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.job-history article > div {
  display: flex;
  gap: 10px;
}
