/* Tools + strategy marketplace (loaded on /tools, /marketplace) */

/* ——— /tools premium UI ——— */
.tools-suite {
  position: relative;
  padding-top: 88px;
  padding-bottom: 100px;
  overflow: hidden;
}
.tools-suite-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(0, 200, 168, 0.16), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 20%, rgba(120, 90, 255, 0.09), transparent 45%),
    radial-gradient(ellipse 55% 45% at 0% 75%, rgba(0, 160, 140, 0.07), transparent 50%);
  opacity: 1;
}
.tools-suite-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.tools-suite-inner {
  position: relative;
  z-index: 1;
}

.tools-hero {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 36px;
}
.tools-hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0.95;
}
.tools-hero-title {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #fff 0%, rgba(232, 234, 239, 0.82) 45%, rgba(0, 200, 168, 0.75) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tools-hero-lede {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
}

.tools-tab-rail {
  max-width: 720px;
  margin: 0 auto 28px;
  padding: 6px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.tools-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.tools-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 12px 20px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}
.tools-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.tools-tab.is-active {
  color: #0a0b0f;
  background: linear-gradient(135deg, #00e8c4 0%, #00c8a8 50%, #00a896 100%);
  box-shadow:
    0 0 0 1px rgba(0, 200, 168, 0.4),
    0 8px 28px rgba(0, 200, 168, 0.25);
}

.tools-workbench {
  display: none;
  position: relative;
  max-width: 920px;
  margin: 0 auto 28px;
  padding: 2px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: linear-gradient(
    135deg,
    rgba(0, 200, 168, 0.45) 0%,
    rgba(255, 255, 255, 0.12) 35%,
    rgba(100, 80, 255, 0.2) 100%
  );
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}
.tools-workbench.is-active {
  display: block;
  animation: tools-wb-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes tools-wb-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.tools-panel-inner {
  position: relative;
  padding: clamp(22px, 4vw, 36px);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, rgba(18, 20, 28, 0.97) 0%, rgba(12, 13, 18, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.tools-wb-corner {
  position: absolute;
  width: 48px;
  height: 48px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.5;
}
.tools-wb-corner--tl {
  top: 10px;
  left: 10px;
  border-top: 2px solid rgba(0, 200, 168, 0.35);
  border-left: 2px solid rgba(0, 200, 168, 0.35);
  border-radius: 10px 0 0 0;
}
.tools-wb-corner--br {
  bottom: 10px;
  right: 10px;
  border-bottom: 2px solid rgba(0, 200, 168, 0.22);
  border-right: 2px solid rgba(0, 200, 168, 0.22);
  border-radius: 0 0 10px 0;
}

.tools-panel-head {
  margin-bottom: 26px;
}
.tools-panel-title {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.3;
}
.tools-panel-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 62ch;
}

.tools-fields {
  display: grid;
  gap: 18px;
}
.tools-fields--2 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.tools-fields--3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 720px) {
  .tools-fields--3 {
    grid-template-columns: 1fr;
  }
}
.tools-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tools-field-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.tools-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}
.tools-input:hover {
  border-color: rgba(0, 200, 168, 0.25);
  background: rgba(0, 0, 0, 0.42);
}
.tools-input:focus {
  outline: none;
  border-color: rgba(0, 200, 168, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 200, 168, 0.12);
}

.tools-output {
  position: relative;
  margin-top: 28px;
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(0, 200, 168, 0.12) 0%, rgba(0, 80, 72, 0.2) 100%);
  border: 1px solid rgba(0, 200, 168, 0.28);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.tools-output--summary {
  font-family: var(--font);
}
.tools-output--error {
  background: rgba(255, 71, 87, 0.08);
  border-color: rgba(255, 71, 87, 0.35);
  color: var(--danger);
  font-size: 0.9rem;
  font-family: var(--font);
}
.tools-output-glow {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 55%;
  height: 120%;
  background: radial-gradient(circle, rgba(0, 232, 196, 0.18) 0%, transparent 65%);
  pointer-events: none;
}
.tools-output-inner {
  position: relative;
  z-index: 1;
}
.tools-output-inner--split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}
@media (max-width: 560px) {
  .tools-output-inner--split {
    grid-template-columns: 1fr;
  }
  .tools-output-divider {
    display: none;
  }
}
.tools-output-inner--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tools-output-col {
  text-align: center;
}
.tools-output-inner--split .tools-output-col:first-child {
  text-align: left;
}
.tools-output-inner--split .tools-output-col:last-child {
  text-align: right;
}
@media (max-width: 560px) {
  .tools-output-inner--split .tools-output-col:first-child,
  .tools-output-inner--split .tools-output-col:last-child {
    text-align: center;
  }
}
.tools-output-divider {
  width: 1px;
  height: 56px;
  background: linear-gradient(180deg, transparent, rgba(0, 200, 168, 0.35), transparent);
  border-radius: 1px;
}
.tools-kicker {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232, 234, 239, 0.55);
  margin-bottom: 8px;
}
.tools-result-figure {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 40px rgba(0, 200, 168, 0.25);
  letter-spacing: -0.02em;
}
.tools-result-figure--sm {
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}
.tools-result-sub {
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-family: var(--font);
  font-weight: 400;
}
.tools-result-sub-val {
  color: rgba(0, 232, 196, 0.9);
  font-family: var(--font-mono);
  font-weight: 500;
}
.tools-compound-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.tools-compound-mult {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 200, 168, 0.25);
}

