body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--sl-color-neutral-50);
  color: var(--sl-color-neutral-900);
}
:root[data-theme="dark"] body {
  background: var(--sl-color-neutral-900);
  color: var(--sl-color-neutral-100);
}
header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.app-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
#filterInput {
  max-width: 280px;
}
#sortSelect::part(combobox) {
  min-width: 150px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 0 24px 24px;
}
.card {
  background: var(--sl-panel-background-color);
  border: 1px solid var(--sl-color-neutral-200);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sl-shadow-small);
  display: flex;
  flex-direction: column;
  min-height: 260px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sl-shadow-medium);
}
.thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--sl-color-neutral-200);
}
.card-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.title {
  font-weight: 700;
  font-size: 15px;
}
.empty {
  padding: 24px;
  color: var(--sl-color-neutral-500);
}
.add-card {
  border: 1px dashed var(--sl-color-primary-500);
  color: var(--sl-color-primary-600);
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}
.add-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sl-shadow-medium);
}
.add-icon {
  font-size: 28px;
  line-height: 1;
}
.add-text {
  font-weight: 700;
}
.duration-badge {
  position: relative;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.badge-group {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
  z-index: 2;
}
.done-check {
  position: relative;
  height: 100%;
  min-height: 22px;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 8px;
  background: #22c55e;
  color: #0b3b19;
  font-weight: 800;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.workflow-steps {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.wf-step {
  display: grid;
  grid-template-columns: 24px 1fr max-content;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--sl-color-neutral-200);
  border-radius: 8px;
}
.wf-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sl-color-neutral-200);
}
.wf-title {
  font-weight: 700;
}
.wf-desc {
  font-size: 12px;
  color: var(--sl-color-neutral-500);
}
.wf-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wf-spinner {
  display: none;
  font-size: 16px;
  min-width: 0;
  min-height: 0;
  --indicator-color: var(--sl-color-primary-600);
  --track-width: 2px;
  vertical-align: middle;
  line-height: 0;
  transform-origin: center;
  align-items: center;
  justify-content: center;
}
.wf-icon {
  display: none;
  color: #22c55e;
}
.wf-rerun {
  display: inline-flex;
  font-size: 12px;
  padding: 0;
}
.wf-step.active .wf-dot {
  background: var(--sl-color-primary-500);
}
.wf-step.active .wf-spinner {
  display: inline-flex;
}
.wf-step.success .wf-dot {
  background: #22c55e;
}
.wf-step.success .wf-icon {
  display: inline-block;
  color: #22c55e;
}
.wf-step.error {
  border-color: #ef4444;
}
.wf-step.error .wf-dot {
  background: #ef4444;
}
.wf-actions {
  justify-self: end;
}
.wf-tip {
  margin-top: 4px;
  font-size: 12px;
  color: var(--sl-color-neutral-600);
  line-height: 1.4;
}
.wf-step > .wf-spinner {
  justify-self: end;
  align-self: center;
}
.confirm-text a {
  color: var(--sl-color-primary-600);
}
.card-gear {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: var(--sl-panel-background-color);
  border-radius: 999px;
  box-shadow: var(--sl-shadow-small);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.card:hover .card-gear {
  opacity: 1;
}
.ingest-dialog::part(header) {
  display: none;
}
.ingest-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.ingest-footer-actions {
  display: inline-flex;
  gap: 8px;
}
