.ai-toolkit-section {
  background: transparent;
  padding: 80px 20px;
  min-height: 600px;
}

.ai-toolkit-container {
  max-width: 1200px;
  margin: 0 auto;
}

.ai-toolkit-header {
  text-align: center;
  margin-bottom: 40px;
}

.ai-toolkit-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  font-weight: 300;
}

.ai-toolkit-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.ai-toolkit-tab {
  height: 40px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease-out;
  border: 1px solid white;
  border-radius: 6px;
  background: transparent;
  color: white;
}

.ai-toolkit-tab:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ai-toolkit-tab.active {
  background: linear-gradient(to right, #de897a, #92278f);
  border: 0;
  box-shadow: inset 0px 0px 9px 1px #dc7ff3;
}

.ai-toolkit-subtabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ai-toolkit-subtabs.hidden {
  display: none;
}

.ai-toolkit-subtab {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  min-height: 48px;
  padding: 12px 14px 14px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ai-toolkit-subtab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(222, 137, 122, 0.55) 0%, rgba(146, 39, 143, 0.35) 50%, transparent 100%);
  opacity: 0.5;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.ai-toolkit-subtab:hover {
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(2px);
}

.ai-toolkit-subtab:hover::after {
  opacity: 0.85;
}

.ai-toolkit-subtab.active {
  background: rgba(146, 39, 143, 0.2);
  box-shadow: 0 0 10px rgba(222, 137, 122, 0.3);
  color: #fff;
}

.ai-toolkit-subtab.active::after {
  background: linear-gradient(90deg, rgba(222, 137, 122, 1) 0%, rgba(146, 39, 143, 0.8) 50%, transparent 100%);
  opacity: 1;
}

.ai-toolkit-category-summary {
  display: none;
}
p.ai-toolkit-subtitle {
    margin: 0 auto;
}
.ai-toolkit-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding-top: 15px;
}

.ai-toolkit-rail {
  width: 280px;
  background: rgba(20, 10, 25, 0.8);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(100, 80, 120, 0.3);
  position: relative;
  overflow: hidden;
  min-height: 400px;
}

.ai-toolkit-rail-inner {
  height: 100%;
  overflow: hidden;
  position: relative;
}

.ai-toolkit-rail-inner.scrollable:hover {
  overflow-y: auto;
}

.ai-toolkit-rail-inner::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

.ai-toolkit-rail-inner.scrollable:hover::-webkit-scrollbar {
  width: 6px;
}

.ai-toolkit-rail-inner::-webkit-scrollbar-track {
  background: rgba(100, 80, 120, 0.2);
  border-radius: 3px;
}

.ai-toolkit-rail-inner::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #de897a, #92278f);
  border-radius: 3px;
}

.ai-toolkit-rail-inner::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #e89b8d, #a33499);
}

.ai-toolkit-rail-inner {
  scrollbar-width: none;
}

.ai-toolkit-rail-inner.scrollable:hover {
  scrollbar-width: thin;
  scrollbar-color: #de897a rgba(100, 80, 120, 0.2);
}

.ai-toolkit-marquee {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: marqueeScroll 30s linear infinite;
}

.ai-toolkit-marquee.static {
  animation: none;
}

.ai-toolkit-rail:hover .ai-toolkit-marquee:not(.static) {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

.ai-toolkit-tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  padding-bottom: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  position: relative;
}

.ai-toolkit-tool-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, rgba(222, 137, 122, 0.6) 0%, rgba(146, 39, 143, 0.4) 50%, transparent 100%);
  opacity: 0.5;
}

.ai-toolkit-tool-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ai-toolkit-tool-item:hover::after {
  opacity: 0.8;
}

.ai-toolkit-tool-item.selected {
  background: rgba(146, 39, 143, 0.2);
  box-shadow: 0 0 10px rgba(222, 137, 122, 0.3);
}

.ai-toolkit-tool-item.selected::after {
  background: linear-gradient(90deg, rgba(222, 137, 122, 1) 0%, rgba(146, 39, 143, 0.8) 50%, transparent 100%);
  opacity: 1;
}

.ai-toolkit-tool-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(100, 80, 120, 0.3);
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.ai-toolkit-tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-toolkit-tool-name {
  color: white;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-toolkit-details {
  flex: 1;
  background: linear-gradient(135deg, rgba(60, 30, 70, 0.4) 0%, rgb(30 15 40 / 0%) 100%);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(100, 80, 120, 0.3);
  min-height: 400px;
}

.ai-toolkit-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
}

