/* Add global and layout styles here */
/* Tab header layout from earlier refactor */

  :root{
    --bg: #f7f9fb;
    --panel-bg: #ffffff;
    --ink: #1f2937;
    --muted: #64748b;
    --ring: #94a3b8;
    --chip: #eef2f7;
    --tooltip-bg: #ffffff;
    --tooltip-border: #cbd5e1;
    --focus: #2563eb33; /* soft focus ring */
    --brand-blue: #2563eb;
    --tag-bg: hsl(210 16% 96%);
    --tag-fg: hsl(210 10% 30%);
    --font-accent: darkblue;
  }
:root {
  --bg: #fdfcfb;
  --panel-bg: #ffffff;
  --ink: #253247;
  --muted: #7c8695;
  --focus: #0077b6;
}

  html, body { height: 100%; }
  body { margin: 0; font: 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji"; color: var(--ink); background: var(--bg); }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* fallback */
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* header stays its natural size */
header.main-tabs {
  flex: 0 0 auto; /* do not grow/shrink */
  z-index: 20;
}

#main-view { display: flex; flex: 1 1 auto; min-height: 0; width: 100%;}
/* the view-wrapper should also fill and allow inner scrolling */
.view-wrapper { display: flex; flex: 1 1 auto; min-height: 0; width: 100%; }

 svg{ width:100%; height:100%; display:block; outline:none; background: var(--bg); }

header.main-tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 6px 16px 0;
  border-bottom: 1px solid var(--tooltip-border);
  background: var(--panel-bg);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.brand img {
  height: 24px;
  border-radius: 6px;
}
.brand-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  color:#2c356e;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
  margin-top: 2px;
}
.nav-tabs {
  display: flex;
  gap: 24px;
  margin-left: 0;
}
.nav-tabs button {
  appearance: none;
  background: none;
  border: none;
  padding: 10px 0 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.nav-tabs button:hover {
  color: var(--ink);
}
.nav-tabs button.active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

.library-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: var(--bg);
}

.library-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--tooltip-border);
  background: var(--panel-bg);
}

.library-search input {
  width: 100%;
  padding: 10px 12px;
  border: none;
  font: inherit;
  background: transparent;
}

.library-search-input {
  position: relative;
  border: 1px solid var(--tooltip-border);
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 36px;
}

.library-search-input:focus-within {
  box-shadow: 0 0 0 2px var(--focus);
}

.library-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.library-search-clear:hover {
  color: var(--ink);
}

.library-search-spinner {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--tooltip-border);
  border-top-color: var(--brand-blue);
  animation: library-spin 0.75s linear infinite;
}

@keyframes library-spin {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

.library-mode {
  display: inline-flex;
  background: var(--chip);
  border: 1px solid var(--tooltip-border);
  border-radius: 12px;
  padding: 3px;
  gap: 4px;
}

.library-mode button {
  appearance: none;
  border: none;
  background: none;
  padding: 8px 18px;
  font: 600 13px system-ui, sans-serif;
  color: var(--muted);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

.library-mode button:hover {
  color: var(--ink);
}

.library-mode button.is-active {
  background: white;
  color: black;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}


.library-results {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 24px;
}

.library-filter-bar {
  padding: 12px 16px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--tooltip-border);
  position: sticky;
  top: 72px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.library-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.library-filter-label.is-hidden {
  display: none;
}

.library-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-size: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.library-filter-chip.is-topic {
  --topic-color: var(--tag-bg);
  border-color: color-mix(in oklab, var(--topic-color) 45%, transparent);
  background: color-mix(in oklab, var(--topic-color) 12%, #fff);
  color: #0f172a;
}

.library-filter-chip.is-topic .chip-swatch {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--topic-color);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--topic-color) 28%, transparent);
}

@supports not (color: color-mix(in oklab, white, black)) {
  .library-filter-chip.is-topic {
    border-color: var(--topic-color);
    background: #ffffff;
  }

  .library-filter-chip.is-topic .chip-swatch {
    box-shadow: none;
  }
}

.library-filter-chip:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.library-filter-chip .chip-icon {
  font-weight: 600;
  opacity: 0.7;
  font-size: 11px;
}

