/* ============================================================
   EEA 2025 Data Panel — Validation UI Shared Stylesheet
   Brand: FIU Blue #081E3F  |  FIU Gold #B6862C
   Works with vanilla HTML/JS + Tom Select for autocomplete.
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  background: #f4f6f8;
  color: #1a1a2e;
  line-height: 1.55;
  min-height: 100vh;
  padding-bottom: 5rem; /* clear sticky footer */
}

a {
  color: #B6862C;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Site header ───────────────────────────────────────────── */

.site-header {
  background: #081E3F;
  color: #fff;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.site-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  flex: 1 1 auto;
}

.site-header .header-meta {
  font-size: 0.8rem;
  color: #c8d0dc;
  flex: 0 0 auto;
}

.site-header .header-meta strong {
  color: #B6862C;
}

.site-header nav {
  flex: 0 0 auto;
}

.site-header nav a {
  color: #c8d0dc;
  font-size: 0.8rem;
  margin-left: 1rem;
}

.site-header nav a:hover {
  color: #B6862C;
  text-decoration: none;
}

/* ── Page wrapper ──────────────────────────────────────────── */

.page-content {
  max-width: 1060px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

/* ── Section headings ──────────────────────────────────────── */

.section-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #081E3F;
  border-bottom: 2px solid #B6862C;
  padding-bottom: 0.2rem;
  margin-bottom: 0.75rem;
}

/* ── Paper blocks (<details>) ──────────────────────────────── */

.paper-block {
  background: #fff;
  border: 1px solid #d6dce5;
  border-radius: 6px;
  margin-bottom: 0.9rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s ease;
}

.paper-block[open] {
  box-shadow: 0 3px 10px rgba(8, 30, 63, 0.12);
}

/* Summary / clickable header row */
.paper-block > summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  background: #f8f9fb;
  border-bottom: 1px solid transparent;
  list-style: none;
  user-select: none;
  transition: background 0.12s ease;
}

.paper-block > summary::-webkit-details-marker {
  display: none;
}

.paper-block[open] > summary {
  background: #eef1f7;
  border-bottom-color: #d6dce5;
}

.paper-block > summary:hover {
  background: #e8ecf4;
}

/* Expand chevron */
.paper-block > summary::before {
  content: "▶";
  font-size: 0.65rem;
  color: #081E3F;
  flex: 0 0 auto;
  transition: transform 0.2s ease;
  margin-right: 0.15rem;
}

.paper-block[open] > summary::before {
  transform: rotate(90deg);
}

.summary-year {
  font-size: 0.78rem;
  font-weight: 700;
  color: #081E3F;
  flex: 0 0 auto;
  min-width: 2.8rem;
}

.summary-authors {
  font-size: 0.78rem;
  color: #4a5568;
  flex: 0 1 22%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: #1a1a2e;
  flex: 1 1 35%;
}

.summary-journal {
  font-size: 0.75rem;
  color: #718096;
  font-style: italic;
  flex: 0 1 18%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Review status badge */
.review-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 0 0 auto;
  margin-left: auto;
}

.review-badge--pending {
  background: #e2e8f0;
  color: #4a5568;
}

.review-badge--in-progress {
  background: #fef3c7;
  color: #92400e;
}

.review-badge--complete {
  background: #d1fae5;
  color: #065f46;
}

.review-badge--flagged {
  background: #fee2e2;
  color: #991b1b;
}

/* Paper body padding */
.paper-body {
  padding: 0.85rem 1rem 1rem;
}

/* ── Metadata row ──────────────────────────────────────────── */

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  background: #f0f2f6;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.9rem;
  font-size: 0.75rem;
  color: #4a5568;
}

.meta-row dt {
  font-weight: 700;
  color: #2d3748;
  display: inline;
}