.ai-toolkit-tool-card {
  min-height: 190px;
  height: 100%;
  border-radius: 12px;
  border: 1px solid rgba(100, 80, 120, 0.32);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  padding: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

.ai-toolkit-tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(222, 137, 122, 0.18), transparent 42%);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.ai-toolkit-tool-card:hover,
.ai-toolkit-tool-card:focus,
.ai-toolkit-tool-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(222, 137, 122, 0.62);
  background: linear-gradient(145deg, rgba(146, 39, 143, 0.22), rgba(30, 15, 40, 0.42));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28), 0 0 22px rgba(222, 137, 122, 0.14);
}

.ai-toolkit-tool-card:focus {
  outline: 2px solid rgba(222, 137, 122, 0.65);
  outline-offset: 2px;
}

.ai-toolkit-tool-card:hover::before,
.ai-toolkit-tool-card:focus::before,
.ai-toolkit-tool-card:focus-within::before {
  opacity: 1;
}

.ai-toolkit-tool-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
}

.ai-toolkit-tool-card-name {
  color: white;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 500;
  margin: 0;
  overflow-wrap: anywhere;
}

.ai-toolkit-tool-card-body {
  position: relative;
  z-index: 1;
  opacity: 1;
  transform: none;
  text-align: center;
  margin-top: 12px;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
}

.ai-toolkit-tool-card-desc {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 12px;
  text-align: center;
  overflow-wrap: anywhere;
}

.ai-toolkit-tool-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: white;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  margin-top: auto;
  transition: color 0.2s ease, transform 0.2s ease;
}

.ai-toolkit-tool-card-link:hover {
  color: #de897a;
  transform: translateX(2px);
}

.ai-toolkit-tool-card-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.ai-toolkit-details-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: rgba(100, 80, 120, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 600;
  color: white;
  overflow: hidden;
}

.ai-toolkit-details-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-toolkit-details-name {
  color: white;
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.ai-toolkit-details-desc {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 24px;
  overflow-wrap: anywhere;
}

.ai-toolkit-details-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.ai-toolkit-details-link:hover {
  color: #de897a;
}

.ai-toolkit-details-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 768px) {
  /* Switch to a stacked layout so rail and detail panes do not fight for width. */
  .ai-toolkit-content {
    flex-direction: column;
  }
  
  .ai-toolkit-rail {
    width: 100%;
    min-height: auto;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  
  .ai-toolkit-rail-inner {
    overflow-x: auto;
    overflow-y: hidden;
    height: auto;
  }
  
  .ai-toolkit-marquee {
    flex-direction: row;
    gap: 12px;
    animation: none !important;
    width: max-content;
    padding: 8px 0;
  }
  
  .ai-toolkit-tool-item {
    flex-direction: column;
    width: 100px;
    min-width: 100px;
    text-align: center;
    padding: 12px 8px;
  }
  
  .ai-toolkit-tool-item::after {
    display: none;
  }
  
  .ai-toolkit-tool-name {
    font-size: 12px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }
  
  .ai-toolkit-tabs {
    overflow-x: auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .ai-toolkit-tabs::-webkit-scrollbar {
    display: none;
  }

  .ai-toolkit-subtabs {
    justify-content: flex-start;
    flex-direction: row;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    scrollbar-width: none;
    gap: 14px;
  }

  .ai-toolkit-subtabs::-webkit-scrollbar {
    display: none;
  }

  .ai-toolkit-subtab {
    white-space: nowrap;
    width: auto;
    min-height: 40px;
    font-size: 12px;
    padding: 10px 14px;
    text-align: center;
  }

  .ai-toolkit-title {
    font-size: 32px;
  }

  .ai-toolkit-details {
    padding: 24px;
    width: 100%;
    min-height: auto;
  }

  .ai-toolkit-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .ai-toolkit-tool-card {
    min-height: 184px;
    padding: 14px;
  }

  .ai-toolkit-details-name {
    font-size: 24px;
  }

  .ai-toolkit-details-desc {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .ai-toolkit-section {
    padding: 56px 14px;
  }

  .ai-toolkit-header {
    margin-bottom: 28px;
  }

  .ai-toolkit-tab {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
  }

  .ai-toolkit-rail {
    padding: 12px;
    border-radius: 12px;
  }

  .ai-toolkit-tool-item {
    width: 92px;
    min-width: 92px;
  }

  .ai-toolkit-details {
    padding: 18px;
    border-radius: 12px;
  }

  .ai-toolkit-card-grid {
    grid-template-columns: 1fr;
  }

  .ai-toolkit-tool-card {
    min-height: 174px;
  }

  .ai-toolkit-details-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
  }

  .ai-toolkit-details-name {
    font-size: 20px;
  }

  .ai-toolkit-details-desc {
    font-size: 14px;
    line-height: 1.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-toolkit-marquee {
    animation: none;
  }
  
  .ai-toolkit-rail-inner {
    overflow-y: auto;
  }
}
