:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: #0a0a0a;
  --panel-raised: #111111;
  --ink: #ededed;
  --muted: #a3a3a3;
  --faint: #737373;
  --line: #262626;
  --line-light: #1f1f1f;
  --white: #ededed;
  --blue: #ededed;
  --green: #69b77b;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-soft: cubic-bezier(.22, .61, .36, 1);
  --motion-fast: 140ms;
  --motion-base: 240ms;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea { font: inherit; }
button { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 52px;
  background: rgba(8, 8, 8, 0.9);
  border-bottom: 1px solid var(--line-light);
  backdrop-filter: blur(18px);
  animation: topbar-in 420ms var(--ease-out) both;
}

.topbar-inner {
  position: relative;
  width: min(1152px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.global-nav {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 24px;
  transform: translateX(-50%);
}

.global-nav a {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  transition: color var(--motion-fast) ease, opacity var(--motion-fast) ease;
}

.global-nav a:hover,
.global-nav a.active { color: var(--ink); }

.search-trigger {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.search-trigger:hover { border-color: var(--line); background: var(--panel-raised); color: var(--ink); transform: translateY(-1px); }
.search-trigger:active { transform: scale(.95); }
.search-trigger.has-query::after { content: ""; position: absolute; width: 4px; height: 4px; margin: -16px -16px 0 0; border-radius: 50%; background: var(--ink); }

.search-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.create-button {
  height: 28px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: #111;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.create-button:hover { background: #fff; transform: translateY(-1px); }
.create-button:active { transform: scale(.97); }

.main-content {
  width: min(672px, 100%);
  margin: 0 auto;
  padding: 96px 24px;
}

.command-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: min(16vh, 140px) 20px 20px;
  background: rgba(0, 0, 0, .58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  backdrop-filter: blur(7px);
}
.command-backdrop { visibility: hidden; }
.command-backdrop.open { opacity: 1; pointer-events: auto; visibility: visible; }

.command-panel {
  width: min(600px, 100%);
  overflow: hidden;
  border: 1px solid #303030;
  border-radius: 14px;
  background: rgba(17, 17, 17, .97);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  transform: translateY(-8px) scale(.99);
  transition: transform 190ms var(--ease-out);
}
.command-backdrop.open .command-panel { transform: none; }

.command-input-row {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
}
.command-input-row > svg { width: 18px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.command-input-row input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: var(--font-text); font-size: 16px; }
.command-input-row input::placeholder { color: #6f6f6f; }
.command-input-row input::-webkit-search-cancel-button { display: none; }
.command-input-row button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.command-input-row button:hover { background: #242424; color: var(--ink); }
.command-input-row button[hidden] { display: none; }
.command-input-row button svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.command-results { max-height: 342px; overflow-y: auto; padding: 6px; }
.command-empty { min-height: 112px; display: grid; place-items: center; padding: 24px; color: var(--faint); font-size: 12px; text-align: center; }
.command-result {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.command-result.selected { background: #262626; }
.command-result strong { display: block; overflow: hidden; font-size: 12px; line-height: 17px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.command-result span { display: block; margin-top: 1px; overflow: hidden; color: var(--faint); font-size: 9px; line-height: 14px; text-overflow: ellipsis; white-space: nowrap; }
.command-result small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.command-footer { min-height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: 8px; }
.command-keys { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.command-keys kbd { min-width: 20px; padding: 1px 4px; border: 1px solid #383838; border-radius: 4px; background: #202020; color: var(--muted); font: inherit; text-align: center; }

.proceedings { scroll-margin-top: 64px; }

.proceedings.view-enter .section-heading h1,
.proceedings.view-enter .section-heading p,
.proceedings.view-enter .scope-list:not([hidden]),
.proceedings.view-enter .collection-toolbar {
  animation: content-in 360ms var(--ease-out) backwards;
}

.proceedings.view-enter .section-heading p { animation-delay: 35ms; }
.proceedings.view-enter .scope-list:not([hidden]) { animation-delay: 65ms; }
.proceedings.view-enter .collection-toolbar { animation-delay: 90ms; }

.section-heading {
  width: 100%;
  padding: 0 0 26px;
}

.section-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 28.8px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-lead {
  max-width: 620px;
  margin: 13px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 19.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.section-heading p:not(.section-lead) {
  max-width: 560px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 18.85px;
  letter-spacing: 0;
}

.collection-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.status-tabs { display: flex; align-self: stretch; gap: 22px; min-width: 0; }
.status-tabs[hidden] { display: none; }

.scope-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.scope-list[hidden] { display: none; }
.scope-list[data-view="browse"],
.scope-list[data-view="venues"],
.scope-list[data-view="institutions"] {
  display: block;
  margin-top: -8px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.scope-picker {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.institution-kind-tabs {
  width: fit-content;
  display: flex;
  gap: 22px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.institution-kind-tab {
  position: relative;
  padding: 0 0 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--motion-fast) ease;
}

.institution-kind-tab:hover,
.institution-kind-tab.active { color: var(--ink); }

.institution-kind-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms var(--ease-out);
}
.institution-kind-tab.active::after { transform: scaleX(1); }

.scope-controls {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.scope-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.scope-select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 5px;
  height: 5px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}

.scope-select {
  min-width: 152px;
  height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  appearance: none;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.scope-list[data-view="institutions"] .scope-select-wrap:not(.year-select-wrap),
#institution-select { width: min(296px, 100%); }
.year-select { min-width: 110px; }
.scope-select:hover { border-color: #383838; }
.scope-select:focus-visible { border-color: #626262; box-shadow: 0 0 0 3px rgba(255, 255, 255, .045); }
.scope-picker-meta { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }
.scope-picker-meta b { color: var(--ink); font-weight: 600; }

.status-tab {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color var(--motion-fast) ease;
}

.status-tab::before {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms var(--ease-out);
}

.status-tab:hover,
.status-tab.active { color: var(--ink); }
.status-tab.active::before { transform: scaleX(1); }
.status-count { margin-left: 4px; color: var(--faint); font-size: 8px; font-variant-numeric: tabular-nums; }
.status-count:empty { display: none; }

.toolbar-actions { display: flex; align-items: center; gap: 9px; }
.results-summary { color: var(--muted); font-size: 11.5px; }

.toolbar-icon-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--motion-fast) ease, border-color var(--motion-fast) ease, background var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}
.toolbar-icon-button:hover { border-color: var(--line); background: var(--panel-raised); color: var(--ink); transform: translateY(-1px); }
.toolbar-icon-button:active { transform: scale(.96); }
.toolbar-icon-button svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.filter-button {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  transition: color var(--motion-fast) ease, border-color var(--motion-fast) ease, background var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.filter-button:hover { border-color: var(--line); background: var(--panel-raised); color: var(--ink); transform: translateY(-1px); }
.filter-button:active { transform: scale(.96); }
.filter-button svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.pin-grid { --pin-columns: 2; display: flex; align-items: flex-start; gap: 16px; }
.pin-column { flex: 1 1 0; min-width: 0; }
.pin-grid > .empty-state { flex: 1 1 100%; }

.pin-card {
  width: 100%;
  display: block;
  margin: 0 0 28px;
  outline: none;
  cursor: pointer;
  transform-origin: center top;
  transition: transform var(--motion-base) var(--ease-out);
}

.pin-card.reveal-pending { opacity: 0; }
.pin-card.is-revealing { animation: card-in 340ms var(--ease-out) backwards; }

.pin-visual {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  transition: border-color var(--motion-base) ease, box-shadow var(--motion-base) var(--ease-out);
}

.pin-card:focus-visible .pin-visual { outline: 2px solid #6d6d6d; outline-offset: 2px; }

.pin-visual img,
.drawer-hero img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 420ms var(--ease-out);
}

.pin-visual img.is-loaded,
.drawer-hero img.is-loaded { opacity: 1; }

/* Every card reserves its figure's real aspect ratio (the img carries width and
   height attributes), so decoding a picture never shifts the tiles below it. */
.pin-visual:has(img:not(.is-loaded)) { background: var(--panel-raised); }

.pin-visual img,
.drawer-hero img { background: #f5f5f5; }

.pin-visual > img { transition: transform 420ms var(--ease-soft); }

.award-record-visual {
  min-height: 184px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #111;
}

.award-record-top,
.award-record-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.award-record-top { color: var(--muted); font-size: 10px; }
.award-record-top span:first-child { color: var(--ink); font-size: 12px; font-weight: 550; }
.award-record-bottom > span { font-size: 12px; font-weight: 520; }
.award-record-bottom small { max-width: 65%; color: var(--faint); font-size: 8px; text-align: right; }
.award-record-mark { display: flex; align-items: center; gap: 5px; }
.award-record-mark i { width: 5px; height: 5px; border: 1px solid #666; border-radius: 50%; }
.award-record-mark i:nth-child(2) { width: 34px; border-radius: 4px; }
.drawer-hero .award-record-visual { min-height: 310px; }
.figure-unavailable { min-height: 184px; display: grid; place-items: center; color: var(--faint); font-size: 9px; }
.drawer-hero .figure-unavailable { min-height: 310px; }

.pin-overlay {
  position: absolute;
  inset: 0;
  padding: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--motion-fast) ease;
}

.pin-card:hover .pin-overlay,
.pin-card:focus-within .pin-overlay { opacity: 1; }
.pin-badge { display: none; }

.save-button {
  height: 27px;
  padding: 0 10px;
  border: 1px solid #303030;
  border-radius: 14px;
  background: rgba(8, 8, 8, 0.88);
  color: var(--ink);
  font-size: 9px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.save-button.saved { border-color: var(--white); background: var(--white); color: #111; }
.save-button:hover { transform: translateY(-1px); }
.save-button:active { transform: scale(.94); }
.pin-meta { padding: 10px 1px 0; }
.pin-title-row { display: flex; align-items: flex-start; gap: 6px; }

.pin-title-row h3 {
  flex: 1;
  margin: 0;
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pin-byline { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 11.5px; line-height: 16px; }
.pin-byline strong { color: var(--ink); font-weight: 550; }
.pin-byline > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-byline small { margin-left: auto; flex: 0 0 auto; color: var(--faint); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
@keyframes shimmer { to { background-position: -200% 0; } }

.skeleton {
  background-image: linear-gradient(90deg, #141414 0%, #222222 45%, #141414 90%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

.pin-skeleton { width: 100%; margin: 0 0 28px; }
.pin-skeleton .pin-visual { border-radius: 9px; }
/* Matches .pin-meta so the placeholder text sits exactly where the real
   title will, and nothing slides sideways when the catalog lands. */
.pin-skeleton .skeleton-line { margin-top: 9px; }
.pin-skeleton .skeleton-line span { display: block; height: 9px; border-radius: 3px; }
.pin-skeleton .skeleton-line.short span { width: 52%; }

.drawer-skeleton { display: block; }
.drawer-skeleton .skeleton-line { display: block; height: 11px; margin-bottom: 10px; border-radius: 3px; }
.drawer-skeleton .skeleton-line:nth-child(2) { width: 92%; }
.drawer-skeleton .skeleton-line:nth-child(3) { width: 74%; }

.empty-state { min-height: 300px; display: grid; place-items: center; text-align: center; color: var(--faint); font-size: 12px; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 17px; font-weight: 550; }

.feed-end { padding: 23px 0 60px; display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.feed-end span { flex: 1; height: 1px; background: var(--line); }
.feed-end button { border: 0; padding: 4px 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.feed-end button:disabled { cursor: default; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  backdrop-filter: blur(3px);
}
.drawer-backdrop { visibility: hidden; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; visibility: visible; }

.detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 36;
  width: min(510px, 96vw);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--bg);
  transform: translateX(102%);
  transition: transform 250ms cubic-bezier(.2,.8,.2,1);
}
.detail-drawer { visibility: hidden; transition: transform 250ms cubic-bezier(.2,.8,.2,1), visibility 0s linear 250ms; }
.detail-drawer.open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.detail-drawer.open #drawer-content { animation: drawer-content-in 360ms 70ms var(--ease-out) backwards; }
.detail-drawer > .close-button { position: absolute; top: 18px; right: 18px; z-index: 2; }

.close-button {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(13, 13, 13, .9);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}
.close-button:hover { border-color: #3a3a3a; background: var(--panel-raised); transform: rotate(4deg); }
.close-button:active { transform: scale(.92); }
.close-button svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.drawer-hero { margin: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.drawer-body { padding: 19px 28px 40px; }
.drawer-label { display: block; color: var(--faint); font-size: 11px; }

.drawer-body p.is-loading { opacity: .45; }
.drawer-body h2 {
  margin: 9px 0 11px;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.1;
  font-weight: 610;
  letter-spacing: -0.03em;
}

.drawer-body > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.58; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 20px; }
.drawer-actions button,
.drawer-actions a { flex: 0 1 auto; height: 32px; padding: 0 12px; white-space: nowrap; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--ink); font-size: 12.5px; line-height: 30px; font-weight: 500; text-align: center; text-decoration: none; cursor: pointer; transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out); }
.drawer-actions button:hover,
.drawer-actions a:hover { background: var(--panel-raised); }
.drawer-actions .primary { border-color: var(--white); background: var(--white); color: #111; }
.drawer-actions .primary:hover { background: #fff; }
.drawer-actions button:active,
.drawer-actions a:active { transform: scale(.98); }
.evidence-box { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.evidence-head { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px 7px; font-size: 11px; }
.evidence-head span { color: var(--faint); white-space: nowrap; }
.evidence-item { padding: 0 12px 10px; display: grid; grid-template-columns: 4px 1fr; gap: 9px; color: var(--muted); font-size: 12.5px; line-height: 18.75px; }
.evidence-item i { width: 4px; height: 4px; margin-top: 7px; border-radius: 50%; background: var(--faint); }
.drawer-body a:not(.primary):not([class]) {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 2px;
}
.drawer-body a:not(.primary):not([class]):hover { text-decoration-color: var(--ink); }

.drawer-meta { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.drawer-meta div { padding: 12px 3px 10px; border-bottom: 1px solid var(--line); }
.drawer-meta div:nth-child(odd) { padding-right: 14px; }
.drawer-meta span { display: block; color: var(--faint); font-size: 10px; }
.drawer-meta strong { display: block; margin-top: 3px; font-size: 12.5px; line-height: 18px; font-weight: 500; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.68);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  backdrop-filter: blur(9px);
}
.modal-backdrop { visibility: hidden; }
.modal-backdrop.open { opacity: 1; pointer-events: auto; visibility: visible; }

.access-modal {
  position: relative;
  width: min(420px, 96vw);
  padding: 31px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
  transform: scale(.985) translateY(6px);
  transition: transform 220ms var(--ease-out);
}
.modal-backdrop.open .access-modal { transform: none; }
.access-modal > .close-button { position: absolute; top: 18px; right: 18px; }
.access-kicker { color: var(--faint); font-size: 8px; font-weight: 550; letter-spacing: .08em; }
.access-modal h2 { max-width: 310px; margin: 24px 0 12px; font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.03em; }
.access-modal > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 20px; }
.access-includes { display: flex; gap: 0; margin-top: 25px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.access-includes span { flex: 1; text-align: center; }
.access-includes span + span { border-left: 1px solid var(--line); }
.access-form { margin-top: 22px; }
.access-form label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 500; }
.access-form input {
  width: 100%;
  height: 43px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}
.access-form input::placeholder { color: var(--faint); }
.access-form input:focus { border-color: #555; background: var(--panel-raised); }
.access-form input[aria-invalid="true"] { border-color: #98524c; }
.access-message { min-height: 14px; margin: 7px 1px 0; color: var(--faint); font-size: 8px; line-height: 14px; }
.access-message.error { color: #d7867f; }
.access-message.success { color: var(--green); }
.access-form .access-button { margin-top: 12px; }
.access-form .access-button:disabled { cursor: default; opacity: .72; }
.access-modal > small { display: block; margin-top: 9px; color: var(--faint); font-size: 8px; text-align: center; }

.generate-button { width: 100%; height: 42.5px; margin-top: 26px; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 999px; background: var(--white); color: #111; font-size: 15px; line-height: 22.5px; font-weight: 500; cursor: pointer; }
.generate-button:hover { background: #fff; }
.generate-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.filter-panel {
  position: fixed;
  top: 62px;
  right: max(20px, calc((100vw - 980px) / 2));
  z-index: 32;
  width: 260px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 13, 13, .97);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms var(--ease-out);
  backdrop-filter: blur(18px);
}
.filter-panel { visibility: hidden; }
.filter-panel.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.filter-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.filter-panel-head strong { font-size: 14px; font-weight: 550; }
.filter-panel-head button { width: 25px; height: 25px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.filter-panel-head svg { width: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.filter-panel > .filter-panel-label { display: block; margin: 14px 0 7px; color: var(--faint); font-size: 8px; font-weight: 500; }
.check-list { display: grid; gap: 2px; }
.check-list button { min-height: 29px; display: flex; align-items: flex-start; gap: 8px; padding: 6px 3px; border: 0; background: transparent; font-size: 10px; line-height: 1.25; text-align: left; cursor: pointer; }
.check-list button small { margin: 1px 0 0 auto; color: var(--faint); font-size: 8px; }
.check-list button span { width: 13px; height: 13px; margin-top: 0; flex: 0 0 auto; border: 1px solid #494949; border-radius: 3px; }
.check-list button.selected span { border-color: var(--white); background: var(--white); box-shadow: inset 0 0 0 3px var(--panel); }
.apply-filter { width: 100%; height: 42.5px; margin-top: 18px; padding: 10px 20px; border: 0; border-radius: 999px; background: var(--white); color: #111; font-size: 15px; line-height: 22.5px; font-weight: 500; cursor: pointer; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 55;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(18, 18, 18, .95);
  color: var(--ink);
  font-size: 9px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(12px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: "✓"; margin-right: 7px; color: var(--green); }

@media (hover: hover) {
  .pin-card:hover { transform: translateY(-2px); }
  .pin-card:hover .pin-visual {
    border-color: #383838;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
  }
  .pin-card:hover .pin-visual > img { transform: scale(1.006); }
}

@keyframes topbar-in {
  from { opacity: 0; transform: translateY(-6px); }
}

@keyframes content-in {
  from { opacity: 0; transform: translateY(7px); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(.995); }
}

@keyframes drawer-content-in {
  from { opacity: 0; transform: translateX(8px); }
}

@media (max-width: 820px) {
  .pin-grid { --pin-columns: 2; }
}

@media (max-width: 680px) {
  .detail-drawer { width: 100%; border-left: 0; }
  .drawer-body h2 { font-size: 18px; }
  .topbar-inner { width: calc(100% - 24px); justify-content: space-between; gap: 10px; }
  /* The nav was absolutely centred, which overlapped the two right-hand
     buttons by 55-115px on every phone width. It is a normal flex row here. */
  .global-nav {
    position: static;
    transform: none;
    gap: 15px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .global-nav::-webkit-scrollbar { display: none; }
  .global-nav a { font-size: 13px; white-space: nowrap; }

  /* Tiles run edge to edge; only the text blocks keep a margin. */
  .main-content { width: 100%; padding: 0; }
  .section-heading,
  .collection-toolbar,
  .scope-list,
  .feed-end { padding-left: 0; padding-right: 0; }
  .pin-grid { gap: 6px; }
  .pin-card { margin-bottom: 6px; }
  .pin-meta { padding: 0; }
  .status-tabs { scrollbar-width: none; }
  .status-tabs::-webkit-scrollbar { display: none; }
  .section-heading { padding: 22px 0 16px; }
  .section-heading h1 { font-size: 21px; line-height: 25px; }
  .section-lead { margin-top: 10px; font-size: 14px; line-height: 18.5px; }
  .section-heading p:not(.section-lead) { margin-top: 6px; font-size: 12.5px; line-height: 18px; }
  .scope-list { margin-bottom: 18px; }
  .scope-list[data-view="browse"],
  .scope-list[data-view="venues"],
  .scope-list[data-view="institutions"] { margin-top: -2px; }

  /* The tab row scrolls; fading its edge says so, instead of slicing a label
     in half against the toolbar buttons. */
  .status-tabs {
    mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
    padding-right: 6px;
  }
  .collection-toolbar { gap: 12px; }
  .status-tabs { gap: 19px; overflow-x: auto; }
  .scope-list { grid-template-columns: 1fr 1fr; }
  .scope-list[data-view="browse"],
  .scope-list[data-view="venues"],
  .scope-list[data-view="institutions"] { display: block; }
  .scope-picker { align-items: flex-start; flex-direction: column; gap: 8px; }
  .scope-picker-meta { text-align: left; white-space: normal; }
  .results-summary { display: none; }
  .modal-backdrop { padding: 0; }
  .filter-panel { top: 58px; right: 8px; left: 8px; width: auto; }
}

@media (max-width: 440px) {
  .status-tabs { gap: 16px; }
  .status-tab { white-space: nowrap; }
  .pin-grid { --pin-columns: 2; }
  .pin-title-row h3 { font-size: 13px; line-height: 17.5px; }
  .pin-byline { font-size: 10.5px; margin-top: 5px; gap: 5px; }
  .pin-byline small { font-size: 8px; }
  /* On a ~190px tile this label costs half the row while saying the same thing
     on every source card. Award records keep theirs: there it is the
     distinction between an extracted figure and an index entry. */
  .pin-card:not(.award-card) .pin-byline small { display: none; }
  .pin-meta,
  .pin-skeleton .skeleton-line { padding: 0; }
  .command-backdrop { padding: 74px 10px 10px; }
  .command-footer > span:first-child { display: none; }
  .command-footer { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
  }
}