.meta-row dd {
  display: inline;
  margin-left: 0.2rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

/* Depth override: inline number input inside meta row */
.depth-override {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.depth-override label {
  font-size: 0.73rem;
  color: #4a5568;
}

.depth-override input[type="number"] {
  width: 3.5rem;
  padding: 0.1rem 0.25rem;
  border: 1px solid #b0bec5;
  border-radius: 3px;
  font-size: 0.73rem;
  background: #fff;
  color: #1a1a2e;
  text-align: right;
}

.depth-override input[type="number"]:focus {
  outline: 2px solid #B6862C;
  outline-offset: 1px;
}

/* ── Checkbox grids (schema categories) ────────────────────── */

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #d6dce5;
  background: #fafbfc;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.checkbox-item:hover {
  background: #eef1f7;
  border-color: #a0aec0;
}

/* Original (from extraction) — blue tint */
.checkbox-item.original {
  background: #ebf4ff;
  border-color: #90cdf4;
}

/* Checked by reviewer — green tint */
.checkbox-item:has(input[type="checkbox"]:checked) {
  background: #f0fff4;
  border-color: #68d391;
}

/* Changed from original — amber tint (add class via JS when value differs from original) */
.checkbox-item.changed {
  background: #fffbeb;
  border-color: #f6c90e;
}

/* Both original AND checked — solid green */
.checkbox-item.original:has(input[type="checkbox"]:checked) {
  background: #c6f6d5;
  border-color: #38a169;
}

.checkbox-item input[type="checkbox"] {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  accent-color: #081E3F;
  cursor: pointer;
}

.checkbox-item .item-label {
  flex: 1;
  line-height: 1.3;
  word-break: break-word;
}

/* ── Evidence detail panels (full-width below checkbox grid) ── */

.evidence-panel {
  background: #f0f2f6;
  border-left: 3px solid #B6862C;
  border-radius: 0 4px 4px 0;
  margin-bottom: 0.6rem;
  padding: 0.5rem 0.75rem;
  overflow: hidden;
  width: 100%;
}

.evidence-panel-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.3rem;
  text-transform: capitalize;
}

/* ── Rules palette ─────────────────────────────────────────── */

