/* Library tab styles */
.library {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}
.library-guest-note {
  background: var(--accent-2);
  border: 1px solid rgba(198,106,61,0.2);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.library-guest-note strong { color: var(--ink); }
.library-guest-signin {
  background: transparent;
  border: 1px solid var(--rule-2);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
  margin-left: auto;
  white-space: nowrap;
}
.library-guest-signin:hover { background: rgba(0,0,0,0.05); }

.library-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.library-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.0;
}
.library-hero h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.library-hero p {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  max-width: 580px;
}
.library-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.library-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.library-search {
  flex: 1;
  min-width: 260px;
  position: relative;
  display: flex;
  align-items: center;
}
.library-search svg {
  position: absolute;
  left: 14px;
  color: var(--ink-3);
  pointer-events: none;
}
.library-search input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.library-search input:focus { border-color: var(--accent); background: #fff; }
.library-filters { display: flex; gap: 8px; }
.library-filters select {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink);
  outline: none;
  cursor: pointer;
}

.library-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-3);
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  border: 1px dashed var(--rule-2);
  border-radius: 10px;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.lib-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.lib-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--rule-2);
}
.lib-swatch {
  position: absolute; top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--swatch);
}
.lib-head { padding-top: 6px; }
.lib-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lib-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}
.lib-card h3:hover { color: var(--accent); }
.lib-tagline {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.45;
}
.lib-verified {
  font-family: var(--mono);
  font-size: 10px;
  background: oklch(0.93 0.07 145);
  color: oklch(0.40 0.13 145);
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
}
.lib-update-badge {
  font-family: var(--mono);
  font-size: 10px;
  background: oklch(0.93 0.10 60);
  color: oklch(0.42 0.16 55);
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
}
.lib-adopted-badge {
  font-family: var(--mono);
  font-size: 10px;
  background: oklch(0.93 0.04 250);
  color: oklch(0.45 0.10 250);
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
}
.lib-school-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-top: 6px;
}
.lib-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
  flex-wrap: wrap;
}
.lib-meta strong { color: var(--ink-2); font-weight: 500; }
.lib-dot {
  display: inline-block;
  width: 3px; height: 3px;
  background: var(--rule-2);
  border-radius: 50%;
}

.lib-rating { display: flex; align-items: center; gap: 8px; }
.lib-rating-num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.lib-rating-count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

.lib-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.lib-delete { margin-left: auto; color: var(--ink-3); }
.lib-delete:hover { color: var(--bad); }
.verifier-on { background: oklch(0.93 0.07 145) !important; border-color: oklch(0.85 0.10 145) !important; color: oklch(0.40 0.13 145) !important; }

/* Stars */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.star {
  background: transparent;
  border: 0;
  padding: 1px 2px;
  cursor: pointer;
  color: var(--rule-2);
  font-size: var(--star-size, 18px);
  line-height: 1;
  transition: color 0.1s ease, transform 0.1s ease;
}
.star.filled { color: oklch(0.72 0.16 80); }
.star:hover:not(:disabled) { transform: scale(1.12); }
.star.readonly { cursor: default; }
.star.readonly:hover { transform: none; }

/* Detail modal */
.detail-section {
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}
.detail-section h4 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-list li {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
}
.detail-list li strong { font-family: var(--serif); font-size: 15px; }
