:root {
  --bg-main: #0b0f19;
  --bg-card: #111827;
  --bg-sidebar: #0f172a;
  --bg-pad: #ffffff;
  --border-color: #1e293b;
  --border-card: #1f293d;
  --accent-red: #dc2626;
  --accent-hover: #b91c1c;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  height: 64px;
  background-color: #0d1322;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.cross-icon {
  background: var(--accent-red);
  color: #fff;
  font-size: 1rem;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: bold;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand h1 span {
  color: var(--accent-red);
}

.header-links {
  display: flex;
  gap: 1.25rem;
}

.header-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.header-links a:hover {
  color: var(--text-main);
}

/* Layout */
.app-layout {
  display: flex;
  flex: 1;
}

/* Sidebar */
.filter-sidebar {
  width: 320px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  overflow-y: auto;
}

.sidebar-header h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.filter-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Search Box */
.search-box-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#search-input {
  width: 100%;
  background: #090e17;
  border: 1px solid #2a3749;
  border-radius: 6px;
  padding: 0.6rem 2.2rem 0.6rem 0.75rem;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s ease;
}

#search-input:focus {
  border-color: var(--accent-red);
}

.clear-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  padding: 0 4px;
  line-height: 1;
}

.clear-btn:hover {
  color: var(--text-main);
}

/* Chip Buttons */
.chip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.chip {
  background: #172033;
  border: 1px solid #233149;
  color: #cbd5e1;
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.chip:hover {
  background: #1f2b45;
  color: #fff;
}

.chip.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #ffffff;
}

/* Tool Checklist */
.tool-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.check-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  text-transform: none !important;
  font-weight: 500 !important;
}

.check-container input[type="checkbox"] {
  accent-color: var(--accent-red);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Slider */
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#layer-display {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-red);
  font-weight: 700;
}

input[type="range"] {
  accent-color: var(--accent-red);
  width: 100%;
  cursor: pointer;
}

.btn-reset {
  margin-top: auto;
  background: transparent;
  border: 1px solid #283548;
  color: var(--text-muted);
  padding: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reset:hover {
  background: #172033;
  color: var(--text-main);
  border-color: #3b4d66;
}

/* Catalog Area */
.catalog-area {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

#result-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

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

/* SAK Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #33435c;
}

/* White mounting pad for crisp knife display */
.card-media-wrapper {
  background: var(--bg-pad);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-card);
}

.card-media-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.card:hover .card-media-wrapper img {
  transform: scale(1.03);
}

.card-img-placeholder {
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.badge-meta {
  background: #172554;
  color: #93c5fd;
  border: 1px solid #1e40af;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Grouped Tool Chips */
.tool-groups-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex: 1;
}

.tool-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tool-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.06em;
}

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

.tool-chip {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  line-height: 1.2;
}

/* Semantic Section Themes */
.section-layer .tool-section-label {
  color: #93c5fd; /* Layer tools: Blue */
}
.section-layer .tool-chip {
  background: #132338;
  border: 1px solid #1d3d63;
  color: #bfdbfe;
}

.section-back .tool-section-label {
  color: #fde047; /* Back tools: Yellow / Gold */
}
.section-back .tool-chip {
  background: #2b2510;
  border: 1px solid #4d4013;
  color: #fef08a;
}

.section-scale .tool-section-label {
  color: #86efac; /* Scale tools: Green */
}
.section-scale .tool-chip {
  background: #10261a;
  border: 1px solid #194a2f;
  color: #bbf7d0;
}

/* Card Footer Links */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #1c2738;
  padding-top: 0.75rem;
  margin-top: auto;
}

.card-footer a {
  text-decoration: none;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  transition: color 0.15s ease;
}

.link-wiki {
  color: #60a5fa;
}
.link-wiki:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.link-api {
  color: var(--text-muted);
}
.link-api:hover {
  color: var(--text-main);
}

/* Tool Filter Subgroups */
.tool-filter-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tool-subgroup {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #131b2e;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #1e293b;
}