.rules-palette {
  margin: 0.5rem 0;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.78rem;
}
.rules-palette-summary {
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  color: #495057;
  font-weight: 500;
  background: #f8f9fa;
  user-select: none;
}
.rules-palette-body {
  padding: 0.5rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.rule-entry {
  padding: 0.35rem 0.5rem;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  background: white;
}
.rule-entry.rule-fired {
  background: #d3f9d8;
  border-color: #69db7c;
}
.rule-name {
  font-weight: 600;
  text-transform: capitalize;
}
.rule-threshold {
  font-size: 0.7rem;
  color: #868e96;
  background: #f1f3f5;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}
.rule-badge-active {
  font-size: 0.65rem;
  color: white;
  background: #37b24d;
  padding: 0.05rem 0.4rem;
  border-radius: 8px;
  font-weight: 600;
}
.rule-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.2rem;
}
.rule-term {
  background: #e9ecef;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.72rem;
}
.rule-anchors, .rule-cs {
  margin-top: 0.2rem;
  color: #495057;
  font-size: 0.72rem;
}
.rule-anchor {
  background: #fff3bf;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.72rem;
}

/* Schema-level meta block (description + criteria + source) */
.rules-schema-meta {
  padding: 0.4rem 0.5rem;
  background: #eef4ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  color: #1e3a8a;
}
.rules-schema-desc {
  margin: 0 0 0.25rem;
  font-weight: 500;
}
.rules-schema-criteria {
  margin: 0;
  font-size: 0.76rem;
  color: #1e3a8a;
}
.rules-schema-meta-extra {
  margin: 0.3rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.rules-meta-chip {
  display: inline-block;
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
  padding: 0.05rem 0.45rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}
.rules-schema-source {
  margin: 0.3rem 0 0;
  font-size: 0.7rem;
  color: #475569;
}

/* Rule-level descriptive extras (cues, patterns, logic, source) */
.rule-description {
  margin: 0.2rem 0 0;
  color: #334155;
  font-size: 0.76rem;
}
.rule-method {
  margin: 0.15rem 0 0;
  color: #475569;
  font-size: 0.72rem;
}
.rule-cues, .rule-patterns, .rule-logic {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  color: #334155;
}
.rule-cues-pos strong { color: #276749; }
.rule-cues-neg strong { color: #822727; }
.rule-patterns ul, .rule-logic ul {
  margin: 0.15rem 0 0 1.2rem;
  padding: 0;
}
.rule-patterns li, .rule-logic li {
  margin: 0;
  font-family: inherit;
}
.rule-source {
  margin: 0.3rem 0 0;
  font-size: 0.7rem;
  color: #64748b;
}

/* SR habitat guess tags */
.sr-guess-tag {
  display: inline-block;
  background: #e2e8f0;
  border: 1px solid #cbd5e0;
  border-radius: 12px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  color: #2d3748;
}

.evidence-body {
  padding: 0.5rem 0.75rem 0.65rem;
}

/* Context snippet (matched text from PDF) */
.context-snippet {
  font-size: 0.76rem;
  color: #2d3748;
  background: #fff;
  border: 1px solid #cbd5e0;
  border-radius: 3px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.context-snippet mark {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 0.1em;
}

.evidence-meta {
  font-size: 0.7rem;
  color: #718096;
  margin-top: 0.25rem;
}

/* ── Traffic-light rating controls ─────────────────────────── */

.rating-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  align-items: center;
}

.rating-group .rating-label-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2d3748;
  margin-right: 0.25rem;
  flex: 0 0 auto;
}

.rating-option {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  user-select: none;
}

.rating-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Green = correct */
.rating-option.correct {
  background: #f0fff4;
  color: #276749;
  border-color: #9ae6b4;
}
.rating-option.correct.selected,
.rating-option.correct:has(input:checked) {
  background: #38a169;
  color: #fff;
  border-color: #1c4532;
  box-shadow: 0 0 0 2px #1c4532;
}

/* Yellow = partial */
.rating-option.partial {
  background: #fffff0;
  color: #744210;
  border-color: #f6e05e;
}
.rating-option.partial.selected,
.rating-option.partial:has(input:checked) {
  background: #d69e2e;
  color: #fff;
  border-color: #744210;
  box-shadow: 0 0 0 2px #744210;
}

/* Red = incorrect */
.rating-option.incorrect {
  background: #fff5f5;
  color: #822727;
  border-color: #feb2b2;
}
.rating-option.incorrect.selected,
.rating-option.incorrect:has(input:checked) {
  background: #e53e3e;
  color: #fff;
  border-color: #63171b;
  box-shadow: 0 0 0 2px #63171b;
}

/* Keyboard focus ring (radio is visually hidden) */
.rating-option:focus-within {
  outline: 2px solid #2b6cb0;
  outline-offset: 2px;
}

/* Hover states (unselected) */
.rating-option.correct:hover:not(.selected):not(:has(input:checked)) {
  background: #c6f6d5;
  border-color: #68d391;
}
.rating-option.partial:hover:not(.selected):not(:has(input:checked)) {
  background: #fefcbf;
  border-color: #ecc94b;
}
.rating-option.incorrect:hover:not(.selected):not(:has(input:checked)) {
  background: #fed7d7;
  border-color: #fc8181;
}

/* ── Notes textarea ────────────────────────────────────────── */

.notes-area {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: inherit;
  color: #2d3748;
  background: #fff;
  resize: vertical;
  transition: border-color 0.12s;
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.notes-area:focus {
  outline: none;
  border-color: #B6862C;
  box-shadow: 0 0 0 3px rgba(182, 134, 44, 0.18);
}

.notes-area::placeholder {
  color: #a0aec0;
}

/* ── Rule feedback panel ────────────────────────────────────── */

.rule-feedback {
  background: #fff8ec;
  border: 1px solid #f6ad55;
  border-radius: 4px;
  padding: 0.55rem 0.75rem;
  font-size: 0.76rem;
  color: #744210;
  margin-bottom: 0.75rem;
}

.rule-feedback h4 {
  font-size: 0.76rem;
  font-weight: 700;
  color: #744210;
  margin-bottom: 0.3rem;
}

.rule-feedback ul {
  margin: 0;
  padding-left: 1.1rem;
}

.rule-feedback li {
  margin-bottom: 0.2rem;
}

.rule-feedback .rule-code {
  font-family: "Courier New", Courier, monospace;
  background: #fef3c7;
  padding: 0.05rem 0.3rem;
  border-radius: 2px;
  font-size: 0.72rem;
}

/* ── Tag-style items (species / techniques) ─────────────────── */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  min-height: 1.8rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #081E3F;
  color: #fff;
  border-radius: 999px;
  padding: 0.22rem 0.6rem 0.22rem 0.75rem;
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  max-width: 22rem;
}

.tag .tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-remove {
  background: none;
  border: none;
  color: #90cdf4;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
  flex: 0 0 auto;
  border-radius: 50%;
  width: 1.1rem;
  height: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s;
}

.tag-remove:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Technique tags — slightly different hue */
.tag--technique {
  background: #2c4a7a;
}

/* Species tags — slightly different hue */
.tag--species {
  background: #1a3a5c;
}

/* ── Autocomplete wrappers (Tom Select) ─────────────────────── */

.autocomplete-wrap {
  position: relative;
  margin-bottom: 0.5rem;
}

/* Tom Select overrides */
.ts-wrapper {
  font-size: 0.8rem;
}

.ts-wrapper .ts-control {
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  background: #fff;
  box-shadow: none;
  min-height: 2.1rem;
}

.ts-wrapper.focus .ts-control {
  border-color: #B6862C;
  box-shadow: 0 0 0 3px rgba(182, 134, 44, 0.18);
  outline: none;
}

.ts-wrapper .ts-dropdown {
  border: 1px solid #B6862C;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-size: 0.8rem;
  z-index: 200;
}

.ts-wrapper .ts-dropdown .option {
  padding: 0.35rem 0.65rem;
  color: #1a1a2e;
}

.ts-wrapper .ts-dropdown .option.active {
  background: #081E3F;
  color: #fff;
}

.ts-wrapper .ts-dropdown .option:hover {
  background: #eef1f7;
}

/* ── Generic form controls ──────────────────────────────────── */

.field-group {
  margin-bottom: 0.85rem;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.3rem;
}

.field-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: inherit;
  background: #fff;
  color: #1a1a2e;
  transition: border-color 0.12s;
}

.field-input:focus {
  outline: none;
  border-color: #B6862C;
  box-shadow: 0 0 0 3px rgba(182, 134, 44, 0.18);
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.9rem;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #081E3F;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #0d2d5a;
}

.btn-gold {
  background: #B6862C;
  color: #fff;
}

.btn-gold:hover:not(:disabled) {
  background: #9a7024;
}

.btn-outline {
  background: transparent;
  color: #081E3F;
  border: 1.5px solid #081E3F;
}

.btn-outline:hover:not(:disabled) {
  background: #081E3F;
  color: #fff;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
}

.btn-danger {
  background: #e53e3e;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #c53030;
}

/* ── Sticky footer ───────────────────────────────────────────── */

.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #081E3F;
  color: #fff;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  z-index: 150;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

/* Progress bar container */
.footer-progress {
  flex: 1 1 220px;
  min-width: 140px;
}

.footer-progress-label {
  font-size: 0.7rem;
  color: #a0aec0;
  margin-bottom: 0.2rem;
  display: flex;
  justify-content: space-between;
}

.progress-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #B6862C;
  border-radius: 999px;
  transition: width 0.3s ease;
  min-width: 0;
}

/* Save indicator */
.save-indicator {
  font-size: 0.72rem;
  color: #68d391;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.save-indicator.visible {
  opacity: 1;
}

.save-indicator.error {
  color: #fc8181;
}

.save-indicator::before {
  content: "✓";
  font-size: 0.85rem;
}

.save-indicator.error::before {
  content: "✗";
}

/* Footer action buttons */
.footer-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ── Landing page ─────────────────────────────────────────── */

.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 2rem 1rem;
  text-align: center;
}

