/**
 * The Briefcase Library Modal Styles
 *
 * Full arsenal library showing all contributions in The Briefcase.
 * Similar to Elementor Library - comprehensive view of everything available.
 */

/* ============================================
   CN CONSOLE SIDEBAR STYLING
   ============================================ */

/* CLEAN STICKY SIDEBAR - PRODUCTION VERSION */
aside.sunday-md-aside nav.sunday-md-toc {
  position: sticky !important;
  top: 80px !important;
  width: 280px !important;
  min-height: calc(100vh - 100px) !important;
  max-height: calc(100vh - 80px) !important;
  overflow-y: auto !important;
  padding: 20px !important;
  background: var(--card) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  z-index: 100 !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
}

/* CLEAN TOC LINK STYLING */
.sunday-md-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sunday-md-toc li {
  margin: 0;
  padding: 0;
}

.sunday-md-toc li::before {
  display: none;
}

.sunday-md-toc a {
  display: block;
  padding: 8px 16px;
  margin: 4px 0;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  transition: all 0.2s ease;
  position: relative;
}

.sunday-md-toc a:hover {
  background: color-mix(in srgb, var(--brand) 6%, transparent);
  color: var(--ink);
  transform: translateX(2px);
}

.sunday-md-toc a.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 15%, transparent), color-mix(in srgb, var(--brand) 8%, transparent));
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 20%, transparent);
  border-left: 3px solid var(--brand);
  padding-left: 13px;
}

/* HEADING LEVEL STYLING */
.sunday-md-toc .lvl-1 a {
  font-weight: 700;
  color: var(--ink);
  padding-left: 16px;
  font-size: 15px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.sunday-md-toc .lvl-1 a:first-child {
  margin-top: 0;
}

.sunday-md-toc .lvl-2 a {
  padding-left: 24px;
  font-size: 13px;
  font-weight: 500;
}

.sunday-md-toc .lvl-3 a {
  padding-left: 32px;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}

/* ============================================
   CN PROTOCOLS PAGE - COMPLETE REDESIGN
   ============================================ */

/* HERO SECTION */
.cn-hero-section {
  background: linear-gradient(135deg, var(--card) 0%, color-mix(in srgb, var(--card) 95%, var(--brand)) 100%);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--line);
}

.cn-hero-content {
  flex: 1;
}

.cn-hero-icon {
  font-size: 64px;
  margin-bottom: 16px;
  display: block;
}

.cn-hero-title {
  font-size: 48px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cn-hero-subtitle {
  font-size: 20px;
  color: var(--muted);
  margin: 0 0 24px 0;
  font-weight: 500;
}

.cn-hero-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.cn-meta-item {
  background: var(--bg);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--line);
}

.cn-hero-visual {
  flex: 0 0 300px;
}