.subgroup-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.subgroup-items {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Spec Modal & Drawer */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 1.5rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background-color: #111827;
  border: 1px solid #1f293d;
  border-radius: 10px;
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0d1322;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title-wrap h2 {
  font-size: 1.25rem;
  color: #f8fafc;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Modal Metrics Grid */
.modal-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.spec-metric-card {
  background: #0d1322;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
}

/* Modal Tool Sections */
.modal-section-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: #1e293b;
}

.modal-tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.modal-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #334155;
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-spec {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-spec:hover {
  background: #1e293b;
  color: #f8fafc;
  border-color: #64748b;
}

/* Modal CTA Footer */
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #1e293b;
  background: #0d1322;
  display: flex;
}

.btn-wiki-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-wiki-cta:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.cta-arrow {
  font-size: 1rem;
  font-weight: bold;
  transition: transform 0.2s ease;
}

.btn-wiki-cta:hover .cta-arrow {
  transform: translate(2px, -2px);
}
EOFcat << 'EOF' >> /opt/SAKSelector/static/style.css

/* Modal CTA Footer */
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #1e293b;
  background: #0d1322;
  display: flex;
}

.btn-wiki-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-wiki-cta:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.cta-arrow {
  font-size: 1rem;
  font-weight: bold;
  transition: transform 0.2s ease;
}

.btn-wiki-cta:hover .cta-arrow {
  transform: translate(2px, -2px);
}

/* Prominent SAKWiki Card Badge / Button */
.link-wiki {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #171c28;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.28rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.wiki-brand-tag {
  background: var(--accent-red);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.link-wiki:hover {
  background: #231215;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Right Community Sidebar */
.community-sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
  overflow-y: auto;
}

.sidebar-box {
  background: #111827;
  border: 1px solid #1f293d;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.box-header {
  background: #0d1322;
  border-bottom: 1px solid #1f293d;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.box-icon {
  font-size: 0.9rem;
}

.box-header h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cbd5e1;
}

.community-links-list {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.network-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: #141c2e;
  border: 1px solid #202b42;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.network-card:hover {
  background: #1b263e;
  border-color: #3b82f6;
  transform: translateX(-2px);
}

.network-title {
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 700;
}

.network-subtitle {
  color: #94a3b8;
  font-size: 0.7rem;
  line-height: 1.25;
}

.support-box {
  padding: 1rem;
  gap: 0.75rem;
}

.support-box .box-header {
  background: transparent;
  border-bottom: none;
  padding: 0;
}

.support-text {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
}

.btn-donate {
  display: block;
  text-align: center;
  background: #1e293b;
  border: 1px solid #334155;
  color: #fca5a5;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-donate:hover {
  background: #7f1d1d;
  border-color: #dc2626;
  color: #ffffff;
}

/* Responsive collapse on smaller displays */
@media (max-width: 1200px) {
  .community-sidebar {
    display: none;
  }
}

/* Network Banner Plaques */
.network-banner-card {
  padding: 0;
  background: transparent;
  border: 1px solid #1f293d;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.network-banner-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
  transition: filter 0.15s ease;
}

.network-banner-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(56, 189, 248, 0.2);
}

.network-banner-card:hover .network-banner-img {
  filter: brightness(1.08);
}

/* Swiss Army Knights Donation Box */
.support-box {
  padding: 0;
  border-color: #27354f;
  background: #111827;
}

.support-header {
  border-bottom: 1px solid #1f293d;
  background: #0d1322;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.support-body {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
}

.knights-logo-wrap {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #ef4444 0%, #7f1d1d 100%);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.knights-logo-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  background: #ffffff;
  display: block;
}

.support-text {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0;
}

.support-text strong {
  color: #f87171;
}

.donate-form {
  width: 100%;
}

.btn-donate {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  border: 1px solid #ef4444;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(185, 28, 28, 0.4);
}

.btn-donate:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.6);
  transform: translateY(-1px);
}

/* Support Box Header Icon */
.support-header {
  border-bottom: 1px solid #1f293d;
  background: #0d1322;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-knight-icon {
  width: 32px;
  height: auto;
  max-height: 30px;
  object-fit: contain;
  display: inline-block;
  image-rendering: pixelated;
}