.landing-logo {
  width: 140px;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.landing-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: #081E3F;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.landing-subtitle {
  font-size: 1rem;
  color: #718096;
  margin-bottom: 2rem;
}

.search-box-wrap {
  width: 100%;
  max-width: 540px;
  position: relative;
  margin-bottom: 1.5rem;
}

.search-box {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  font-size: 1rem;
  border: 2px solid #cbd5e0;
  border-radius: 8px;
  background: #fff;
  color: #1a1a2e;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.search-box:focus {
  outline: none;
  border-color: #B6862C;
  box-shadow: 0 0 0 4px rgba(182, 134, 44, 0.22);
}

.search-box-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.05rem;
  color: #a0aec0;
  pointer-events: none;
}

/* Search result cards */
.search-results {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.result-card {
  background: #fff;
  border: 1px solid #d6dce5;
  border-radius: 6px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  text-decoration: none;
  display: block;
  color: inherit;
}

.result-card:hover {
  border-color: #B6862C;
  box-shadow: 0 2px 8px rgba(182, 134, 44, 0.15);
  text-decoration: none;
}

.result-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #081E3F;
  margin-bottom: 0.15rem;
}

.result-card-meta {
  font-size: 0.74rem;
  color: #718096;
}

.result-card-meta span + span::before {
  content: " · ";
  color: #cbd5e0;
}

