.tools-page {
  background:
    radial-gradient(circle at 100% 0%, rgba(78, 119, 255, 0.08), transparent 42%),
    radial-gradient(circle at 0% 0%, rgba(0, 160, 160, 0.08), transparent 40%),
    #f3f5f8;
  padding: 16px 0 40px;
}

.tools-page .container {
  width: min(1420px, calc(100% - 24px));
  margin-right: auto;
  margin-left: auto;
}

.tools-hero {
  margin-bottom: 12px;
}

.tools-hero .container {
  padding: 22px 24px;
  border-radius: 16px;
  border: 1px solid #d9e2ee;
  background: linear-gradient(130deg, #ffffff 0%, #eef5ff 100%);
}

.tools-hero .kicker {
  margin: 0 0 8px;
  font-size: 13px;
  color: #4d6075;
  letter-spacing: 0.02em;
}

.tools-hero h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.15;
  color: #17314f;
}

.tools-hero .lead {
  margin: 0;
  max-width: 980px;
  font-size: 16px;
  line-height: 1.65;
  color: #54677d;
}

.tools-body {
  display: grid;
  gap: 16px;
}

.tool-section {
  padding: 16px 16px 18px;
  border-radius: 14px;
  border: 1px solid #dde5ef;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 49, 79, 0.04);
}

.tool-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.tool-section-head::before {
  content: "";
  width: 8px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4f86f7 0%, #5ac4d5 100%);
}

.tool-section h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
  color: #24374c;
}

.tools-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #edf1f6;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 12px;
}