/* SAK Image Display Fix */
.card-media-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 180px !important;
  background: #ffffff !important;
  border-radius: 8px 8px 0 0 !important;
  overflow: hidden !important;
  padding: 8px !important;
}

.card-knife-img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
}

/* Clean Full-Width Responsive Stacking */
@media (max-width: 880px) {
  html, body {
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
  }

  /* Release viewport lock on main layout */
  .layout, .main-layout, .app-layout, div[class*="layout"] {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
  }

  /* Release sidebar internal scroll and fixed height */
  .sidebar, .filter-sidebar, aside {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #1e293b !important;
  }

  /* Put results grid directly in flow under the filters */
  .content, .main-content, main, .results-container {
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
    padding: 1rem 0.5rem !important;
    box-sizing: border-box !important;
  }

  .grid, .models-grid, #models-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  .community-sidebar {
    display: none !important;
  }
}

/* --- Shuffle Button & Catalog Header --- */
.catalog-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 1rem;
  margin-bottom: 1rem;
}

.btn-shuffle {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-shuffle:hover {
  background: #334155;
  border-color: #64748b;
  transform: translateY(-1px);
}

.btn-shuffle:active {
  transform: translateY(0);
}

/* --- Drawer Default (Desktop: Always Open, Hide Toggle) --- */
.filters-drawer {
  width: 100%;
}

.drawer-toggle {
  display: none;
}

/* --- Mobile Breakpoint Refinements (<= 880px) --- */
@media (max-width: 880px) {
  .drawer-toggle {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.75rem;
    user-select: none;
    list-style: none;
  }

  .drawer-toggle::-webkit-details-marker {
    display: none;
  }

  .filters-drawer[open] .toggle-arrow {
    transform: rotate(180deg);
  }

  .toggle-arrow {
    transition: transform 0.2s ease;
  }

  .drawer-content {
    padding-top: 0.5rem;
  }
}

/* --- Find Button --- */
.btn-find {
  width: 100%;
  margin-top: 0.65rem;
  background: #dc2626;
  color: #ffffff;
  border: none;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-find:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.btn-find:active {
  transform: translateY(0);
}

/* --- Layer Operators --- */
.layer-op-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin: 0.45rem 0 0.65rem 0;
}

.layer-op {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 0.35rem 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.layer-op:hover {
  color: #f1f5f9;
  border-color: #64748b;
}

.layer-op.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

/* --- SAKSelector Badge & Brand Header Overrides --- */
.brand {
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-badge {
  border-radius: 50%;
  border-radius: 50%;
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s ease;
}

.brand-badge:hover {
  transform: scale(1.05) rotate(2deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-text h1 {
  margin: 0;
  line-height: 1.1;
  font-size: 2.2rem;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: #E20613;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
}

/* SAKSelector Responsive Branding Upgrades */
.app-header {
  min-height: 140px !important;
  padding: 15px 30px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #E20613;
  background: #0A0C0E;
}

.brand {
  display: flex;
  align-items: center;
  gap: 26px !important;
}

.brand-badge {
  border-radius: 50%;
  border-radius: 50%;
  width: 112px !important;
  height: 112px !important;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.75)) !important;
}

.brand-text h1 {
  font-size: 2.2rem !important;
  font-weight: 900 !important;
  letter-spacing: 1.5px !important;
}

.brand-sub {
  font-size: 0.82rem !important;
  letter-spacing: 2px !important;
}

/* --- Card Display Tray Framing --- */
.card {
  background: #0f1318 !important;
  border: 1px solid #1c222b !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.card:hover {
  transform: translateY(-2px) !important;
  border-color: #313b49 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.card-media-wrapper {
  background: radial-gradient(circle at center, #1b2129 0%, #0d1014 100%) !important;
  height: 210px !important;
  min-height: 210px !important;
  max-height: 210px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px !important;
  border-bottom: 1px solid #1a2029 !important;
  position: relative !important;
  overflow: hidden !important;
}

.card-media-wrapper::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.7) !important;
  pointer-events: none !important;
}

.card-knife-img,
.card-media-wrapper img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 4px !important;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.6)) !important;
  z-index: 1 !important;
}

