/* PhishDestroy tools directory — page-scoped layout repair */
html[data-page="tools"] {
  --tools-surface: rgba(15, 23, 34, .78);
  --tools-surface-hover: rgba(18, 28, 41, .92);
  --tools-border: rgba(148, 163, 184, .15);
  --tools-border-strong: rgba(34, 197, 94, .34);
  --tools-text: #f1f5f9;
  --tools-muted: #9baabd;
  --tools-accent: #22c55e;
}

html[data-page="tools"] main#main-content {
  overflow: clip;
}

html[data-page="tools"] main#main-content > .container {
  width: min(1200px, calc(100% - 48px)) !important;
  max-width: 1200px !important;
  padding: 0 !important;
}

html[data-page="tools"] .hero {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 52px 0 44px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--tools-border) !important;
  border-radius: 0 !important;
  background:
    radial-gradient(ellipse 58% 80% at 12% 18%, rgba(34, 197, 94, .09), transparent 72%),
    transparent !important;
  box-shadow: none !important;
  text-align: left !important;
}

html[data-page="tools"] .hero::before {
  display: none !important;
}

html[data-page="tools"] .hero::after {
  left: 0 !important;
  bottom: -1px !important;
  width: 92px !important;
  transform: none !important;
  background: linear-gradient(90deg, var(--tools-accent), transparent) !important;
}

html[data-page="tools"] .hero h1 {
  max-width: 19ch !important;
  margin: 0 !important;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: clamp(2.55rem, 5vw, 4.2rem) !important;
  font-weight: 800 !important;
  letter-spacing: -.05em !important;
  line-height: 1.02 !important;
  text-align: left !important;
  text-wrap: balance;
}

html[data-page="tools"] .hero p {
  max-width: 66ch !important;
  margin: 20px 0 0 !important;
  color: var(--tools-muted) !important;
  font-size: 1rem !important;
  line-height: 1.7 !important;
  text-align: left !important;
}

html[data-page="tools"] .section {
  min-height: 0 !important;
  padding: 44px 0 52px !important;
  border-bottom: 1px solid rgba(148, 163, 184, .08) !important;
}

html[data-page="tools"] .section:last-child {
  border-bottom: 0 !important;
}

html[data-page="tools"] .section-head {
  display: flex !important;
  align-items: end !important;
  justify-content: space-between !important;
  gap: 16px 28px !important;
  margin: 0 0 24px !important;
}

html[data-page="tools"] .section-title,
html[data-page="tools"] h2.section-title {
  margin: 0 !important;
  color: var(--tools-text) !important;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: clamp(1.55rem, 2.8vw, 2.2rem) !important;
  font-weight: 760 !important;
  letter-spacing: -.03em !important;
  line-height: 1.15 !important;
  text-transform: none !important;
}

html[data-page="tools"] .section-title i {
  margin-right: .45rem;
  color: var(--tools-accent) !important;
  font-size: .75em;
}

html[data-page="tools"] .section-sub {
  margin: 6px 0 0 !important;
  color: var(--tools-muted) !important;
  line-height: 1.55 !important;
}

/* Featured rows */
html[data-page="tools"] .section > article.card {
  display: grid !important;
  grid-template-columns: minmax(220px, 30%) minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 20px 28px !important;
  min-height: 0 !important;
  margin: 0 0 12px !important;
  padding: 22px 24px !important;
  overflow: hidden !important;
  border: 1px solid var(--tools-border) !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, var(--tools-surface), rgba(10, 15, 20, .72)) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16) !important;
  transform: none !important;
}

html[data-page="tools"] .section > article.card:hover {
  border-color: var(--tools-border-strong) !important;
  background: linear-gradient(135deg, var(--tools-surface-hover), rgba(12, 20, 29, .9)) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .28), 0 0 24px rgba(34, 197, 94, .06) !important;
  transform: translateY(-2px) !important;
}

html[data-page="tools"] .section > article.card::after,
html[data-page="tools"] .section > article.card::before {
  display: none !important;
}

html[data-page="tools"] .section > article.card > .card-content {
  display: contents !important;
  padding: 0 !important;
}

html[data-page="tools"] .section > article.card .card-head {
  min-width: 0;
  margin: 0 !important;
  align-items: center !important;
}