.cn-network-diagram {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cn-network-diagram .cn-node {
  background: var(--card);
  border: 2px solid var(--brand);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  color: var(--ink);
}

.cn-network-diagram .cn-node:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.cn-network-diagram .cn-node-core {
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 80%, #000));
  color: white;
  border-color: var(--brand);
  z-index: 2;
  position: relative;
}

.cn-network-diagram .cn-node-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.cn-network-diagram .cn-node-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cn-network-diagram .cn-connection-line {
  position: absolute;
  width: 60px;
  height: 2px;
  background: var(--brand);
  left: 120px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.cn-network-diagram .cn-nodes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-left: 100px;
}

.cn-network-diagram .cn-node-framework { border-color: #8b5cf6; }
.cn-network-diagram .cn-node-console { border-color: #10b981; }
.cn-network-diagram .cn-node-cartridge { border-color: #f59e0b; }
.cn-network-diagram .cn-node-app { border-color: #0ea5e9; }

/* NAVIGATION BAR */
.cn-nav-bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.cn-nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cn-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.cn-search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  transition: all 0.2s ease;
}

.cn-search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}

.cn-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--muted);
}

.cn-section-select {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  min-width: 200px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cn-section-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}

.cn-clear-btn {
  padding: 12px 20px;
  background: var(--muted);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cn-clear-btn:hover {
  background: color-mix(in srgb, var(--muted) 80%, #000);
  transform: translateY(-1px);
}

/* CONTENT LAYOUT */
.cn-content-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  position: relative;
}

/* SIDEBAR - STICKY READER-APP STYLE */
.cn-sidebar {
  position: relative;
  width: 320px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  z-index: 10;
  transition: all 0.3s ease;
}

/* Sticky state - activated via JavaScript when scrolled past nav bar */
.cn-sidebar.is-sticky {
  position: fixed;
  top: 20px;
  width: 320px;
  max-height: calc(100vh - 40px);
  animation: sidebarSlideIn 0.3s ease;
}

@keyframes sidebarSlideIn {
  from {
    opacity: 0.8;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Placeholder to maintain layout when sidebar becomes fixed */
.cn-content-layout.has-sticky-sidebar::before {
  content: '';
  width: 320px;
  flex-shrink: 0;
}

.cn-sidebar-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cn-sidebar-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px 0;
}

.cn-sidebar-stats {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.cn-toc-nav {
  /* TOC content will be inserted here by JavaScript */
}

/* MAIN CONTENT */
.cn-main-content {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.cn-content-body {
  padding: 32px;
  min-height: 600px;
}

/* LOADING STATE */
.cn-loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.cn-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 50%;
  animation: cn-spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes cn-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ACTIONS FOOTER */
.cn-actions-footer {
  margin-top: 40px;
  padding: 32px 0;
}

.cn-action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.cn-action-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.cn-action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--brand);
}

.cn-action-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.cn-action-content {
  flex: 1;
}

.cn-action-content h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px 0;
}

.cn-action-content p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.cn-action-btn {
  background: var(--brand);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cn-action-btn:hover {
  background: color-mix(in srgb, var(--brand) 80%, #000);
  transform: translateY(-1px);
}

/* CUSTOM TOC STYLING - READER APP STYLE */
.cn-toc-nav {
  max-height: calc(100vh - 180px);
  min-height: 60vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 8px 0;
}

.cn-toc-nav::-webkit-scrollbar {
  width: 4px;
}

.cn-toc-nav::-webkit-scrollbar-track {
  background: transparent;
}

.cn-toc-nav::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 2px;
  opacity: 0.5;
}

.cn-toc-nav::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

.cn-toc-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  margin: 3px 8px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.cn-toc-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--brand);
  transition: width 0.3s ease;
  opacity: 0.1;
}

.cn-toc-item:hover {
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  color: var(--ink);
  transform: translateX(4px);
  text-decoration: none;
}

.cn-toc-item:hover::before {
  width: 100%;
}

.cn-toc-item.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, transparent), color-mix(in srgb, var(--brand) 10%, transparent));
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 25%, transparent);
  border-left-color: var(--brand);
  transform: translateX(6px);
}

.cn-toc-item.active::before {
  width: 100%;
  opacity: 0.05;
}

/* Pulse animation for active item */
@keyframes tocPulse {
  0%, 100% { box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 25%, transparent); }
  50% { box-shadow: 0 4px 20px color-mix(in srgb, var(--brand) 40%, transparent); }
}

.cn-toc-item.active {
  animation: tocPulse 2s ease-in-out infinite;
}

.cn-toc-icon {
  margin-right: 8px;
  font-size: 12px;
}

.cn-toc-text {
  flex: 1;
}

.lvl-1 .cn-toc-text {
  font-weight: 700;
  color: var(--ink);
}

.lvl-2 {
  margin-left: 16px;
}

.lvl-3 {
  margin-left: 32px;
  opacity: 0.85;
}

/* CONTENT STYLING */
.cn-content-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brand);
}

.cn-section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin: 40px 0 16px 0;
  padding-left: 16px;
  border-left: 4px solid var(--brand);
}

.cn-subsection-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 32px 0 12px 0;
  padding-left: 12px;
  border-left: 3px solid color-mix(in srgb, var(--brand) 60%, transparent);
}

.cn-content-body h1,
.cn-content-body h2,
.cn-content-body h3 {
  scroll-margin-top: 100px;
}

.cn-content-body p {
  line-height: 1.7;
  margin: 16px 0;
  color: var(--text);
}

.cn-content-body ul,
.cn-content-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.cn-content-body li {
  margin: 8px 0;
  line-height: 1.6;
}

.cn-content-body code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 0.9em;
  color: var(--brand);
}

