.search-workspace {
  position: relative;
  min-width: 0;
}
.search-workspace.history-open {
  z-index: 25;
}
.search-history-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  max-height: 460px;
  padding: 16px 14px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 15px 45px #0003;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.history-heading,
.history-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.history-heading {
  justify-content: space-between;
  margin-bottom: 6px;
}
.history-heading h2 {
  font-size: 14px;
}
.history-heading h2 span {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.history-heading button,
.history-footer button,
#history-retry {
  font-size: 11px;
  padding: 5px 3px;
}
.history-status {
  padding: 10px 4px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0 2px 8px;
  min-height: 48px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.history-group {
  color: var(--muted);
  font-size: 11px;
  padding: 10px 8px 5px;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
}
.history-row:hover,
.history-row:focus-within {
  background: var(--accent-soft);
}
.history-search {
  flex: 1;
  min-width: 0;
  gap: 10px;
  justify-content: flex-start;
  text-align: left;
  padding: 10px 8px;
  white-space: normal;
}
.history-search,
.history-delete {
  background: transparent;
  border: 0;
}
.history-search:hover,
.history-delete:hover {
  background: transparent;
}
.history-search:focus-visible,
.history-delete:focus-visible {
  outline-offset: -2px;
}
.history-clock {
  font-size: 21px;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1;
}
.history-row-body {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.history-query {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.history-query mark {
  background: transparent;
  color: var(--accent);
  font-weight: 650;
}
.history-row small {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.history-delete {
  flex: 0 0 32px;
  height: 36px;
  padding: 4px;
  font-size: 18px;
  color: var(--muted);
}
.history-delete:hover {
  color: var(--danger);
}
.history-footer {
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding: 8px 3px 12px;
  color: var(--muted);
  font-size: 10px;
}
.history-keyboard {
  margin-left: auto;
}
.history-settings-dialog {
  width: min(480px, 100%);
}
.history-settings-dialog select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-top: 8px;
}
.history-setting-note {
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
@media (max-width: 700px) {
  .history-row-body {
    display: block;
  }
  .history-row small {
    display: block;
    margin-top: 3px;
  }
  .history-keyboard {
    display: none;
  }
  .history-footer {
    justify-content: space-between;
    gap: 4px;
  }
  .search-history-panel {
    padding: 12px 8px 0;
    border-radius: 12px;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .search-history-panel {
    background: var(--surface);
    backdrop-filter: none;
  }
}