.tools-tab-btn {
  border: none;
  background: transparent;
  color: #5f6f82;
  font-size: 14px;
  line-height: 1.1;
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tools-tab-btn:hover {
  background: #dfe8f5;
  color: #2e4660;
}

.tools-tab-btn:focus-visible {
  outline: 2px solid #5f97ff;
  outline-offset: 1px;
}

.tools-tab-btn.active {
  color: #fff;
  background: linear-gradient(95deg, #5ca2ff 0%, #4d8bf0 100%);
}

.tools-tab-pane {
  display: none;
}

.tools-tab-pane.active {
  display: block;
}

.tools-empty {
  border: 1px dashed #c4d1df;
  border-radius: 12px;
  background: #f8fbff;
  color: #6f7e91;
  font-size: 14px;
  padding: 22px;
  text-align: center;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.tool-card {
  position: relative;
  min-width: 0;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #dde5ef;
  border-radius: 12px;
  background: #f8fbff;
  box-shadow: 0 2px 8px rgba(24, 39, 75, 0.03);
  padding: 10px 44px 10px 58px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
  border-color: #c7d4e6;
  box-shadow: 0 6px 14px rgba(24, 39, 75, 0.06);
}

.tool-card-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--icon-bg, linear-gradient(145deg, #69d6bf 0%, #8c93e9 100%));
  overflow: hidden;
}

.tool-card-icon::before {
  content: attr(data-letter);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.tool-card-icon img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.tool-card h3 {
  margin: 0 0 4px;
  max-width: 100%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: #27394f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-card p {
  margin: 0;
  max-width: 100%;
  color: #667789;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tool-card.no-desc p {
  display: none;
}

.tool-card a {
  position: absolute;
  top: 50%;
  right: 12px;
  margin-top: -9px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #d4dce8;
  border-radius: 50%;
  color: #94a3b6;
  font-size: 0;
  line-height: 0;
  text-decoration: none;
  background: transparent;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.tool-card a::before {
  content: "›";
  font-size: 16px;
  line-height: 1;
}

.tool-card a:hover {
  border-color: #7ba9ea;
  color: #2f66cb;
  background: #eef4fd;
}

.tool-card a:focus-visible {
  outline: 2px solid #5f97ff;
  outline-offset: 1px;
}

@media (max-width: 1200px) {
  .tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .tools-page .container {
    width: min(1420px, calc(100% - 32px));
  }

  .tools-hero .container {
    padding: 18px 18px;
  }

  .tools-hero h1 {
    font-size: 29px;
  }

  .tools-hero .lead {
    font-size: 14px;
  }

  .tool-section {
    padding: 13px 13px 14px;
  }

  .tool-section h2 {
    font-size: 20px;
  }

  .tools-tab-btn {
    font-size: 13px;
    padding: 7px 11px;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .tools-page .container {
    width: min(1420px, calc(100% - 22px));
  }

  .tools-hero .container {
    border-radius: 12px;
  }

  .tools-hero h1 {
    font-size: 24px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tool-card {
    min-height: 80px;
    padding-right: 44px;
  }
}

@media (max-width: 768px) {
  .tools-page {
    padding: 10px 0 24px;
  }

  .tools-hero {
    margin-bottom: 8px;
  }

  .tools-hero .container {
    padding: 14px 14px;
  }

  .tools-hero .kicker {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .tools-hero h1 {
    margin-bottom: 6px;
    font-size: 22px;
  }

  .tools-hero .lead {
    font-size: 13px;
    line-height: 1.45;
  }

  .tools-body {
    gap: 10px;
  }

  .tool-section {
    padding: 10px 10px 12px;
    border-radius: 12px;
  }

  .tool-section-head {
    margin-bottom: 8px;
  }

  .tool-section h2 {
    font-size: 19px;
  }

  .tools-tabs {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    margin-bottom: 10px;
  }

  .tools-tab-btn {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 7px 10px;
  }

  .tool-card {
    min-height: 76px;
    padding: 9px 40px 9px 52px;
  }

  .tool-card-icon {
    left: 10px;
    width: 30px;
    height: 30px;
  }

  .tool-card h3 {
    margin-bottom: 3px;
    font-size: 13px;
  }

  .tool-card p {
    font-size: 11px;
  }

  .tool-card a {
    right: 10px;
    width: 20px;
    height: 20px;
    margin-top: -10px;
  }
}

@media (max-width: 480px) {
  .tools-page .container {
    width: min(1420px, calc(100% - 16px));
  }

  .tools-hero .container {
    padding: 12px 12px;
    border-radius: 10px;
  }

  .tools-hero h1 {
    font-size: 20px;
  }

  .tools-hero .lead {
    font-size: 12px;
  }

  .tool-section {
    padding: 9px 9px 10px;
  }

  .tool-section h2 {
    font-size: 18px;
  }

  .tools-tabs {
    padding: 3px;
    gap: 4px;
  }

  .tools-tab-btn {
    font-size: 12px;
    padding: 6px 9px;
  }

  .tool-card {
    min-height: 74px;
    border-radius: 10px;
  }
}

@media (max-width: 768px) {
  .trade-tools-page {
    overflow-x: hidden;
  }

  .trade-tools-page .container {
    width: min(1420px, calc(100% - 16px));
  }

  .trade-tools-page .nav-wrap {
    gap: 8px;
    padding: 8px 0;
  }

  .trade-tools-page .brand {
    gap: 8px;
  }

  .trade-tools-page .logo {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .trade-tools-page .brand-text {
    font-size: 18px;
    white-space: nowrap;
  }

  .trade-tools-page .main-nav {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    gap: 6px;
    padding-bottom: 2px;
    margin-right: 0;
    -webkit-overflow-scrolling: auto;
    scrollbar-width: none;
  }

  .trade-tools-page .main-nav::-webkit-scrollbar,
  .tools-tabs::-webkit-scrollbar {
    display: none;
  }

  .trade-tools-page .main-nav a {
    flex: 0 1 auto;
    white-space: nowrap;
    padding: 7px 10px;
    font-size: 13px;
    line-height: 1.1;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    border-bottom-width: 1px;
    background: #f7f9fc;
  }

  .trade-tools-page .main-nav a.active {
    color: #ff8a36;
    border-color: #ffd2ad;
    background: #fff3e8;
  }

  .tools-tabs {
    max-width: 100%;
    overflow-x: hidden;
    flex-wrap: wrap;
  }
}
