/* Hallmark · macrostructure: Workbench · genre: modern-minimal
 * design-system: prototype/design.md · viewport: full-width database results
 */

.pr-page {
  min-height: calc(100vh - var(--nav-height));
  background: var(--bg-page);
}

.pr-subheader {
  position: sticky;
  top: var(--nav-height);
  z-index: 40;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
}

.pr-subheader-inner {
  max-width: 1760px;
  margin: 0 auto;
  padding: 12px 20px;
}

.pr-query-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.pr-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.pr-back:hover { color: var(--brand); }

.pr-query-box {
  min-width: 0;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--white);
  overflow: hidden;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.pr-query-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.pr-query-box i {
  margin-left: 13px;
  color: var(--brand);
  font-size: 15px;
}

.pr-query-input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 10px 12px;
  color: var(--text-title);
  background: transparent;
  font: inherit;
  font-size: 14px;
}

.pr-search-btn {
  align-self: stretch;
  min-width: 78px;
  border: 0;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  cursor: pointer;
  padding: 0 16px;
}

.pr-search-btn:hover { background: var(--brand-700); }

.pr-expression-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--brand-200);
  border-radius: 10px;
  background: var(--brand-50);
}

.pr-expression-panel[hidden] { display: none; }

.pr-expression-top,
.pr-expression-footer,
.pr-secondary-head,
.pr-secondary-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pr-expression-top b,
.pr-secondary-head b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-title);
  font-size: 13px;
}

.pr-expression-top b i,
.pr-secondary-head b i { color: var(--brand); }
.pr-expression-top span,
.pr-secondary-head span {
  margin-left: 8px;
  color: var(--text-secondary);
  font-size: 11px;
}

.pr-expression-top > button,
.pr-secondary-head > button {
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.pr-expression-panel textarea {
  width: 100%;
  min-height: 78px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: 7px;
  outline: none;
  resize: vertical;
  background: var(--white);
  color: var(--text-title);
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 12px;
  line-height: 1.65;
}

.pr-expression-panel textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.pr-expression-buttons,
.pr-expression-examples {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.pr-super-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pr-super-tabs button {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}

.pr-super-tabs button:hover,
.pr-super-tabs button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}

.pr-super-mode-content {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--white);
}

.pr-super-mode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pr-super-mode-head b { color: var(--text-title); font-size: 12px; }
.pr-super-mode-head span { color: var(--text-muted); font-size: 10px; }

.pr-super-input,
.pr-super-textarea {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: 7px;
  outline: none;
  background: var(--white);
  color: var(--text-title);
  font: inherit;
  font-size: 12px;
}

.pr-super-input { height: 38px; padding: 0 11px; }
.pr-super-textarea { min-height: 92px; padding: 10px 11px; resize: vertical; line-height: 1.7; }
.pr-super-input:focus,
.pr-super-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }

.pr-super-query-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.pr-super-query-chips button {
  padding: 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: 10px;
  cursor: pointer;
}

.pr-super-query-chips button:hover { border-color: var(--brand); color: var(--brand); }

.pr-advanced-builder { display: grid; gap: 7px; margin-top: 8px; }
.pr-advanced-row {
  display: grid;
  grid-template-columns: 64px 140px 106px minmax(0, 1fr) 32px;
  gap: 6px;
  align-items: center;
}

.pr-advanced-row select,
.pr-advanced-row input {
  height: 32px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--white);
  color: var(--text-secondary);
  font-size: 11px;
}

.pr-advanced-row button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
}

.pr-image-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 118px;
  border: 1px dashed var(--border-default);
  border-radius: 8px;
  background: var(--bg-page);
  color: var(--text-muted);
  cursor: pointer;
}

.pr-image-drop i { margin-bottom: 7px; color: var(--brand); font-size: 24px; }
.pr-image-drop b { color: var(--text-body); font-size: 12px; }
.pr-image-drop span { margin-top: 4px; font-size: 10px; }

.pr-super-scope {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 10px;
}

.pr-super-scope label { display: inline-flex; align-items: center; gap: 5px; }
.pr-super-scope select {
  height: 28px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--white);
  color: var(--text-secondary);
  font-size: 10px;
}

.pr-super-check { cursor: pointer; }
.pr-super-check input { accent-color: var(--brand); }

.pr-expression-buttons { margin-top: 8px; }

.pr-expression-buttons button,
.pr-expression-examples button {
  min-width: 30px;
  padding: 5px 8px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--white);
  color: var(--text-secondary);
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 10px;
  cursor: pointer;
}

.pr-expression-buttons button:hover,
.pr-expression-examples button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-50);
}