html[data-page="tools"] .section > article.card .card-desc {
  margin: 0 !important;
}

html[data-page="tools"] .section > article.card .card-tags {
  display: none !important;
}

html[data-page="tools"] .section > article.card .card-actions {
  justify-content: flex-end !important;
  margin: 0 !important;
}

/* Undo legacy featured-card grids that target these two tools by ID. */
html[data-page="tools"] main#main-content #tga-bot-card > .card-content,
html[data-page="tools"] main#main-content #discord-bot-card > .card-content {
  display: contents !important;
  padding: 0 !important;
}

html[data-page="tools"] main#main-content #tga-bot-card .card-head,
html[data-page="tools"] main#main-content #discord-bot-card .card-head {
  display: flex !important;
  grid-column: auto !important;
  grid-row: auto !important;
  align-items: center !important;
  margin: 0 !important;
}

html[data-page="tools"] main#main-content #tga-bot-card .card-head > *,
html[data-page="tools"] main#main-content #discord-bot-card .card-head > *,
html[data-page="tools"] main#main-content #tga-bot-card .card-desc,
html[data-page="tools"] main#main-content #discord-bot-card .card-desc,
html[data-page="tools"] main#main-content #tga-bot-card .card-actions,
html[data-page="tools"] main#main-content #discord-bot-card .card-actions {
  grid-column: auto !important;
  grid-row: auto !important;
  justify-self: auto !important;
}

html[data-page="tools"] main#main-content #tga-bot-card .card-desc,
html[data-page="tools"] main#main-content #discord-bot-card .card-desc {
  display: block !important;
  margin: 0 !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
}

html[data-page="tools"] main#main-content #tga-bot-card .card-actions,
html[data-page="tools"] main#main-content #discord-bot-card .card-actions {
  display: flex !important;
  justify-content: flex-end !important;
  margin: 0 !important;
}

html[data-page="tools"] main#main-content .section > article.card .card-ico,
html[data-page="tools"] main#main-content .grid.grid-3 .card-ico {
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  flex: 0 0 46px !important;
  border: 1px solid rgba(148, 163, 184, .16) !important;
  background: rgba(255, 255, 255, .045) !important;
}

/* Normal card grids */
html[data-page="tools"] .grid.grid-3 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

html[data-page="tools"] .grid.grid-3 > article.card {
  display: flex !important;
  min-height: 236px !important;
  padding: 22px !important;
  overflow: hidden !important;
  border: 1px solid var(--tools-border) !important;
  border-radius: 14px !important;
  background: var(--tools-surface) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14) !important;
}

html[data-page="tools"] .grid.grid-3 > article.card:hover {
  border-color: var(--tools-border-strong) !important;
  background: var(--tools-surface-hover) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .26), 0 0 22px rgba(34, 197, 94, .05) !important;
}

html[data-page="tools"] .card > .card-content,
html[data-page="tools"] .grid.grid-3 > article.card > .card-content {
  width: 100%;
  padding: 0 !important;
}

html[data-page="tools"] .grid.grid-3 .card-head {
  align-items: center !important;
  margin: 0 0 16px !important;
}

html[data-page="tools"] .card-ico,
html[data-page="tools"] .tb-card-ico {
  display: grid !important;
  width: 46px !important;
  min-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  flex: 0 0 46px !important;
  place-items: center !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(148, 163, 184, .16) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, .045) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04) !important;
  font-size: 1.15rem !important;
}

html[data-page="tools"] .card-ico img,
html[data-page="tools"] .tb-card-ico img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

html[data-page="tools"] .card-title {
  color: var(--tools-text) !important;
  font-size: 1rem !important;
  line-height: 1.35 !important;
}

html[data-page="tools"] .card-desc {
  color: var(--tools-muted) !important;
  font-size: .9rem !important;
  line-height: 1.62 !important;
}

html[data-page="tools"] .card-tags {
  gap: 6px !important;
  margin-top: 16px !important;
}

html[data-page="tools"] .tag {
  min-height: 0 !important;
  padding: 4px 9px !important;
  border: 1px solid rgba(148, 163, 184, .13) !important;
  border-radius: 7px !important;
  background: rgba(148, 163, 184, .055) !important;
  color: #a9b6c7 !important;
  font-size: .67rem !important;
  letter-spacing: .025em !important;
}

