.draft-import-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.draft-import-entry h3 { margin: 0; }

.draft-import-entry p { margin-block-end: 0; }

.education-dialog:has(.draft-import-form) { width: min(840px, calc(100% - 24px)); }

.education-dialog > .draft-import-form { gap: 10px; }

.draft-import-form p { margin: 0; }

.draft-import-form:has(.draft-import-work:not([hidden])) .draft-import-intro { display: none; }

.draft-import-form .actions { margin: 0; }

.draft-import-work {
  display: grid;
  grid-template-columns: minmax(160px, 230px) minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

.draft-import-queue {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  max-height: min(350px, 55dvh);
  margin: 0;
  padding: 4px;
  overflow: auto;
  background: var(--study-surface);
  border: 1px solid var(--study-line);
  border-radius: 6px;
  list-style: none;
}

.draft-import-queue button {
  display: grid;
  justify-items: start;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  text-align: left;
  scroll-margin-block: 4px;
}

.draft-import-queue button[aria-current="true"] {
  color: var(--study-action);
  background: var(--study-active);
  border-color: var(--study-control-line);
}

.draft-import-file-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-import-badge, .draft-import-message, .draft-import-status { color: var(--study-muted); font-size: .8125rem; }
.draft-import-form [data-state$="-error"] { color: var(--study-danger, #a3374c); }

.draft-import-preview { display: grid; align-content: start; gap: 6px; min-width: 0; }
.draft-import-preview h4 { margin: 0; overflow-wrap: anywhere; font-size: .9375rem; }
.draft-import-item-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; }
.draft-import-item-heading h4 { min-width: 0; }
.draft-import-fields { display: grid; gap: 8px; }

.draft-import-form [hidden], .draft-import-status:empty { display: none; }

.draft-import-form label { display: grid; gap: 4px; }
.draft-import-destination { display: flex; align-items: end; flex-wrap: wrap; gap: 8px 14px; padding-block: 8px; border-block: 1px solid var(--study-line); }
.draft-import-destination label { font-size: .85rem; color: var(--study-muted); }
.draft-import-destination label:last-child { flex: 1 1 14rem; }
.draft-import-destination select { min-height: 42px; }
.draft-import-item-path { max-width: 100%; overflow-wrap: anywhere; color: var(--study-muted); font-size: .75rem; }
.draft-import-item-path:empty, .draft-import-filter:empty { display: none; }
.draft-import-filter { color: var(--study-muted); font-size: .82rem; }

.draft-import-form :is(input, textarea) { width: 100%; box-sizing: border-box; }
.draft-import-photo-modes {
  display: flex;
  gap: 3px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 3px;
  background: var(--study-side);
  border: none;
  border-radius: var(--study-radius);
}
.draft-import-photo-modes legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.draft-import-photo-modes label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 4px;
  font: 560 .87rem/1.45 var(--study-body);
  cursor: pointer;
}
.draft-import-photo-modes label:has(:checked) { background: var(--study-surface); color: var(--study-action); }
.draft-import-photo-modes label:focus-within { outline: 2px solid var(--study-action); }
.draft-import-photo-modes input[type=radio] { width: 14px; height: 14px; min-height: 0; padding: 0; margin: 0; }
.draft-import-fields [data-import-photo-preview] {
  width: 100%;
  height: clamp(110px, 25dvh, 240px);
  object-fit: contain;
  background: var(--study-canvas);
  border: 1px solid var(--study-line);
  border-radius: var(--study-radius);
}

.draft-import-form textarea { resize: vertical; min-height: 80px; height: clamp(94px, 23dvh, 190px); }
.draft-import-form .draft-import-markdown {
  font-family: ui-monospace, Consolas, monospace;
  line-height: 1.6;
  tab-size: 4;
}

.work-dialog > .draft-import-form > .draft-import-footer {
  position: sticky;
  bottom: -18px;
  z-index: 1;
  justify-content: space-between;
  padding-block: 7px;
  background: var(--study-paper);
  border-top: 1px solid var(--study-line);
}

.work-dialog > .draft-import-form > .draft-import-footer[hidden] { display: none; }

.draft-import-item-actions:has(> :not([hidden])) { align-items: center; }
.draft-import-item-actions:not(:has(> :not([hidden]))) { display: none; }

.draft-import-footer a { min-height: 40px; display: inline-flex; align-items: center; }

@media (max-width: 700px) {
  .draft-import-work { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .draft-import-queue { flex-direction: row; max-height: none; }
  .draft-import-queue li { flex: 0 0 auto; max-width: min(170px, 70%); min-width: 0; }
  .draft-import-queue button { padding: 5px 8px; line-height: 1.3; }
  .draft-import-preview { gap: 4px; }
  .draft-import-fields { gap: 5px; }
  .draft-import-form textarea { height: 94px; }
  .work-dialog > .draft-import-form > .draft-import-footer { bottom: -15px; }
}