.pr-expression-footer { margin-top: 10px; align-items: flex-end; }
.pr-expression-examples { max-width: 620px; }
.pr-expression-examples button { font-family: inherit; }
.pr-expression-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.pr-action-btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}

.pr-action-btn.primary:hover { background: var(--brand-700); color: var(--on-brand); }

.pr-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pr-icon-btn,
.pr-action-btn {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pr-icon-btn { width: 34px; padding: 0; }
.pr-action-btn { padding: 0 10px; }
.pr-icon-btn:hover,
.pr-action-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.pr-icon-btn.active { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }

.pr-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  flex-wrap: wrap;
}

.pr-result-count strong { color: var(--text-title); font-size: 15px; }
.pr-result-count span { color: var(--text-muted); }

.pr-scope {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  color: var(--brand);
}

.pr-workspace {
  --pr-left: 280px;
  --pr-right: 360px;
  max-width: 1760px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  display: grid;
  grid-template-columns: var(--pr-left) minmax(0, 1fr) var(--pr-right);
  gap: 14px;
  align-items: start;
  transition: grid-template-columns 160ms var(--ease-out);
}

body.pr-hide-left .pr-workspace { --pr-left: 0px; }
body.pr-hide-right .pr-workspace { --pr-right: 0px; }
body.pr-collapse-right .pr-workspace { --pr-right: 0px; }
body.pr-hide-left .pr-facets,
body.pr-hide-right .pr-insight,
body.pr-collapse-right .pr-insight { display: none; }

.pr-panel {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.pr-facets {
  position: sticky;
  top: calc(var(--nav-height) + 94px);
  max-height: calc(100vh - var(--nav-height) - 112px);
  overflow-y: auto;
}

.pr-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-title);
  font-size: 13px;
  font-weight: 700;
}

.pr-panel-head i { color: var(--brand); }

.pr-panel-head em {
  margin-left: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

.pr-clear {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 11px;
  cursor: pointer;
}

.pr-facet-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}

.pr-facet-section:last-child { border-bottom: 0; }

.pr-facet-tools {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  background: var(--white);
}

.pr-facet-search {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  background: var(--bg-page);
}

.pr-facet-search i { color: var(--text-muted); font-size: 12px; }
.pr-facet-search input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 8px 0;
  background: transparent;
  color: var(--text-body);
  font: inherit;
  font-size: 12px;
}

.pr-facet-advanced {
  width: 100%;
  margin-top: 7px;
  padding: 6px 8px;
  border: 1px dashed var(--border-default);
  border-radius: 6px;
  background: transparent;
  color: var(--brand);
  font-size: 11px;
  cursor: pointer;
}

.pr-facet-scale {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.5;
}

.pr-facet-scale b { color: var(--brand); }

.pr-facet-group { border-bottom: 1px solid var(--border-light); }
.pr-facet-group:last-child { border-bottom: 0; }

.pr-facet-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border: 0;
  background: var(--white);
  color: var(--text-body);
  text-align: left;
  cursor: pointer;
}

.pr-facet-group-head:hover { background: var(--brand-50); }
.pr-facet-group-head.is-selected { color: var(--brand); background: var(--brand-50); }
.pr-facet-group-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.pr-facet-group-title i { color: var(--brand); font-size: 13px; }
.pr-facet-group-meta { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 10px; }
.pr-facet-group-body {
  display: none;
  padding: 0 12px 12px;
  background: var(--white);
}

.pr-facet-group.open .pr-facet-group-body { display: block; }

.pr-facet-options { display: grid; gap: 3px; }
.pr-facet-options.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 8px; }
.pr-facet-options.range-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }

.pr-facet-option {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
  cursor: pointer;
}

.pr-facet-option > span:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pr-facet-option input { width: 13px; height: 13px; margin: 0; accent-color: var(--brand); flex-shrink: 0; }
.pr-facet-option:hover,
.pr-facet-option.is-selected { color: var(--brand); }
.pr-facet-option.is-selected {
  padding-inline: 6px;
  border-radius: 5px;
  background: var(--brand-50);
}

.pr-range-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
  cursor: pointer;
}

.pr-range-option:hover,
.pr-range-option.is-selected {
  border-color: var(--brand);
  background: var(--brand-50);
  color: var(--brand);
}

.pr-facet-text-input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  outline: none;
  background: var(--bg-page);
  color: var(--text-body);
  font: inherit;
  font-size: 11px;
}

.pr-facet-text-input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-50); }

.pr-facet-hint {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.55;
}

.pr-facet-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
  background: var(--white);
  color: var(--text-muted);
  font-size: 10px;
}

.pr-facet-footer button {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.pr-facet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--text-body);
  font-size: 12px;
  font-weight: 700;
}

.pr-facet-title span:last-child { color: var(--text-muted); font-weight: 400; }