html[data-page="tools"] .card-actions {
  gap: 10px !important;
  margin-top: 18px !important;
}

html[data-page="tools"] .btn {
  min-height: 42px !important;
  justify-content: center !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  font-size: .82rem !important;
  white-space: nowrap;
}

/* Searchable toolbox */
html[data-page="tools"] .tb-search-wrap {
  max-width: 600px !important;
  margin: 20px auto 0 !important;
}

html[data-page="tools"] .tb-search {
  min-height: 48px;
  border-color: var(--tools-border) !important;
  background: var(--tools-surface) !important;
}

html[data-page="tools"] .cat-tabs {
  gap: 8px !important;
  margin: 18px 0 24px !important;
}

html[data-page="tools"] .cat-tab {
  min-height: 38px !important;
  padding: 7px 15px !important;
  border-radius: 9px !important;
}

html[data-page="tools"] #toolbox .grid,
html[data-page="tools"] .tb-grid,
html[data-page="tools"] #tbGrid {
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

html[data-page="tools"] .tb-card {
  min-height: 178px !important;
  padding: 18px !important;
  border: 1px solid var(--tools-border) !important;
  border-radius: 13px !important;
  background: var(--tools-surface) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12) !important;
}

html[data-page="tools"] .tb-card:hover {
  border-color: var(--tools-border-strong) !important;
  background: var(--tools-surface-hover) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .24) !important;
}

html[data-page="tools"] .tb-card-head {
  align-items: center !important;
  margin-bottom: 12px !important;
}

html[data-page="tools"] .tb-card-name {
  color: var(--tools-text) !important;
  font-size: .9rem !important;
  line-height: 1.35 !important;
}

html[data-page="tools"] .tb-card-desc {
  color: var(--tools-muted) !important;
  line-height: 1.55 !important;
}

/* Keep the complete 115-tool catalog visible at the top of every tools hub. */
html[data-page="tools"] .pd-arsenal-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  align-items: stretch;
  margin: -10px 0 28px;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, .3);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 20%, rgba(59, 130, 246, .18), transparent 44%),
    linear-gradient(135deg, rgba(11, 20, 34, .96), rgba(10, 15, 24, .9));
  box-shadow: 0 20px 54px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .035);
}

html[data-page="tools"] .pd-arsenal-feature::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, #22c55e, transparent);
  opacity: .9;
}

html[data-page="tools"] .pd-arsenal-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 210px;
  padding: 24px;
  border-right: 1px solid rgba(59, 130, 246, .2);
  background: rgba(59, 130, 246, .055);
}

html[data-page="tools"] .pd-arsenal-number strong {
  color: #f4f8ff;
  font: 800 clamp(3.4rem, 5vw, 5rem)/.9 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: -.08em;
  text-shadow: 0 0 28px rgba(59, 130, 246, .35);
}

html[data-page="tools"] .pd-arsenal-number span {
  margin-top: 13px;
  color: #60a5fa;
  font: 800 .72rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .24em;
}

html[data-page="tools"] .pd-arsenal-card {
  min-height: 0 !important;
  margin: 0 !important;
  padding: clamp(22px, 3vw, 32px) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-page="tools"] .pd-arsenal-card:hover {
  transform: none !important;
  background: rgba(59, 130, 246, .035) !important;
}

html[data-page="tools"] .pd-arsenal-card .card-title {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem) !important;
}

html[data-page="tools"] .pd-arsenal-card .card-desc {
  max-width: 72ch;
  font-size: .96rem !important;
  line-height: 1.7 !important;
}

html[data-page="tools"] .pd-arsenal-card .card-actions {
  margin-top: 18px !important;
}

/* Restore the denser production rows for compact directories. */
@media (min-width: 1180px) {
  html[data-page="tools"] main .section:nth-of-type(4) .grid.grid-3,
  html[data-page="tools"] main .section:nth-of-type(5) .grid.grid-3,
  html[data-page="tools"] main .section:nth-of-type(7) .grid.grid-3 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  html[data-page="tools"] main .section:nth-of-type(4) .grid.grid-3 > article.card,
  html[data-page="tools"] main .section:nth-of-type(5) .grid.grid-3 > article.card,
  html[data-page="tools"] main .section:nth-of-type(7) .grid.grid-3 > article.card {
    min-height: 208px !important;
    padding: 18px !important;
  }
}

