:root {
  --bg: #efece8;
  --surface: #faf9f7;
  --text: #1c1917;
  --muted: #78716c;
  --accent: #b91c1c;
  --accent-soft: #fef2f2;
  --border: #e7e5e4;
  --ok: #15803d;
  --warn: #b45309;
  --dev: #1d4ed8;
  --shadow: 0 1px 3px rgb(28 25 23 / 8%), 0 8px 24px rgb(28 25 23 / 6%);
  --radius: 16px;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

code {
  font-size: 0.85em;
  background: #fff;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0.5rem;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

h1 {
  margin: 0.15rem 0 0;
  font-size: 1.75rem;
  font-weight: 800;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  border: none;
  background: var(--text);
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.875rem;
}

.btn:hover {
  opacity: 0.9;
}

.btn:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text);
  opacity: 1;
}

.grid.compact-layout {
  grid-template-columns: 1fr;
  max-width: 960px;
}

.card details.project-details {
  margin: 0;
}

.card summary.card-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card summary.card-summary::-webkit-details-marker {
  display: none;
}

.summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.summary-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.summary-chevron {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

details[open] .summary-chevron {
  transform: rotate(90deg);
}

.summary-title-row h2 {
  margin: 0;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.75rem;
  color: var(--muted);
  align-items: center;
}

.summary-pill {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-weight: 600;
}

.summary-pill.warn {
  border-color: #fecaca;
  color: var(--accent);
  background: var(--accent-soft);
}

.card-body {
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card-actions.compact-actions {
  margin-top: 0;
}

.card-actions.compact-actions .action-btn {
  font-size: 0.68rem;
  padding: 0.25rem 0.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem 1.5rem 1rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.1;
}

.stat span {
  font-size: 0.8rem;
  color: var(--muted);
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  padding: 0 1.5rem 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.view-tabs {
  display: flex;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
}

.view-tab {
  border: none;
  background: transparent;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}

.view-tab.active {
  background: var(--text);
  color: #fff;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.action-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.health-dots {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-shrink: 0;
}

.health-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #d6d3d1;
}

.health-dot.ok {
  background: var(--ok);
}

.health-dot.bad {
  background: var(--accent);
}

.health-dot.na {
  background: #d6d3d1;
}

.health-dot.slow {
  background: var(--warn);
}

.health-dot.warn-latency {
  background: #ca8a04;
}

.security-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

.security-badge.grade-good {
  border-color: #bbf7d0;
  color: var(--ok);
  background: #f0fdf4;
}

.security-badge.grade-attention {
  border-color: #fde68a;
  color: var(--warn);
  background: #fffbeb;
}

.security-badge.grade-critical {
  border-color: #fecaca;
  color: var(--accent);
  background: var(--accent-soft);
}

.insight-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

.insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.insight-head-actions,
.section-head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.section-head .section-title {
  margin: 0;
}

.section-copy-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
}

.section-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.warn-box.inner-warn {
  margin: 0;
  background: transparent;
  border: none;
  padding: 0;
}

.dirty-list {
  margin: 0.35rem 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.insight-head .section-title {
  margin: 0;
}

.insight-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.insight-badge.health-ok {
  background: #f0fdf4;
  color: var(--ok);
}

.insight-badge.health-slow {
  background: #fffbeb;
  color: var(--warn);
}

.insight-badge.health-down {
  background: var(--accent-soft);
  color: var(--accent);
}

.insight-badge.grade-good {
  background: #f0fdf4;
  color: var(--ok);
}

.insight-badge.grade-attention {
  background: #fffbeb;
  color: var(--warn);
}

.insight-badge.grade-critical {
  background: var(--accent-soft);
  color: var(--accent);
}

.health-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}

.health-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.text-ok {
  color: var(--ok);
  font-weight: 600;
}

.text-bad {
  color: var(--accent);
  font-weight: 600;
}

.header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.header-chip {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.header-chip.ok {
  background: #f0fdf4;
  color: var(--ok);
  border-color: #bbf7d0;
}

.header-chip.miss {
  background: #fafaf9;
  color: var(--muted);
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.check-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  background: #fafaf9;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.check-item.status-pass {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.check-item.status-warn {
  border-color: #fde68a;
  background: #fffbeb;
  cursor: pointer;
}

.check-item.status-fail {
  border-color: #fecaca;
  background: var(--accent-soft);
  cursor: pointer;
}

.check-label {
  font-size: 0.78rem;
  font-weight: 700;
}

.check-detail {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.audit-line {
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
}

.billing-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
  white-space: nowrap;
}

.billing-badge.billing-live {
  border-color: #bbf7d0;
  color: var(--ok);
  background: #f0fdf4;
}

.billing-badge.billing-manual {
  border-color: #fde68a;
  color: var(--warn);
  background: #fffbeb;
}

.billing-badge.billing-planned {
  border-color: #bfdbfe;
  color: var(--dev);
  background: #eff6ff;
}

.billing-badge.billing-none {
  color: var(--muted);
}

.insight-badge.billing-live {
  background: #f0fdf4;
  color: var(--ok);
}

.insight-badge.billing-manual {
  background: #fffbeb;
  color: var(--warn);
}

.insight-badge.billing-planned {
  background: #eff6ff;
  color: var(--dev);
}

.insight-badge.billing-none {
  background: #fafaf9;
  color: var(--muted);
}

.billing-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0;
  font-size: 0.82rem;
}

.billing-grid dt {
  color: var(--muted);
  font-weight: 600;
}

.billing-grid dd {
  margin: 0;
}

.membership-list {
  margin-top: 0.25rem;
}

.billing-note {
  font-size: 0.78rem;
  margin: 0.35rem 0 0;
}

.backups-view {
  padding: 0 1.5rem 2rem;
  max-width: 960px;
}

.backup-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.backup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.backup-card.status-ok {
  border-left: 4px solid var(--ok);
}

.backup-card.status-warn {
  border-left: 4px solid var(--warn);
}

.backup-card.status-stale,
.backup-card.status-missing {
  border-left: 4px solid var(--accent);
}

.backup-card.status-unknown {
  border-left: 4px solid #d6d3d1;
}

.backup-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.backup-detail {
  margin: 0;
  font-size: 0.88rem;
}

.backup-meta {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
}

.backup-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.backup-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.backup-status.status-ok {
  background: #f0fdf4;
  color: var(--ok);
}

.backup-status.status-warn {
  background: #fffbeb;
  color: var(--warn);
}

.backup-status.status-stale,
.backup-status.status-missing {
  background: var(--accent-soft);
  color: var(--accent);
}

.backup-status.status-unknown {
  background: #fafaf9;
  color: var(--muted);
}

.backup-project-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.backup-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
}