.tools-table-shell {
  margin-top: 20px;
  max-height: 240px;
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.compound-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.compound-table th,
.compound-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.compound-table tbody tr:hover td {
  background: rgba(0, 200, 168, 0.05);
}
.compound-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: sticky;
  top: 0;
  background: rgba(14, 16, 22, 0.95);
  backdrop-filter: blur(8px);
}
.compound-table td:last-child {
  font-family: var(--font-mono);
  color: rgba(0, 232, 196, 0.92);
}

.tools-disclaimer {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 920px;
  margin: 8px auto 0;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(105deg, rgba(255, 165, 2, 0.07) 0%, rgba(20, 18, 14, 0.85) 40%);
  border: 1px solid rgba(255, 165, 2, 0.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.tools-disclaimer-mark {
  flex-shrink: 0;
  width: 4px;
  align-self: stretch;
  min-height: 48px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--warning), rgba(255, 165, 2, 0.35));
  box-shadow: 0 0 16px rgba(255, 165, 2, 0.25);
}
.tools-disclaimer-body strong {
  color: rgba(255, 200, 120, 0.95);
  font-weight: 600;
}

/* Маркетплейс: тот же класс, без разметки «aside» */
.marketplace-page .tools-disclaimer {
  display: block;
  border-left: 4px solid var(--warning);
  padding-left: 20px;
  background: rgba(255, 165, 2, 0.06);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  border-top: 1px solid rgba(255, 165, 2, 0.12);
  border-right: 1px solid rgba(255, 165, 2, 0.08);
  border-bottom: 1px solid rgba(255, 165, 2, 0.08);
}

.marketplace-page .mp-intro {
  max-width: 640px;
  margin-bottom: 28px;
}

.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.mp-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.mp-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.mp-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}
.mp-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  white-space: nowrap;
}
.mp-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.mp-metric {
  text-align: center;
  padding: 10px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.mp-metric-val {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
}
.mp-metric-lab {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.25;
}
.mp-spark {
  height: 40px;
  margin: 8px 0 12px;
  opacity: 0.85;
}
.mp-spark path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.mp-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.mp-incident {
  color: var(--warning);
  font-size: 0.8rem;
  margin-top: 8px;
}
.mp-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
}
.mp-sort label {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.mp-sort select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-family: var(--font);
}

.ref-utm-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.ref-utm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ref-utm-row span {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 100px;
}
.dash-invite-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 200, 168, 0.22);
  background: linear-gradient(135deg, rgba(0, 200, 168, 0.08), rgba(100, 80, 255, 0.06));
}