@media (max-width: 980px) {
  html[data-page="tools"] .section > article.card {
    grid-template-columns: minmax(190px, 34%) minmax(0, 1fr) !important;
  }

  html[data-page="tools"] .section > article.card .card-actions {
    grid-column: 1 / -1;
    justify-content: flex-start !important;
  }

  html[data-page="tools"] .grid.grid-3,
  html[data-page="tools"] #toolbox .grid,
  html[data-page="tools"] .tb-grid,
  html[data-page="tools"] #tbGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 981px) and (max-width: 1179px) {
  html[data-page="tools"] #toolbox .grid,
  html[data-page="tools"] .tb-grid,
  html[data-page="tools"] #tbGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  html[data-page="tools"] main#main-content > .container {
    width: calc(100% - 32px) !important;
  }

  html[data-page="tools"] .hero {
    padding: 36px 0 38px !important;
  }

  html[data-page="tools"] .hero h1 {
    max-width: 14ch !important;
    font-size: clamp(2.05rem, 10.5vw, 2.75rem) !important;
    line-height: 1.05 !important;
  }

  html[data-page="tools"] .hero p {
    margin-top: 18px !important;
    font-size: .94rem !important;
    line-height: 1.65 !important;
  }

  html[data-page="tools"] .pd-arsenal-feature {
    grid-template-columns: minmax(0, 1fr);
    margin: -4px 0 18px;
    border-radius: 15px;
  }

  html[data-page="tools"] .pd-arsenal-number {
    min-height: 0;
    flex-direction: row;
    gap: 12px;
    justify-content: flex-start;
    padding: 17px 20px 15px;
    border-right: 0;
    border-bottom: 1px solid rgba(59, 130, 246, .2);
  }

  html[data-page="tools"] .pd-arsenal-number strong {
    font-size: 2.35rem;
    letter-spacing: -.06em;
  }

  html[data-page="tools"] .pd-arsenal-number span {
    margin-top: 3px;
  }

  html[data-page="tools"] .pd-arsenal-card {
    padding: 20px !important;
  }

  html[data-page="tools"] .section {
    padding: 34px 0 40px !important;
  }

  html[data-page="tools"] .section-head {
    display: block !important;
    margin-bottom: 20px !important;
  }

  html[data-page="tools"] .section > article.card {
    display: block !important;
    padding: 20px !important;
    border-radius: 13px !important;
  }

  html[data-page="tools"] .section > article.card > .card-content {
    display: block !important;
  }

  html[data-page="tools"] main#main-content #tga-bot-card > .card-content,
  html[data-page="tools"] main#main-content #discord-bot-card > .card-content {
    display: block !important;
  }

  html[data-page="tools"] .section > article.card .card-desc,
  html[data-page="tools"] .section > article.card .card-actions {
    margin-top: 16px !important;
  }

  html[data-page="tools"] .section > article.card .card-actions .btn {
    width: 100%;
  }

  html[data-page="tools"] .grid.grid-3,
  html[data-page="tools"] #toolbox .grid,
  html[data-page="tools"] .tb-grid,
  html[data-page="tools"] #tbGrid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-page="tools"] .grid.grid-3 > article.card {
    min-height: 0 !important;
    padding: 20px !important;
  }

  html[data-page="tools"] .card-head {
    gap: 13px !important;
  }

  html[data-page="tools"] .card-ico,
  html[data-page="tools"] .tb-card-ico {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    flex-basis: 44px !important;
  }

  html[data-page="tools"] .card-tags {
    margin-top: 14px !important;
  }

  html[data-page="tools"] .card-actions .btn {
    flex: 1 1 auto !important;
  }

  html[data-page="tools"] .cat-tabs {
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    margin-inline: -16px !important;
    padding: 0 16px 8px !important;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  html[data-page="tools"] .cat-tab {
    flex: 0 0 auto;
    min-height: 42px !important;
  }

  html[data-page="tools"] .tb-card {
    min-height: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-page="tools"] .card,
  html[data-page="tools"] .tb-card,
  html[data-page="tools"] .btn {
    transition: none !important;
  }
}