/* No results message */
.no-results {
  font-size: 0.85rem;
  color: #a0aec0;
  padding: 1rem;
  text-align: center;
}

/* ── 404 page ─────────────────────────────────────────────── */

.not-found-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 2rem 1rem;
}

.not-found-code {
  font-size: 5rem;
  font-weight: 900;
  color: #081E3F;
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
}

.not-found-message {
  font-size: 1.15rem;
  color: #4a5568;
  margin-bottom: 1.5rem;
}

.not-found-hint {
  font-size: 0.85rem;
  color: #a0aec0;
  margin-bottom: 1.5rem;
}

/* ── Schema section wrapper ──────────────────────────────────── */

.schema-section {
  margin-bottom: 1.25rem;
}

.schema-section + .schema-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

/* ── Dividers ─────────────────────────────────────────────── */

.divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 0.9rem 0;
}

/* ── Inline helpers ───────────────────────────────────────── */

.text-sm    { font-size: 0.78rem; }
.text-xs    { font-size: 0.7rem; }
.text-muted { color: #718096; }
.text-gold  { color: #B6862C; }
.text-navy  { color: #081E3F; }
.fw-bold    { font-weight: 700; }
.mt-1       { margin-top: 0.5rem; }
.mt-2       { margin-top: 1rem; }
.mb-1       { margin-bottom: 0.5rem; }
.mb-2       { margin-bottom: 1rem; }
.d-flex     { display: flex; }
.gap-1      { gap: 0.5rem; }
.align-center { align-items: center; }
.flex-wrap  { flex-wrap: wrap; }

/* ── Responsive tweaks ────────────────────────────────────── */

@media (max-width: 640px) {
  .page-content {
    padding: 0.75rem 0.6rem 2rem;
  }

  .paper-block > summary {
    padding: 0.55rem 0.75rem;
  }

  .summary-authors,
  .summary-journal {
    display: none; /* hide on very small screens; year+title+badge remain */
  }

  .checkbox-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .landing-title {
    font-size: 1.4rem;
  }

  .not-found-code {
    font-size: 3.5rem;
  }

  .sticky-footer {
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
  }

  .rating-group {
    gap: 0.25rem;
  }
}

@media (max-width: 400px) {
  .review-badge {
    display: none;
  }
}

/* ── Print ────────────────────────────────────────────────── */

@media print {
  .site-header,
  .sticky-footer,
  .tag-remove,
  .btn {
    display: none !important;
  }

  .paper-block {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  body {
    background: #fff;
    padding-bottom: 0;
  }
}

/* ── NamSor editable author enrichment fields ─────────────── */

.namsor-fields select,
.namsor-fields input[type="text"] {
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;
  color: #212529;
}

.namsor-fields select:focus,
.namsor-fields input[type="text"]:focus {
  outline: none;
  border-color: #4c6ef5;
  box-shadow: 0 0 0 2px rgba(76, 110, 245, 0.2);
}

.namsor-orig-note {
  font-size: 0.72rem;
  color: #868e96;
  font-style: italic;
}

.tag-freq-unavailable {
  color: #868e96;
  font-size: 0.75rem;
  margin: 0.25rem 0 0;
}

.tag-threshold-hint {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  color: #334155;
  background: #f1f5f9;
  border-left: 3px solid #94a3b8;
  padding: 0.35rem 0.55rem;
  border-radius: 0 3px 3px 0;
}
.tag-threshold-detail {
  color: #64748b;
  font-size: 0.72rem;
}

.tag-freq-count {
  color: #4b5563;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 0.15rem;
}

/* Derived summary value inline next to column label (e.g. imp_direction) */
.col-value {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.02rem 0.4rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e0;
  vertical-align: baseline;
}
.col-value-positive   { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.col-value-negative   { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }
.col-value-mixed      { background: #fef3c7; color: #78350f; border-color: #fcd34d; }
.col-value-not-stated { background: #e2e8f0; color: #475569; border-color: #cbd5e0; }
.col-value-true       { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.col-value-false      { background: #e2e8f0; color: #475569; border-color: #cbd5e0; }

.evidence-value {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  color: #334155;
}
.evidence-empty-hint {
  margin: 0.3rem 0 0;
  font-size: 0.76rem;
  color: #64748b;
  font-style: italic;
}

/* ============================================================================
   Schema-level rule transparency — section weights table + proposal link
   Added 2026-04-20 per Simon Dedman's request (item §3.14 in validation synthesis)
   ========================================================================== */
.rules-section-weights {
  margin: 0.6rem 0;
  padding: 0.5rem 0.7rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}
.rules-section-weights strong { display: block; margin-bottom: 0.3rem; font-size: 0.82rem; color: #334155; }
.section-weights-table {
  border-collapse: collapse;
  font-size: 0.75rem;
  margin: 0.25rem 0 0.35rem;
}
.section-weights-table th,
.section-weights-table td {
  padding: 0.2rem 0.5rem;
  border: 1px solid #e2e8f0;
  text-align: center;
  min-width: 3rem;
}
.section-weights-table th {
  background: #f1f5f9;
  font-weight: 500;
  color: #475569;
  font-size: 0.7rem;
}
.section-weights-table td.w-max  { background: #86efac; color: #14532d; font-weight: 700; }
.section-weights-table td.w-high { background: #dcfce7; color: #14532d; font-weight: 600; }
.section-weights-table td.w-med  { background: #fef9c3; color: #713f12; }
.section-weights-table td.w-low  { background: #f1f5f9; color: #64748b; }
.section-weights-note {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
  color: #64748b;
  font-style: italic;
}
.rules-schema-proposal {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
}
.rules-schema-proposal a {
  color: #1d4ed8;
  text-decoration: none;
}
.rules-schema-proposal a:hover { text-decoration: underline; }
