/*
 * This is a manifest file that'll be compiled into application.css.
 */

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: #1a1a1a;
  background: #f8f8f6;
  margin: 0;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.page-logo-mark {
  width: 34px;
  height: 34px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0;
  color: #555;
}

.meta {
  margin-bottom: 1rem;
  color: #555;
}

.loading-state {
  padding: 2rem;
  text-align: center;
  color: #555;
}

.articles {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.articles thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #666;
  border-bottom: 1px solid #e5e5e5;
  background: #fafafa;
  position: sticky;
  top: 0;
  z-index: 5;
}

tr.article-row {
  cursor: pointer;
}

.expand-th, .expand-cell {
  width: 1.25rem;
  padding: 0 0.25rem !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.num-th, .num-cell {
  width: 2rem;
  text-align: right !important;
  color: #bbb;
  font-size: 0.78rem;
  padding-right: 0.25rem !important;
  white-space: nowrap;
}

.review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.articles tbody tr:hover {
  background: #f5f5f3;
}

.articles td {
  padding: 0.6rem 0.75rem;
  vertical-align: top;
  border-bottom: 1px solid #eee;
}

.articles tbody tr:last-child td {
  border-bottom: none;
}

.title-cell {
  width: 40%;
}

.doi-th, .doi-cell {
  width: 18%;
}

.doi-link {
  font-size: 0.75rem;
  color: #1a5fb4;
  text-decoration: none;
  word-break: break-all;
  white-space: normal;
}

.doi-link:hover {
  text-decoration: underline;
}

/* ── Curation (exclude / restore) ── */

.exclude-btn, .restore-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  line-height: 1;
  color: #ccc;
  transition: color 0.15s;
}

.exclude-btn:hover {
  color: #c0392b;
}

.restore-btn {
  color: #1a5fb4;
  font-size: 1.2rem;
}

.restore-btn:hover {
  color: #0d3d7a;
}

.excluded-row .action-cell {
  opacity: 1;
}

.excluded-row td {
  opacity: 0.5;
}

.ignored-section {
  margin-top: 2rem;
}

.ignored-heading {
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #e5e5e5;
}

.ignored-meta {
  color: #aaa;
}

/* ── Must-read star ── */

.star-th, .star-cell {
  width: 1.75rem;
  padding: 0.6rem 0.25rem !important;
  text-align: center !important;
}

.omg-th, .omg-cell {
  width: 3.5rem;
  padding: 0.6rem 0.25rem !important;
  text-align: center !important;
  vertical-align: top;
}

.action-th, .action-cell {
  width: 1.75rem;
  padding: 0 0.25rem !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.must-read-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
  color: #bbb;
  transition: color 0.15s, transform 0.1s;
}

.must-read-btn:hover {
  color: #f5a623;
  transform: scale(1.2);
}

.must-read-btn.is-must-read {
  color: #f5a623;
}

.must-read-row td {
  background: #fffbf2;
}

.must-read-row.detail-row td {
  background: #fff8e8;
}

.must-read-count {
  color: #c8860a;
  font-weight: 600;
}

/* ── OMG widget (three facepalm icons, fills left-to-right) ── */

.omg-widget {
  display: inline-flex;
  flex-direction: row-reverse; /* DOM order 3,2,1 → visual order 1,2,3 */
  gap: 1px;
}

.omg-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 1px 2px;
  opacity: 0.18;
  transition: opacity 0.12s;
  filter: grayscale(1);
}

/* Hover preview when nothing is set: light up icons up to the hovered position.
   Because DOM is reversed, .omg-icon:hover ~ .omg-icon targets lower-numbered
   icons which are visually to the left of the hovered one. */
.omg-widget[data-omg="0"] .omg-icon:hover,
.omg-widget[data-omg="0"] .omg-icon:hover ~ .omg-icon {
  opacity: 0.5;
  filter: grayscale(0);
}

.omg-icon.is-active {
  opacity: 1;
  filter: grayscale(0);
}

/* When already set, just dim all on hover to hint at "click to clear" */
.omg-widget:not([data-omg="0"]):hover .omg-icon {
  opacity: 0.55;
}

.omg-row td {
  background: #fff5f5;
}

.omg-row.detail-row td {
  background: #ffeaea;
}

.omg-count {
  color: #c0392b;
  font-weight: 600;
}

