.draft-history[hidden],
.assist-home[hidden] {
  display: none !important;
}
.draft-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.draft-history-heading h2 {
  margin: 0;
  font-size: 17px;
}
.draft-history-toggle {
  min-height: 44px;
  white-space: nowrap;
}
.draft-history-toggle svg {
  transition: transform 0.15s;
}
.draft-history-toggle svg.is-open {
  transform: rotate(180deg);
}
.draft-history-panel {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}
.draft-history-embedded .draft-history-panel {
  margin-top: 24px;
  padding-top: 20px;
}
.draft-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.draft-history-toolbar label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.draft-history-toolbar select {
  width: auto;
  min-width: 155px;
  min-height: 44px;
}
.draft-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.draft-history-list > li {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 4px;
  min-width: 0;
}
.draft-history-open {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 145px 20px;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-height: 104px;
  padding: 16px 12px;
  background: transparent;
  border: 0;
  color: inherit;
  border-radius: 8px;
}
.draft-history-open:hover {
  background: #2865e80a;
}
.draft-history-open strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.5;
}
.draft-history-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.draft-history-subject {
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.draft-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.draft-history-open time {
  font-size: 12px;
  color: var(--muted);
}
.draft-history-kind {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
}
.draft-history-more {
  position: relative;
  flex: none;
}
.draft-history-more summary {
  display: grid;
  place-items: center;
  list-style: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--muted);
}
.draft-history-more summary::-webkit-details-marker {
  display: none;
}
.draft-history-more summary:hover {
  background: #2865e80a;
}
.draft-history-more summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.draft-history-more > div {
  position: absolute;
  z-index: 8;
  right: 0;
  top: 42px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px #122f4820;
  padding: 5px;
  min-width: 120px;
}
.draft-history-more button {
  width: 100%;
  min-height: 44px;
  background: transparent;
  color: #b83636;
  border: 0;
  justify-content: flex-start;
}
.draft-history-more button:hover {
  background: #b8363610;
}
.draft-history-error {
  margin: 10px 0;
}
.draft-history-error button {
  margin-top: 8px;
}
.draft-history-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 25px 10px;
  color: var(--muted);
  font-size: 13px;
}
.draft-history-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 15px;
  font-size: 12px;
  color: var(--muted);
}
.draft-history-pagination > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.draft-history-pagination button {
  min-height: 44px;
}
[data-theme="dark"] .draft-history-kind {
  color: #a4c3ff;
}
[data-theme="dark"] .draft-history-more button {
  color: #ffaaaa;
}
@media (max-width: 650px) {
  .draft-history-heading h2 {
    font-size: 15px;
  }
  .draft-history-heading button {
    font-size: 12px;
    padding: 8px 10px;
  }
  .draft-history-toolbar {
    align-items: flex-end;
  }
  .draft-history-toolbar label {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .draft-history-open {
    grid-template-columns: minmax(0, 1fr) 20px;
    gap: 4px 8px;
    padding: 14px 8px;
  }
  .draft-history-main {
    grid-column: 1;
    grid-row: 1;
  }
  .draft-history-open time {
    grid-column: 1;
    grid-row: 2;
    font-size: 12px;
  }
  .draft-history-open > svg {
    grid-column: 2;
    grid-row: 1/3;
  }
  .draft-history-pagination {
    justify-content: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .draft-history-toggle svg {
    transition: none;
  }
}
/* The history sits outside the wizard's scoped color tokens. */
.draft-history {
  --card: #ffffff;
}
[data-theme="dark"] .draft-history {
  --card: #1b2b42;
}
