/* Static Search preview. Reference: templates/search.html and static/css/search.css.
   Controls are read-only and visual actions are spans, not nonfunctional buttons. */
.preview-frame {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--canvas);
}
.preview-app-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 28px;
  border-bottom: 1px solid #ded9d3;
  background: var(--surface);
}
.preview-app-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.preview-app-nav > span:not(.preview-avatar) {
  padding: 7px 10px;
  color: #5f5954;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
}
.preview-app-nav .preview-nav-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.preview-avatar {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-strong);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
}
.preview-content {
  max-width: 1060px;
  margin: auto;
  padding: 28px 20px 24px;
}
.preview-heading {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--line);
}
.preview-title {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: clamp(2rem, 3vw, 2.35rem);
  line-height: 1;
}
.preview-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.preview-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 20px 16px;
}
.preview-content .field {
  gap: 6px;
}
.preview-content .field label,
.preview-label {
  margin: 0;
  color: #403b37;
  font-size: 0.68rem;
  font-weight: 600;
}
.required-marker {
  color: var(--accent-strong);
}
.preview-content .input {
  height: 33px;
  min-height: 33px;
  padding: 6px 10px;
  border: 1px solid #d2cdc7;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 400;
}
.preview-content .input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.preview-select {
  position: relative;
}
.preview-select .input {
  padding-right: 34px;
}
.preview-caret {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 7px;
  height: 7px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  transform: rotate(45deg);
}
.preview-year-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-year-range > span {
  color: var(--muted);
  font-size: 0.78rem;
}
.preview-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.preview-clear,
.preview-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 33px;
  border: 1px solid #b9b2ab;
  border-radius: 6px;
}
.preview-clear {
  width: 33px;
  font-size: 24px;
  font-weight: 400;
}
.preview-search {
  padding: 0 15px;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
}
.preview-results {
  margin-top: 20px;
}
.preview-results h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}
.preview-results .table {
  min-width: 740px;
  background: transparent;
}
.preview-results .table th {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
}
.preview-results .table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.78rem;
}
.preview-results .table th:last-child {
  text-align: center;
}
.preview-row-selected td {
  background: rgba(232, 119, 42, 0.06);
}
.preview-selection {
  width: 108px;
  text-align: center;
}
.preview-select-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid #c7c1bb;
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.68rem;
  font-weight: 600;
}
.preview-select-result.is-selected {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: white;
}
.similarity-badge {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.similarity-badge--danger {
  background: #fff0f0;
  color: #b73535;
}
.similarity-badge--warning {
  background: #fff8e8;
  color: #9a6811;
}
.preview-download {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  width: min(470px, 100%);
  margin: 18px auto 0;
}
.preview-download .field {
  flex: 1;
}
.preview-download .input {
  height: 40px;
  font-size: 0.76rem;
}
.preview-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 132px;
  border-radius: 6px;
  background: var(--accent-strong);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}
.preview-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

@media (max-width: 640px) {
  .preview-app-header {
    padding-inline: 16px;
  }
  .preview-app-nav > span:not(.preview-avatar) {
    display: none;
  }
  .preview-content {
    padding-inline: 16px;
  }
  .preview-download {
    flex-direction: column;
    align-items: stretch;
  }
}