.cn-content-body pre {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 20px 0;
}

.cn-content-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.cn-content-body blockquote {
  border-left: 4px solid var(--brand);
  padding-left: 16px;
  margin: 20px 0;
  color: var(--muted);
  font-style: italic;
}

.cn-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
}

.cn-content-body th,
.cn-content-body td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.cn-content-body th {
  background: var(--card);
  font-weight: 700;
  color: var(--ink);
}

.cn-content-body tr:last-child td {
  border-bottom: none;
}

/* ERROR STATE */
.cn-error-state {
  text-align: center;
  padding: 40px 20px;
  color: #dc2626;
}

.cn-error-state h3 {
  color: #dc2626;
  margin: 0 0 12px 0;
}

.cn-error-state p {
  color: var(--muted);
  margin: 0 0 16px 0;
}

.cn-error-state details {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}

.cn-error-state pre {
  background: var(--bg);
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #dc2626;
  overflow-x: auto;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .cn-content-layout {
    flex-direction: column;
    gap: 24px;
  }

  .cn-sidebar {
    position: static;
    width: 100%;
    max-height: none;
    order: -1;
  }

  .cn-hero-section {
    flex-direction: column;
    text-align: center;
    gap: 32px;
  }

  .cn-hero-visual {
    flex: none;
  }

  .cn-nodes-grid {
    margin-left: 0;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .cn-hero-section {
    padding: 24px;
  }

  .cn-hero-title {
    font-size: 32px;
  }

  .cn-nav-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .cn-search-wrapper {
    min-width: auto;
  }

  .cn-section-select {
    min-width: auto;
  }

  .cn-action-cards {
    grid-template-columns: 1fr;
  }

  .cn-action-card {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .cn-toc-item {
    padding: 6px 8px;
    font-size: 13px;
  }

  .lvl-2 {
    margin-left: 12px;
  }

  .lvl-3 {
    margin-left: 24px;
  }
}

/* Library Overlay */
.briefcase-library-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  overflow-y: auto;
}

.briefcase-library-overlay.show {
  display: flex;
}

/* Library Modal */
.briefcase-library-modal {
  background: var(--card, #ffffff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 20px;
  width: 100%;
  max-width: 1400px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: briefcaseModalIn 0.3s ease;
}

@keyframes briefcaseModalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.briefcase-library-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  flex-shrink: 0;
}

.briefcase-library-modal__title {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink, #1f2937);
  margin: 0 0 8px 0;
}

.briefcase-library-modal__subtitle {
  font-size: 14px;
  color: var(--text-muted, #6b7280);
  margin: 0;
  line-height: 1.6;
}

.briefcase-library-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.briefcase-library-modal__close:hover {
  background: var(--bg, #f9fafb);
  color: var(--ink, #1f2937);
}

/* Search */
.briefcase-library-search {
  padding: 20px 32px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  flex-shrink: 0;
}

.briefcase-library-search__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  font-size: 14px;
  background: var(--bg, #f9fafb);
  color: var(--ink, #1f2937);
  outline: none;
  transition: all 0.2s ease;
}

.briefcase-library-search__input:focus {
  border-color: var(--brand, #8b5cf6);
  background: var(--card, #ffffff);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.briefcase-library-search__input::placeholder {
  color: var(--text-muted, #9ca3af);
}

/* Modal Body */
.briefcase-library-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.briefcase-library-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Library Section */
.briefcase-library-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.briefcase-library-section__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line, #e5e7eb);
}

.briefcase-library-section__emoji {
  font-size: 24px;
  line-height: 1;
}

.briefcase-library-section__title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink, #1f2937);
  margin: 0;
  flex: 1;
}

.briefcase-library-section__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  display: flex;
  align-items: center;
  gap: 4px;
}

.briefcase-library-section__count .count-active {
  color: rgba(34, 197, 94, 1);
  font-weight: 700;
}

.briefcase-library-section__count .count-inactive {
  color: var(--text-muted, #6b7280);
  font-weight: 600;
}

.briefcase-library-section__count .count-separator {
  color: var(--text-muted, #6b7280);
  opacity: 0.5;
}

/* Library Grid */
.briefcase-library-section__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Library Card */
.briefcase-library-card {
  padding: 20px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 16px;
  background: var(--card, #ffffff);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.briefcase-library-card:hover {
  border-color: var(--brand, #8b5cf6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.briefcase-library-card__header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.briefcase-library-card__emoji {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.briefcase-library-card__title {
  flex: 1;
  min-width: 0;
}

.briefcase-library-card__name {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink, #1f2937);
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.briefcase-library-card__tagline {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  line-height: 1.4;
  margin: 0;
}

.briefcase-library-card__desc {
  font-size: 13px;
  color: var(--text, #374151);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.briefcase-library-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.briefcase-library-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg, #f9fafb);
  border: 1px solid var(--line, #e5e7eb);
  color: var(--text-muted, #6b7280);
}

/* Type badges with color codes matching CN structure */
.briefcase-badge-type {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 10px;
}

.briefcase-badge-type-settings,
.briefcase-badge-type-network {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: rgba(139, 92, 246, 1);
}

.briefcase-badge-type-framework,
.briefcase-badge-type-framework-utility {
  background: rgba(124, 227, 255, 0.15);
  border-color: rgba(124, 227, 255, 0.4);
  color: rgba(124, 227, 255, 1);
}

.briefcase-badge-type-console,
.briefcase-badge-type-console-cartridge {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: rgba(34, 197, 94, 1);
}

.briefcase-badge-type-cartridge,
.briefcase-badge-type-utility-cartridge {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: rgba(245, 158, 11, 1);
}

.briefcase-badge-type-app {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.4);
  color: rgba(167, 139, 250, 1);
}

.briefcase-badge-type-page {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.4);
  color: rgba(96, 165, 250, 1);
}

.briefcase-badge-type-component {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(236, 72, 153, 0.4);
  color: rgba(236, 72, 153, 1);
}

.briefcase-badge-type-admin-core {
  background: rgba(124, 227, 255, 0.2);
  border-color: rgba(124, 227, 255, 0.5);
  color: rgba(124, 227, 255, 1);
}

.briefcase-badge-type-tool {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  color: rgba(168, 85, 247, 1);
}

.briefcase-badge-type-system {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: rgba(59, 130, 246, 1);
}

.briefcase-badge-type-handbook {
  background: rgba(251, 146, 60, 0.15);
  border-color: rgba(251, 146, 60, 0.4);
  color: rgba(251, 146, 60, 1);
}

.briefcase-badge-type-other {
  background: rgba(107, 114, 128, 0.15);
  border-color: rgba(107, 114, 128, 0.4);
  color: rgba(107, 114, 128, 1);
}

.briefcase-badge-active {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: rgba(34, 197, 94, 1);
}

.briefcase-badge-category {
  background: rgba(107, 114, 128, 0.1);
  border-color: rgba(107, 114, 128, 0.2);
  color: rgba(107, 114, 128, 0.8);
}

.briefcase-library-card__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line, #e5e7eb);
}

.briefcase-library-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand, #8b5cf6);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: color-mix(in srgb, var(--brand, #8b5cf6) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand, #8b5cf6) 20%, transparent);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.briefcase-library-link:hover {
  background: color-mix(in srgb, var(--brand, #8b5cf6) 15%, transparent);
  border-color: var(--brand, #8b5cf6);
  color: var(--brand, #8b5cf6);
  gap: 6px;
  transform: translateY(-1px);
}

/* Special styling for "Open Console" links */
.briefcase-library-link-console {
  background: color-mix(in srgb, rgba(34, 197, 94, 1) 12%, transparent) !important;
  border-color: rgba(34, 197, 94, 0.4) !important;
  color: rgba(34, 197, 94, 1) !important;
  font-weight: 700 !important;
}

.briefcase-library-link-console:hover {
  background: color-mix(in srgb, rgba(34, 197, 94, 1) 20%, transparent) !important;
  border-color: rgba(34, 197, 94, 0.6) !important;
  color: rgba(34, 197, 94, 1) !important;
}

.briefcase-library-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
  .briefcase-library-section__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .briefcase-library-modal {
    max-height: 100vh;
    border-radius: 0;
  }

  .briefcase-library-modal__header {
    padding: 20px;
  }

  .briefcase-library-modal__body {
    padding: 20px;
  }

  .briefcase-library-section__grid {
    grid-template-columns: 1fr;
  }
}