/* ── Details toggle button ── */

.details-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
}

tr.article-row:hover .details-toggle {
  color: #444;
}

.details-toggle:hover {
  background: #f0f0ee;
  color: #222;
}

/* ── Expanded detail row ── */

.detail-row td {
  border-top: none;
  padding: 0;
}

.detail-cell {
  padding: 0 !important;
}

.detail-panel {
  background: #f7f7f5;
  border-top: 1px solid #e8e8e4;
  border-bottom: 2px solid #e0e0dc;
  padding: 1.25rem 1.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: 0.82rem;
  color: #888;
  margin-bottom: -0.4rem;
}

.detail-doi {
  margin: 0.25rem 0 0;
}

/* ── Panel sections ── */

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.section-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
}

.abstract-text {
  margin: 0;
  font-size: 0.88rem;
  color: #333;
  line-height: 1.6;
}

.no-content {
  font-size: 0.85rem;
  color: #aaa;
  font-style: italic;
}

/* ── AI summary ── */

.generate-summary-btn {
  align-self: flex-start;
  background: #6b4fa3;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
}

.generate-summary-btn:hover {
  background: #573e8a;
}

.summary-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.source-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 3px;
}

.source-badge.full-text {
  background: #d4edda;
  color: #155724;
}

.source-badge.abstract {
  background: #fff3cd;
  color: #856404;
}

.regenerate-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.regenerate-btn:hover { color: #333; }

.summary-text {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  color: #333;
  line-height: 1.6;
}

.summary-text:last-of-type {
  margin-bottom: 0;
}

.generating {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
}

.error-text {
  font-size: 0.85rem;
  color: #c0392b;
}

/* ── Review section (notes + reviewed-by side by side) ── */

.review-section {
  gap: 0.6rem;
}

.review-fields {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.notes-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.reviewed-by-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

trix-editor.notes-trix {
  font-family: inherit;
  font-size: 0.88rem;
  border: 1px solid #d0d0cc;
  border-radius: 4px;
  background: #fff;
  min-height: 5rem;
  line-height: 1.5;
  color: #222;
  padding: 0.4rem 0.5rem;
}

trix-editor.notes-trix:focus {
  outline: none;
  border-color: #1a5fb4;
}

trix-toolbar {
  max-height: 0;
  overflow: hidden;
  border: none;
  border-radius: 4px 4px 0 0;
  background: #fafafa;
  transition: max-height 0.15s;
}

.notes-group:focus-within trix-toolbar {
  max-height: 80px;
  border: 1px solid #d0d0cc;
  border-bottom: none;
}

.notes-group:focus-within trix-editor.notes-trix {
  border-radius: 0 0 4px 4px;
}

/* Trix attachment button — images only (non-images are rejected in the upload handler) */

.reviewed-by-input {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #d0d0cc;
  border-radius: 4px;
  background: #fff;
  color: #222;
}

.save-status {
  font-size: 0.78rem;
  color: #888;
}

.journal-cell {
  width: 16%;
  color: #444;
  font-style: italic;
}

.authors-cell {
  width: 20%;
  color: #555;
  font-size: 0.88rem;
}

.date-cell {
  width: 8%;
  color: #666;
  white-space: nowrap;
  font-size: 0.88rem;
}

.week-selector {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.week-selector label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #444;
}

.week-selector select {
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.export-btn {
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #444;
  text-decoration: none;
  background: #fff;
  margin-left: 0.25rem;
}

.export-btn:hover {
  background: #f0f0ee;
  color: #111;
}

.search-info {
  font-size: 0.82rem;
  color: #999;
  margin-bottom: 0.75rem;
}

.badge-refreshing {
  color: #666;
  font-style: italic;
}

.no-results {
  color: #666;
  padding: 1rem 0;
}

/* ── Search page ── */

.search-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Disclaimer: sits right under the header, then pins to the top while scrolling */
.disclaimer-sentinel { height: 1px; margin-top: -1px; }

.disclaimer-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #f8f8f6;           /* same as the page, so nothing peeks through */
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  transition: box-shadow 0.15s;
}

.disclaimer-sticky.is-stuck { box-shadow: 0 6px 10px -6px rgba(0,0,0,.28); }

.search-disclaimer {
  margin: 0 auto;
  max-width: 38rem;
  padding: 0.6rem 0.9rem;
  background: #fbefc9;
  border: 1px solid #e3cf8c;
  border-radius: 8px;
  color: #503f0d;
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}

.search-header {
  text-align: center;
  margin-bottom: 1rem;
}

.search-logo-mark {
  width: 60px;
  height: 60px;
  display: block;
  margin: 0 auto 0.7rem;
}

.search-logo {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  margin: 0;
}

.logo-thr {
  color: #1a5fb4;
}

.search-bar-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  color: #999;
  pointer-events: none;
}

/* ── Filter bar ── */

.filter-bar {
  margin-bottom: 1.25rem;
}

/* Always-visible row: the common pills, the Filters button, and sort */
.filter-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid #d8d8d4;
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-family: inherit;
  color: #444;
  cursor: pointer;
}