/* --- Empty State Zero-Results Card --- */
.empty-state-card {
  grid-column: 1 / -1;
  background: #0f1318;
  border: 1px solid #252c38;
  border-radius: 10px;
  padding: 48px 24px;
  text-align: center;
  max-width: 620px;
  margin: 30px auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.empty-state-icon {
  font-size: 3rem;
  color: #E20613;
  margin-bottom: 14px;
}

.empty-state-card h3 {
  font-size: 1.45rem;
  color: #FFFFFF;
  margin: 0 0 10px 0;
  letter-spacing: 0.5px;
}

.empty-state-card p {
  font-size: 0.95rem;
  color: #8A94A6;
  max-width: 460px;
  margin: 0 auto 20px auto;
  line-height: 1.5;
}

.empty-state-suggestions {
  background: #141920;
  border: 1px solid #1e2632;
  border-radius: 6px;
  padding: 16px 20px;
  text-align: left;
  max-width: 440px;
  margin: 0 auto 24px auto;
}

.empty-state-suggestions span {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #DDE2E8;
  letter-spacing: 0.8px;
  display: block;
  margin-bottom: 8px;
}

.empty-state-suggestions ul {
  margin: 0;
  padding-left: 18px;
  color: #7A8699;
  font-size: 0.88rem;
  line-height: 1.6;
}

.empty-state-suggestions strong {
  color: #CBD3E0;
}

.btn-reset-filters {
  background: #E20613;
  color: #FFFFFF;
  border: none;
  padding: 11px 24px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-reset-filters:hover {
  background: #B8000B;
  transform: translateY(-1px);
}

/* Empty State Knight Graphic */
.empty-state-knight {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 18px;
}

.empty-knight-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid #E20613;
  padding: 4px;
  background: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* Refined Empty State Knight */
.empty-state-knight {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.empty-knight-img {
  width: 80px !important;
  height: 80px !important;
  object-fit: contain !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  padding: 4px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
  border: 2px solid #E20613 !important;
}

/* Clean styling for animated knight gif */
.empty-knight-img {
  width: auto !important;
  height: 64px !important;
  max-height: 64px !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6)) !important;
}


/* Catalog Header Controls */
.catalog-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8A94A6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sort-select {
  background: #141920;
  color: #DDE2E8;
  border: 1px solid #252c38;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.sort-select:hover, .sort-select:focus {
  border-color: #E20613;
  background: #19202a;
}

@media (max-width: 600px) {
  .catalog-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 8px;
  }
}

/* Tool Subgroup Accordion */
details.tool-subgroup {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

details.tool-subgroup summary.subgroup-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #8A94A6;
  padding: 4px 0;
  user-select: none;
  transition: color 0.15s ease;
}

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

details.tool-subgroup summary.subgroup-title:hover {
  color: #DDE2E8;
}

details.tool-subgroup .subgroup-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  color: #64748B;
}

details.tool-subgroup[open] .subgroup-arrow {
  transform: rotate(0deg);
}

details.tool-subgroup:not([open]) .subgroup-arrow {
  transform: rotate(-90deg);
}

details.tool-subgroup .subgroup-items {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Interactive Tool Chips */
.clickable-tool-chip {
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.clickable-tool-chip:hover {
  transform: translateY(-1px) scale(1.05);
  filter: brightness(1.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.clickable-tool-chip:active {
  transform: translateY(0) scale(0.98);
}

/* Quick Info Modal Improvements */
.modal-hero-wrapper {
  width: 100%;
  max-height: 240px;
  background: #0f141c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}

.modal-hero-img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

.modal-section-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-section-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.section-layer .modal-section-title { color: #60A5FA; }
.section-back .modal-section-title { color: #FBBF24; }
.section-scale .modal-section-title { color: #34D399; }