.library-filter-chip .remove {
  font-size: 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

.library-filter-chip .remove:hover {
  color: var(--brand-blue);
}

.library-filter-chip.is-new {
  animation: chip-intro 0.28s ease-out;
}

.library-filter-chip.is-hidden {
  display: none;
}

.library-filter-more {
  border: 1px dashed var(--tooltip-border);
  border-radius: 999px;
  padding: 4px 12px;
  background: none;
  color: var(--brand-blue);
  font-size: 12px;
  cursor: pointer;
}

.library-filter-more:hover {
  background: rgba(37, 99, 235, 0.08);
}

.library-filter-more:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.library-filter-clear {
  margin-left: 8px;
  border: none;
  background: none;
  color: var(--brand-blue);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

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

.library-body{
  display:flex;
  min-height:0;
  flex:1 1 auto;
  height:100%;
}

.library-main{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  position:relative;
}

.library-sidebar{
  flex:0 0 340px;
  max-width: 42vw;
  background: var(--panel-bg);
  border-left:1px solid var(--tooltip-border);
  box-shadow:-8px 0 24px rgba(0,0,0,0.05);
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow-y:auto;
}

.library-sidebar h3{
  margin:0;
  font-size:14px;
  letter-spacing:.2px;
  color: var(--muted);
  text-transform: uppercase;
}

.library-sidebar .sidebar-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.library-sidebar .sidebar-search{
  display:flex;
  align-items:center;
  gap:6px;
  border:1px solid var(--tooltip-border);
  border-radius:8px;
  padding:6px 8px;
  background:#fff;
}

.library-sidebar .sidebar-search input{
  flex:1;
  border:none;
  background:transparent;
  font: inherit;
  outline:none;
}

.library-sidebar .sidebar-breadcrumb{
  font-size:12px;
  color: var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
}

.library-sidebar .sidebar-back{
  border:none;
  background:none;
  color: var(--brand-blue);
  cursor:pointer;
  padding:0;
  font-size:12px;
}

.library-topic-list{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  /* gap:8px; */
  overflow:auto;
}

.library-topic-list li{
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* or stretch */
  padding: 4px 4px 4px 0;
  font-size: 12px;
  background: #fff;
  min-width: 0;   
}

.library-topic-list li button{
  width:100%;
  border:1px solid var(--tooltip-border);
  background:#fff;
  border-radius:10px;
  padding:4px 8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
  text-align:left;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-size: 12px;
}

.library-topic-list li button:hover{
  border-color: var(--brand-blue);
  box-shadow:0 4px 12px rgba(0,0,0,0.06);
}

.library-topic-name{
  align-items:center;        /* NEW */
  flex:1 1 auto;             /* NEW: take remaining space */
  min-width:0;               /* NEW: allow shrinking so ellipsis can trigger */
  overflow:hidden;           /* NEW */
  white-space:nowrap;        /* NEW */
  text-overflow:ellipsis;    /* NEW */
  padding-left: 2px;
  cursor: pointer;
}

.library-topic-dot{
  width:12px;
  height:12px;
  border-radius:999px;
  background: var(--topic-color, #94a3b8);
}

.library-topic-count{
  font-size:12px;
  color: var(--muted);
}

.library-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.25);
  z-index: 999;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.library-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.library-toast .toast-action {
  border: none;
  background: none;
  color: var(--brand-blue);
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
}

.library-toast .toast-action:hover {
  text-decoration: underline;
}

.library-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

.library-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.library-table thead {
  background: var(--bg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  color: var(--muted);
}

.library-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.library-table th.sortable:hover,
.library-table th.sortable:focus-visible {
  text-decoration: underline;
}

.library-table th.sortable:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.library-table th.sortable[data-sort-active="true"]::after {
  content: attr(data-sort-symbol);
  margin-left: 4px;
  font-size: 11px;
  color: var(--muted);
}

.library-table th,
.library-table td {
  padding: 12px 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--tooltip-border);
}

.library-table tbody tr:hover .title-text {
  text-decoration: underline;
}

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

.library-table .col-year,
.library-table .col-pubs,
.library-table .col-citations {
  width: 80px;
  text-align: right;
  font-feature-settings: "tnum" 1;
  color: var(--muted);
}

.library-table .col-title {
  width: auto;
}

.library-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.library-title .title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  color: var(--ink);
  text-decoration: none;
}

.library-link,
.library-author-link,
.library-venue-link {
  color: var(--brand-blue);
  text-decoration: none;
  cursor: pointer;
  background:none;
  border:none;
  padding-right: 0;
  padding-left: 0;
}

.library-link:hover,
.library-author-link:hover,
.library-venue-link:hover {
  text-decoration: underline;
}

.tag.tag--clickable {
  cursor: pointer;
  /* background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8; */
}

/* was: .tag.tag--clickable { … } — too greedy */
.tag--clickable:not(.tag--topic) {
  cursor: pointer;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.flash-highlight {
  animation: flash-bg 1.2s ease;
}

@keyframes flash-bg {
  0% { box-shadow: 0 0 0 rgba(37, 99, 235, 0.5); }
  50% { box-shadow: 0 0 12px rgba(37, 99, 235, 0.4); }
  100% { box-shadow: 0 0 0 rgba(37, 99, 235, 0); }
}

@keyframes chip-intro {
  0% {
    transform: translateX(12px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

mark {
  background: rgba(250, 204, 21, 0.6);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

.authors-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: nowrap;
  max-width: 100%;
}


.library-table {
  width: 100%;
  table-layout: fixed; /* <-- key */
}

.library-table th.col-year,
.library-table td.col-year { width: 42px; }

.library-table th.col-citations,
.library-table td.col-citations { width: 76px; }

/* Let the middle column take the rest */
.library-table th.col-title,
.library-table td.col-title { width: auto; }

/* Ensure inner blocks can actually shrink inside the fixed cell */
.col-title .library-title,
.col-title .library-authors,
.col-title .library-venue,
.col-title .library-tags { min-width: 0; }

.library-authors,
.library-venue {
  margin-top: 4px;
  color: var(--muted);
}

/* wrapper must NOT clip; inner text does */
.authors-wrap {
  position: relative;
  display: flex;
  align-items: baseline;
  min-width: 0; /* important in flex/table-fixed */
}

/* your existing rules + ensure shrink */
.library-authors { min-width: 0; }
.library-authors.collapsed{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-authors:not(.collapsed) {
  white-space: normal;
}

.library-authors-toggle {
  position: absolute;
  right: -40px;
  top: 5px;
  bottom: auto;              /* keep on the first line */
  margin-left: 6px;
  padding-left: 10px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0), var(--panel-bg) 40%);
  /* visual style */
  color: var(--brand-blue);
  font-size: 12px;
  cursor: pointer;
  border: 0;
}

.library-authors-toggle:hover {
  text-decoration: underline;
}

.author-name--local {
  color: var(--brand-blue);
  font-weight: 600;
}

.author-name {
  color: inherit;
}

.library-venue {
  font-size: 13px;
}

.library-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-fg);
  font-size: 12px;
  max-width: 150px;      /* controls truncation width */
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  box-sizing: border-box; /* avoid accidental overflow from padding */
}

.link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  text-decoration: none;
}

.link-icon:hover {
  transform: translateY(-1px);
}

.library-author-name {
  font-weight: 600;
  color: var(--ink);
}

.library-author-affiliation {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.library-author-trigger {
  border: none;
  background: none;
  padding: 0;
  margin: 0 0 6px;
  text-align: left;
  cursor: pointer;
  display: block;
  width: 100%;
}

.library-author-trigger:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.library-author-trigger .library-author-name {
  transition: color 0.2s ease;
}

.library-author-trigger:hover .library-author-name,
.library-author-trigger:focus-visible .library-author-name {
  color: var(--brand-blue);
}

@media (max-width: 960px) {
  .library-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .library-mode {
    justify-self: flex-start;
  }

  .library-table .col-year,
  .library-table .col-pubs,
  .library-table .col-citations {
    width: 64px;
  }
}
/* Topic tags inside publication rows */
.tag.tag--topic {
  /* border: 1px solid color-mix(in oklab, var(--topic-color) 40%, transparent); */
  border: 1px solid var(--tooltip-border);
  background:none;
  /* background: color-mix(in oklab, var(--topic-color) 10%, #fff); */
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 6px;                 /* space between glyph and label */
  padding: 2px 8px;
}

.tag.tag--topic:hover {
  background: color-mix(in oklab, var(--topic-color) 10%, #fff);
}


/* DOT on the left */
.tag.tag--topic::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--topic-color);
  flex: 0 0 auto;
}


/* Label must be allowed to shrink/ellipsis in flex */
.tag .tag-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fallback if color-mix is unavailable */
@supports not (color: color-mix(in oklab, white, black)) {
  .tag.tag--topic { border-color: var(--topic-color); background: #fff; }
}

.topic-color-dot {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--topic-color, #94a3b8);
  margin-right: 8px;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--topic-color, #94a3b8) 25%, transparent);
}


/* Venue */

/* Venue chip: subtle gray, leading J */
.tag.tag--venue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  /*background: var(--tag-bg); */             /* subtle gray, same as filters */
  background:none;
  color: var(--tag-fg);
  /* border: 1px solid var(--tooltip-border); */
  line-height: 1.2;
  max-width: 220px;                      /* prevents runaway width */
}

.library-author-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
}