.pr-facet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.pr-facet-item-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.pr-facet-item input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--brand);
  flex-shrink: 0;
}

.pr-facet-count { color: var(--text-muted); font-size: 11px; }

.pr-main { min-width: 0; }

.pr-active-filters {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 34px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.pr-secondary-panel {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--brand-200);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.pr-secondary-panel[hidden] { display: none; }

.pr-within-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0 9px;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  background: var(--bg-page);
}

.pr-within-search i { color: var(--brand); }
.pr-within-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 9px 0;
  background: transparent;
  color: var(--text-body);
  font: inherit;
  font-size: 12px;
}

.pr-within-search button {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 11px;
  cursor: pointer;
}

.pr-condition-list { display: grid; gap: 7px; margin-top: 10px; }

.pr-condition-row {
  display: grid;
  grid-template-columns: 64px minmax(130px, 0.9fr) 110px minmax(160px, 1.4fr) 34px;
  gap: 6px;
  align-items: center;
}

.pr-condition-row select,
.pr-condition-row input {
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  outline: none;
  background: var(--white);
  color: var(--text-secondary);
  font-size: 11px;
}

.pr-condition-row select:focus,
.pr-condition-row input:focus { border-color: var(--brand); }

.pr-condition-row .pr-remove-condition {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
}

.pr-condition-row .pr-remove-condition:hover { border-color: var(--accent-red); color: var(--accent-red); }

.pr-secondary-footer { margin-top: 10px; }
.pr-secondary-footer > div { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.pr-secondary-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pr-secondary-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--text-secondary);
  font-size: 11px;
}

.pr-secondary-chip.exclude { border-color: #ffd0cc; background: var(--red-light); color: var(--accent-red); }
.pr-secondary-chip.or { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand); }
.pr-secondary-chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }

.pr-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  color: var(--brand);
}

.pr-filter-chip button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  opacity: 0.65;
}

.pr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--white);
  flex-wrap: wrap;
}

.pr-toolbar-left,
.pr-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pr-select {
  height: 32px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-secondary);
  padding: 0 9px;
  font-size: 12px;
}

.pr-view-toggle {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-page);
}

.pr-view-toggle button {
  width: 31px;
  height: 27px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.pr-view-toggle button.active {
  background: var(--white);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.pr-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--brand-200);
  border-radius: var(--radius);
  background: var(--brand-50);
  color: var(--brand);
  font-size: 12px;
  flex-wrap: wrap;
}

.pr-selection-bar[hidden] { display: none; }

.pr-table-wrap {
  overflow: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.pr-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: collapse;
  table-layout: fixed;
}

.pr-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.pr-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 12px;
  vertical-align: top;
}

.pr-table tbody tr { cursor: pointer; }
.pr-table tbody tr:hover { background: var(--brand-50); }
.pr-table tbody tr:last-child td { border-bottom: 0; }
.pr-table.compact .pr-col-optional { display: none; }

.pr-check { width: 34px; }
.pr-check input { width: 15px; height: 15px; accent-color: var(--brand); }

.pr-score { color: var(--brand); font-weight: 700; }
.pr-score-bar {
  display: block;
  width: 34px;
  height: 4px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--brand-100);
  overflow: hidden;
}

.pr-score-bar i {
  display: block;
  height: 100%;
  background: var(--brand);
}

.pr-title {
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.pr-pn {
  margin-top: 4px;
  color: var(--text-muted);
  font-family: "SF Mono", "Cascadia Code", monospace;
  font-size: 11px;
}

.pr-ai-brief {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
}

.pr-status-valid { color: var(--success); font-weight: 700; }
.pr-status-pending { color: var(--accent-orange); font-weight: 700; }

.pr-chain {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--brand-50);
  color: var(--brand);
  font-size: 11px;
  white-space: nowrap;
}

.pr-chain.display { background: var(--green-light); color: var(--success); }
.pr-chain.fusion { background: var(--orange-light); color: var(--accent-orange); }

.pr-row-actions { display: flex; gap: 4px; }
.pr-row-actions button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
}

.pr-row-actions button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-50);
}

.pr-card-list { display: grid; gap: 10px; }
.pr-result-card {
  padding: 15px 17px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.pr-result-card:hover { border-color: var(--brand-200); }
.pr-card-title { color: var(--brand); font-size: 14px; font-weight: 600; line-height: 1.5; }
.pr-card-meta { display: flex; flex-wrap: wrap; gap: 12px; margin: 7px 0; color: var(--text-muted); font-size: 11px; }
.pr-card-copy { color: var(--text-secondary); font-size: 12px; line-height: 1.7; }
.pr-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pr-card-tag { padding: 2px 7px; border-radius: 4px; background: var(--bg-page); color: var(--text-secondary); font-size: 10px; }

.pr-insight {
  position: sticky;
  top: calc(var(--nav-height) + 94px);
  overflow: hidden;
}

.pr-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, var(--brand-50), var(--white));
}