.filter-toggle:hover { background: #f4f4f2; }

.filter-toggle[aria-expanded="true"] { background: #f4f4f2; border-color: #c4c4bc; }

.filter-toggle-caret { font-size: 0.75rem; transition: transform 0.12s; }

.filter-toggle[aria-expanded="true"] .filter-toggle-caret { transform: rotate(180deg); }

.filter-count {
  background: #1a5fb4;
  color: #fff;
  border-radius: 10px;
  min-width: 1.15rem;
  padding: 0 0.35rem;
  font-size: 0.72rem;
  line-height: 1.15rem;
  text-align: center;
}

/* Secondary filters live in a panel that starts closed */
.filter-panel {
  display: none;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 10px;
}

.filter-bar[data-open="true"] .filter-panel { display: block; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
}

.filter-row + .filter-row { border-top: 1px solid #f0f0ec; }

.filter-group-label {
  flex: 0 0 5.5rem;
  font-size: 0.78rem;
  color: #777;
  font-weight: 500;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex: 1;
}

.filter-footer { display: flex; justify-content: flex-end; }

.filter-footer:has(.filter-clear[hidden]) { display: none; }

.filter-clear {
  background: none;
  border: none;
  padding: 0.25rem 0;
  font-family: inherit;
  font-size: 0.8rem;
  color: #1a5fb4;
  cursor: pointer;
}

.filter-clear:hover { text-decoration: underline; }

.date-input {
  font-size: 0.82rem;
  font-family: inherit;
  padding: 0.28rem 0.45rem;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  background: #f4f4f2;
  color: #444;
}

.date-input:focus {
  outline: none;
  border-color: #1a5fb4;
  box-shadow: 0 0 0 3px rgba(26,95,180,.12);
}

.date-dash { color: #999; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.filter-pill {
  background: #f4f4f2;
  border: 1px solid #d8d8d4;
  border-radius: 20px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  color: #444;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.filter-pill:hover {
  background: #eaeae6;
}

.filter-pill[data-active="true"] {
  background: #1a5fb4;
  border-color: #1a5fb4;
  color: #fff;
}

.reviewer-pill--clive[data-active="true"] {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

.reviewer-pill--arielle[data-active="true"] {
  background: #1a5fb4;
  border-color: #1a5fb4;
  color: #fff;
}

.filter-sort {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.sort-label {
  font-size: 0.82rem;
  color: #777;
  white-space: nowrap;
}

.sort-select {
  font-size: 0.82rem;
  font-family: inherit;
  padding: 0.3rem 0.5rem;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  background: #f4f4f2;
  color: #444;
  cursor: pointer;
}

.search-input {
  width: 100%;
  font-size: 1.02rem;
  font-family: inherit;
  color: #1a1a1a;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  border: 1px solid #d8d8d2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.search-input:hover {
  border-color: #c4c4bc;
}

.search-input:focus {
  outline: none;
  border-color: #1a5fb4;
  box-shadow: 0 0 0 3px rgba(26,95,180,.12);
}

.search-results {
  flex: 1;
}

.search-hint {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  margin: 2.5rem 0 0;
}

.result-count {
  color: #777;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

#load-more-wrap {
  margin-top: 1rem;
  text-align: center;
}

.load-more-btn {
  font-family: inherit;
  font-size: 0.88rem;
  color: #1a5fb4;
  background: #fff;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  padding: 0.55rem 1.4rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.load-more-btn:hover {
  background: #f0f5fc;
  border-color: #1a5fb4;
}

.load-more-btn:disabled {
  color: #999;
  cursor: default;
}

.result-card {
  background: #fff;
  border: 1px solid #e8e8e4;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  overflow: hidden;
  transition: box-shadow 0.12s, border-color 0.12s;
  animation: cardIn 0.24s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.result-card:hover {
  border-color: #d4d4ce;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

/* Reviewer spine — colour-coded left edge on reviewed papers */
.result-card--clive   { border-left: 3px solid #c0392b; }
.result-card--arielle { border-left: 3px solid #1a5fb4; }
.result-card--other   { border-left: 3px solid #2e9e6b; }

.result-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
}

.result-header:focus-visible {
  outline: 2px solid #1a5fb4;
  outline-offset: -2px;
}

.result-header:hover .result-title {
  color: #1a5fb4;
}

.result-num {
  color: #c4c4be;
  font-size: 0.82rem;
  flex-shrink: 0;
  min-width: 1.4rem;
  text-align: right;
}

.result-main {
  flex: 1;
  min-width: 0;
}

.result-titlerow {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.result-title {
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  font-weight: 600;
  font-size: 1.02rem;
  color: #1a1a1a;
  line-height: 1.38;
}

.result-caret {
  flex-shrink: 0;
  color: #bbb;
  font-size: 0.8rem;
  align-self: center;
  transition: transform 0.15s;
}

.result-header[aria-expanded="true"] .result-caret {
  transform: rotate(90deg);
}

.result-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.reviewed-badge,
.must-read-badge,
.omg-badge {
  display: inline-flex;
  align-items: center;
  height: 1.35rem;
  padding: 0 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.reviewed-badge {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #d4edda;
  color: #155724;
}

.reviewed-badge--clive {
  background: #fde8e8;
  color: #c0392b;
}

.reviewed-badge--arielle {
  background: #dce8f8;
  color: #1a5fb4;
}

.must-read-badge {
  background: #fff3cd;
  color: #856404;
}

.omg-badge {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  background: #fdecec;
}

.result-meta {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: #888;
}

/* Smooth expand/collapse via the grid-rows 0fr→1fr trick (no fixed height) */
.result-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.result-detail-inner {
  overflow: hidden;
  min-height: 0;
  /* Stays visible through the collapse animation, then drops out of the tab
     order once collapsed; appears immediately on expand. */
  visibility: hidden;
  transition: visibility 0s linear 0.25s;
}

.result-header[aria-expanded="true"] ~ .result-detail {
  grid-template-rows: 1fr;
}

.result-header[aria-expanded="true"] ~ .result-detail .result-detail-inner {
  visibility: visible;
  transition: visibility 0s;
}

.notes-readonly {
  font-size: 0.88rem;
  color: #333;
  line-height: 1.6;
}

.notes-readonly p {
  margin: 0 0 0.85em;
}

/* ── Landing state: about, lead, stats, example chips ── */

.hint-about {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 36rem;
  margin: 0 auto 1.4rem;
}

.hint-lead {
  color: #888;
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.hint-stats {
  color: #aaa;
  font-size: 0.85rem;
  margin: 0 0 1.4rem;
}

.hint-stats strong {
  color: #555;
  font-weight: 600;
}

.hint-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  align-items: center;
}

.hint-chips-label {
  font-size: 0.82rem;
  color: #bbb;
  margin-right: 0.15rem;
}

.hint-chip {
  font-family: inherit;
  font-size: 0.83rem;
  color: #1a5fb4;
  background: #eef3fb;
  border: 1px solid #dce6f5;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.hint-chip:hover {
  background: #e1ecfa;
  border-color: #b9d0ee;
}

/* ── Skeleton loading shimmer ── */

.skeleton-card {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
}

.sk-num { width: 1rem; height: 0.7rem; border-radius: 4px; background: #eee; flex-shrink: 0; }
.sk-main { flex: 1; }

.sk-line {
  height: 0.7rem;
  border-radius: 4px;
  background: linear-gradient(90deg, #ececec 25%, #f6f6f6 37%, #ececec 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

.sk-title { width: 72%; margin-bottom: 0.6rem; }
.sk-meta  { width: 45%; height: 0.6rem; }

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ── AI critique & reviewer-note callouts ── */

/* Violet, so AI text never reads as a reviewer's (Clive red, Arielle blue) */
.panel-section--ai {
  background: #f6f3fb;
  border: 1px solid #e6def3;
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.ai-glyph { color: #6b4fa3; margin-right: 0.1rem; }

.ai-disclaimer {
  margin: 0;
  font-size: 0.78rem;
  font-style: italic;
  color: #7a6c93;
}

.copy-link-btn {
  margin-left: auto;
  background: none;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  font-family: inherit;
  color: #555;
  cursor: pointer;
}

.copy-link-btn:hover { background: #f0f0ec; }

.panel-section--notes blockquote.notes-readonly {
  margin: 0;
  padding: 0.55rem 0.9rem;
  border-left: 3px solid #ccc;
  background: #fafafa;
  border-radius: 0 6px 6px 0;
}

.notes-readonly p:last-child { margin-bottom: 0; }
.notes-readonly.notes-clive   { border-left-color: #c0392b; }
.notes-readonly.notes-arielle { border-left-color: #1a5fb4; }
.notes-readonly.notes-other   { border-left-color: #2e9e6b; }

.notes-attr {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
}

.notes-attr--clive   { color: #c0392b; }
.notes-attr--arielle { color: #1a5fb4; }
.notes-attr--other   { color: #2e9e6b; }

@media (prefers-reduced-motion: reduce) {
  .result-card { animation: none; }
  .result-detail { transition: none; }
  .sk-line { animation: none; }
}

/* ── Search page: mobile ── */

@media (max-width: 640px) {
  .search-page {
    padding: 2rem 1rem 1.5rem;
  }

  .search-logo { font-size: 1.6rem; }
  .search-disclaimer { font-size: 0.78rem; padding: 0.5rem 0.75rem; }
  .search-tagline { font-size: 0.85rem; }

  /* Panel rows stack: label above controls */
  .filter-row { flex-direction: column; align-items: stretch; gap: 0.35rem; }
  .filter-group-label { flex: none; }
  .filter-sort { margin-left: 0; width: 100%; justify-content: space-between; }
  .sort-select { flex: 1; margin-left: 0.5rem; }

  /* Stack badges below the title instead of beside it */
  .result-header { padding: 0.75rem 0.85rem; }
  .result-titlerow { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .result-caret { display: none; }
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top-color: #555;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 0.75rem;
}

/* ── Import review docs (editor) ─────────────────────────────────────────── */
.doc-import {
  margin-bottom: 1.25rem;
  border: 1px solid #e2e2dd;
  border-radius: 6px;
  background: #fafaf8;
  padding: 0.5rem 0.85rem;
}

.doc-import-summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a5fb4;
  list-style: none;
}
.doc-import-summary::-webkit-details-marker { display: none; }
.doc-import-summary::before { content: "＋ "; font-weight: 400; }
.doc-import[open] .doc-import-summary::before { content: "－ "; }

.doc-import-hint {
  margin: 0.6rem 0 0.5rem;
  font-size: 0.8rem;
  color: #666;
  line-height: 1.4;
}

.doc-import-urls {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}

.doc-import-actions {
  margin-top: 0.5rem;
}

.doc-import-btn {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border: 1px solid #1a5fb4;
  border-radius: 4px;
  background: #1a5fb4;
  color: #fff;
  cursor: pointer;
}
.doc-import-btn:hover { background: #17539f; }
.doc-import-btn:disabled { opacity: 0.6; cursor: default; }

.doc-import-results {
  list-style: none;
  margin: 0.75rem 0 0.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.di-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.di-badge {
  flex: none;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  color: #fff;
  min-width: 4.7rem;
  text-align: center;
}
.di-badge--queued    { background: #9a9a92; }
.di-badge--importing { background: #d98a1f; }
.di-badge--done      { background: #2e9e6b; }
.di-badge--error     { background: #c0392b; }

.di-detail { color: #333; word-break: break-word; }
.di-item--error .di-detail { color: #a5311f; }

@media (prefers-color-scheme: dark) {
  .doc-import { background: #1c1c1a; border-color: #333; }
  .doc-import-hint { color: #9a9a92; }
  .doc-import-urls { background: #111; color: #ddd; border-color: #444; }
  .di-detail { color: #ccc; }
}