.library-author-overlay.is-open {
  display: flex;
}

.library-overlay-backdrop {
  flex: 1;
  background: rgba(15, 23, 42, 0.55);
}

.library-overlay-panel {
  width: min(440px, 90vw);
  max-width: 100%;
  background: #ffffff;
  padding: 24px 24px 32px;
  box-shadow: -16px 0 32px rgba(15, 23, 42, 0.25);
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.library-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: #e2e8f0;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  color: #0f172a;
}

.library-overlay-close:hover {
  background: #cbd5e1;
}

.library-overlay-content h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.library-overlay-affiliation {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.library-overlay-section {
  margin-top: 18px;
}

.library-overlay-section h3 {
  margin: 0 0 10px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.library-author-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.library-author-stat {
  background: var(--chip);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.library-author-stat-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

.library-author-stat-label {
  font-size: 12px;
  color: var(--muted);
}

.library-author-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.library-author-chart-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.library-author-chart-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.library-author-chart-progress {
  display: flex;
  height: 100%;
}

.chart-segment--main {
  background: #2563eb;
}

.chart-segment--secondary {
  background: #94a3b8;
}

.library-overlay-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.library-overlay-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #e2e8f0;
}

.library-overlay-list li:last-child {
  border-bottom: none;
}

.library-overlay-list .item-label {
  flex: 1;
  font-weight: 500;
  color: var(--ink);
}

.library-overlay-list .item-meta {
  font-size: 12px;
  color: var(--muted);
}

.library-overlay-publications {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-overlay-publication {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.library-overlay-publication h4 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.library-overlay-publication-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.library-overlay-publication a {
  font-size: 12px;
  color: var(--brand-blue);
  text-decoration: none;
}

.library-overlay-publication a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .library-overlay-panel {
    width: 100%;
  }
}

/* keep clickable but still subtle */
.tag.tag--venue.tag--clickable {
  cursor: pointer;
  text-decoration-line: none;
}
.tag.tag--venue.tag--clickable:hover {
  background: color-mix(in oklab, var(--tag-bg) 85%, #fff 15%);
  border-color: color-mix(in oklab, var(--tooltip-border) 60%, var(--brand-blue) 40%);
}

/* the “J” icon */
.tag.tag--venue .tag-icon {
  font-weight: 700;
  font-size: 11px;
  opacity: 0.75;
  flex: 0 0 auto;
}

/* ensure label truncates nicely */
.tag .tag-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-overlay-empty {
  font-size: 13px;
  color: var(--muted);
}
.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.list.compact li {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* or stretch */
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  min-width: 0; 
}
.list.compact li .line1 > a {
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-left: 2px;
    cursor: pointer;
}

.list small {
  color: var(--muted);
}
.list small.author-local {
  color: var(--font-accent);
}

.list li {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.line1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.badge {
  font-weight: 600;
  color: var(--ink);
  background: var(--chip);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}