.pr-insight-head b { display: flex; align-items: center; gap: 6px; color: var(--text-title); font-size: 13px; }
.pr-insight-head i { color: var(--brand); }

.pr-insight-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pr-insight-collapse {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
}

.pr-insight-collapse:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-50);
}

.pr-evidence-badge {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--brand-100);
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
}

.pr-insight-body { padding: 14px; }

.pr-insight-section { padding: 11px 0; border-bottom: 1px solid var(--border-light); }
.pr-insight-section:first-child { padding-top: 0; }
.pr-insight-section:last-child { padding-bottom: 0; border-bottom: 0; }
.pr-insight-label { margin-bottom: 7px; color: var(--text-title); font-size: 12px; font-weight: 700; }
.pr-insight-copy { color: var(--text-secondary); font-size: 12px; line-height: 1.7; }

.pr-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.pr-stat { padding: 9px; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-page); }
.pr-stat b { display: block; color: var(--text-title); font-size: 16px; }
.pr-stat span { color: var(--text-muted); font-size: 10px; }

.pr-evidence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-light);
  color: var(--text-secondary);
  font-size: 11px;
}

.pr-evidence:last-child { border-bottom: 0; }
.pr-evidence button { border: 0; background: none; color: var(--brand); cursor: pointer; font-size: 11px; }

.pr-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.pr-pagination-pages { display: flex; gap: 4px; }
.pr-page-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--white);
  color: var(--text-secondary);
  cursor: pointer;
}

.pr-page-btn.active { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }

.pr-compare-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
}

.pr-compare-overlay.open { display: flex; }
.pr-compare-panel {
  width: min(1100px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.pr-compare-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--white);
}

.pr-compare-head button { border: 0; background: none; color: var(--text-muted); cursor: pointer; }
.pr-compare-table { width: 100%; border-collapse: collapse; }
.pr-compare-table th,
.pr-compare-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); text-align: left; vertical-align: top; font-size: 12px; }
.pr-compare-table th { width: 110px; color: var(--text-muted); font-weight: 600; background: var(--bg-page); }

.pr-empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--text-muted);
}

.pr-empty i { display: block; margin-bottom: 10px; font-size: 36px; }

.pr-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1500;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--text-title);
  color: var(--white);
  font-size: 12px;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.pr-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1400px) {
  .pr-workspace { --pr-left: 225px; --pr-right: 330px; }
}

@media (max-width: 1160px) {
  .pr-workspace { grid-template-columns: 230px minmax(0, 1fr); }
  .pr-insight { display: none; }
  body.pr-show-right .pr-workspace { grid-template-columns: 230px minmax(0, 1fr) 330px; }
  body.pr-show-right .pr-insight { display: block; }
}

@media (max-width: 900px) {
  .pr-subheader { position: static; }
  .pr-query-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pr-back { grid-column: 1 / -1; }
  .pr-workspace,
  body.pr-show-right .pr-workspace { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 32px; }
  .pr-facets,
  .pr-insight { display: none; position: static; max-height: none; }
  body.pr-show-left .pr-facets,
  body.pr-show-right .pr-insight { display: block; }
  .pr-subheader-inner { padding: 10px 12px; }
  .pr-top-actions { justify-content: flex-start; }
  .pr-expression-top span,
  .pr-secondary-head span { display: block; margin: 4px 0 0; }
  .pr-advanced-row { grid-template-columns: 58px minmax(110px, 1fr) 90px 32px; }
  .pr-advanced-row input[data-advanced-value] { grid-column: 2 / 5; }
  .pr-condition-row { grid-template-columns: 64px minmax(0, 1fr) 100px 34px; }
  .pr-condition-row input[data-condition-value] { grid-column: 2 / 5; }
}

@media (max-width: 560px) {
  .pr-query-row { grid-template-columns: minmax(0, 1fr); }
  .pr-search-btn { min-height: 38px; }
  .pr-table { min-width: 1080px; }
  .pr-pagination { align-items: flex-start; flex-direction: column; }
  .pr-condition-row { grid-template-columns: 1fr 1fr; }
  .pr-condition-row select,
  .pr-condition-row input,
  .pr-condition-row button { width: 100%; }
  .pr-advanced-row { grid-template-columns: 1fr 1fr; }
  .pr-advanced-row input[data-advanced-value] { grid-column: 1 / 3; }
  .pr-condition-row input[data-condition-value] { grid-column: 1 / 3; }
}