.backup-project-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.queue-view {
  padding: 0 1.5rem 2rem;
}

.queue-view.hidden {
  display: none;
}

.queue-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  align-items: start;
}

.queue-item:last-child {
  border-bottom: none;
}

.queue-project {
  font-weight: 700;
}

.queue-jump {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--text);
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 50;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 640px) {
  .queue-item {
    grid-template-columns: 1fr;
  }
}

.toolbar input,
.toolbar select {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  min-width: 220px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  padding: 0 1.5rem 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.grid.hidden {
  display: none;
}

.card-head .card-head {
  gap: 0.5rem;
  flex-shrink: 0;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-production {
  background: #dcfce7;
  color: var(--ok);
}

.badge-development {
  background: #dbeafe;
  color: var(--dev);
}

.badge-active {
  background: #f3e8ff;
  color: #7e22ce;
}

.badge-pending_deploy {
  background: #ffedd5;
  color: var(--warn);
}

.badge-unknown,
.badge-local {
  background: #f5f5f4;
  color: var(--muted);
}

.meta-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.meta-row dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.meta-row dd {
  margin: 0;
  word-break: break-word;
}

.meta-row a {
  color: var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  font-size: 0.72rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.list-compact {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
}

.list-compact li {
  margin-bottom: 0.2rem;
}

.warn-box {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 0.45rem 0.65rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.8rem;
}

.commit {
  font-size: 0.8rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}

.commit code {
  background: transparent;
  padding: 0;
  font-weight: 700;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

.warn-box li {
  margin-bottom: 0.35rem;
}

.warn-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0.15rem 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.warn-btn:hover {
  color: var(--accent);
}

.warn-btn::after {
  content: '→';
  font-size: 0.75rem;
  opacity: 0.6;
}

.modal {
  border: none;
  padding: 0;
  max-width: min(520px, calc(100vw - 2rem));
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgb(28 25 23 / 18%);
  background: transparent;
}

.modal::backdrop {
  background: rgb(28 25 23 / 45%);
}

.modal-inner {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.35rem;
}

.modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  border: none;
  background: #fff;
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal-close:hover {
  color: var(--text);
}

.modal-desc {
  font-size: 0.92rem;
  margin: 0.5rem 0 0.75rem;
}

.modal-details-wrap.hidden {
  display: none;
}

.modal-details {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}

.modal-hint {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--bg);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
}

.copy-modal-inner h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.copy-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0.75rem 0 0.35rem;
}

.copy-question {
  width: 100%;
  min-height: 5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
  box-sizing: border-box;
}

.copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.boot-status {
  margin: 0 1.5rem 1rem;
  padding: 0.75rem 1rem;
  background: #fff8e6;
  border: 1px solid #e8d9a8;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.boot-status--error {
  background: #fdecea;
  border-color: #f5c2c0;
  color: #8a1f17;
}

.footer {
  padding: 1rem 1.5rem 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem;
}

.login-card h1 {
  margin-bottom: 0.35rem;
}

.login-lead {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.login-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  box-sizing: border-box;
  margin-bottom: 0.35rem;
}

.login-input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.login-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.7rem;
}

.login-error {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
}

.login-foot {
  margin: 1.25rem 0 0;
  font-size: 0.78rem;
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ── Biblioteca ── */
.biblioteca-view {
  padding: 1rem 1.25rem 2rem;
  max-width: 860px;
}

/* Toolbar con selector de navegación */
.biblioteca-toolbar {
  margin-bottom: 1rem;
}

.biblioteca-selector {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 200px;
}

/* Cards colapsables */
.biblioteca-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.concepto-card {
  border-left: 3px solid var(--accent-soft);
}

.biblioteca-summary {
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.biblioteca-summary::-webkit-details-marker { display: none; }

.biblioteca-summary-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.biblioteca-summary-row .summary-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.15s;
  flex-shrink: 0;
}

details.biblioteca-card[open] > .biblioteca-summary .summary-chevron {
  transform: rotate(90deg);
}

.biblioteca-summary-row a {
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
  text-decoration: none;
}

.biblioteca-summary-row a:hover { text-decoration: underline; }

.biblioteca-summary-row .muted {
  font-size: 0.78rem;
}

.biblioteca-chips-summary {
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.biblioteca-body {
  padding: 0 1.25rem 1rem;
  border-top: 1px solid var(--border);
}

/* Botón eliminar */
.biblioteca-delete-btn {
  margin-top: 0.85rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.biblioteca-delete-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #c0392b;
}

.biblioteca-delete-btn.confirming {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
  font-weight: 600;
}

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

.biblioteca-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0.25rem 0 0.6rem;
}

.biblioteca-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.biblioteca-chip {
  background: var(--surface-raised, #f0f0f0);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.biblioteca-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .biblioteca-cols { grid-template-columns: 1fr; }
}

.biblioteca-col-title {
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.biblioteca-col-title.conflict { color: #c0392b; }
.biblioteca-col-title.useful   { color: #27ae60; }

.biblioteca-rec {
  font-size: 0.83rem;
  background: var(--surface-raised, #f8f8f6);
  border-left: 3px solid var(--accent-soft);
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
  margin: 0.5rem 0 0;
  color: var(--text);
}
