.tools-page {
  background: var(--paper);
  letter-spacing: 0;
}

.tools-page button,
.tools-page input,
.tools-page select,
.tools-page textarea {
  font: inherit;
}

.tools-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

/* Header nav uses a fixed max-width + padding box (page.css), which doesn't
   line up with .tools-shell's viewport-relative width. Force it to match so
   the logo aligns with the breadcrumbs/content below on tool pages. */
.tools-page .nav {
  width: min(1160px, calc(100% - 40px));
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.tools-main {
  padding-bottom: 86px;
}

.tool-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 42px 0 22px;
}

.tool-page-head h1 {
  max-width: 820px;
  color: var(--ink);
  font-size: clamp(2.25rem, 3.8vw, 3.25rem);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
}

.tool-page-head p {
  max-width: 700px;
  margin-top: 12px;
  color: var(--ink-60);
  font-size: 17px;
  line-height: 1.45;
  font-weight: 650;
}

.tool-title-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.tool-title-mark .tool-kicker {
  margin-bottom: 0;
}

.tool-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--primary);
}

.tool-icon svg {
  width: 100%;
  height: 100%;
}

.hero-icon {
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid rgba(56, 71, 254, 0.18);
  border-radius: 14px;
  background: rgba(56, 71, 254, 0.07);
}

.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  margin-top: 18px;
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-60);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.platform-chip svg {
  width: 15px;
  height: 15px;
}

.platform-instagram svg {
  color: #d62976;
}

.platform-tiktok svg {
  color: #111;
}

.tool-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  margin-bottom: 12px;
  padding: 0 9px;
  border: 1px solid rgba(56, 71, 254, 0.2);
  border-radius: 999px;
  background: rgba(56, 71, 254, 0.07);
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tf {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}

.tf-progress {
  height: 4px;
  background: var(--line);
}

.tf-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.25s ease;
}

.tf-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 460px;
  padding: 48px 32px;
}

.tf-body[hidden] {
  display: none;
}

.tf-step {
  display: none;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  animation: tfStepIn 0.28s ease;
}

.tf.tf-ready .tf-step {
  display: none;
}

.tf.tf-ready .tf-step.is-active {
  display: block;
}

.tf:not(.tf-ready) .tf-step {
  display: block;
  margin-bottom: 32px;
}

@keyframes tfStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tf-count {
  display: block;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tf-question {
  display: block;
  color: var(--ink);
  font-size: clamp(20px, 3vw, 26px);
  line-height: 1.25;
  font-weight: 900;
}

.tf-input,
.tf-textarea {
  width: 100%;
  margin-top: 22px;
  border: none;
  border-bottom: 2px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  padding: 8px 2px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease;
}

.tf-input::placeholder,
.tf-textarea::placeholder {
  color: var(--ink-45);
  font-weight: 600;
}

.tf-input:focus,
.tf-textarea:focus {
  border-color: var(--primary);
}

.tf-textarea {
  min-height: 96px;
  resize: vertical;
  font-size: 16px;
  line-height: 1.45;
}

.tf-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.tf-choice {
  position: relative;
}

.tf-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.tf-choice span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink-60);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tf-choice input:checked + span {
  border-color: var(--primary);
  background: rgba(56, 71, 254, 0.08);
  color: var(--primary);
}

.tf-choice input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.tf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}

.tf-back-btn {
  display: none;
}

.tf-step.can-go-back .tf-back-btn {
  display: inline-flex;
}

.tf-hint {
  color: var(--ink-45);
  font-size: 12px;
  font-weight: 700;
}

.tf-hint kbd {
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-family: inherit;
  font-size: 11px;
}

.tf-note {
  margin-top: 14px;
  color: var(--ink-45);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.tf-note a {
  color: var(--primary);
}

.tool-button,
.tool-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.tool-button {
  background: var(--ink);
  color: #fff;
}

.tool-button:hover,
.tool-button-secondary:hover {
  transform: translateY(-1px);
}

.tool-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.tf-result {
  padding: 32px;
  border-top: 1px solid var(--line);
}

.tf-result[hidden] {
  display: none;
}

.tf-loading,
.tf-locked {
  display: grid;
  min-height: 300px;
  place-items: center;
  text-align: center;
}

.tf-loading-inner strong,
.tf-locked strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.tf-locked span {
  display: block;
  max-width: 420px;
  margin: 8px auto 18px;
  color: var(--ink-60);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 650;
}

.tf-dots {
  display: inline-flex;
  gap: 4px;
  margin-top: 14px;
}

.tf-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: tfDot 1s infinite ease-in-out;
}

.tf-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.tf-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes tfDot {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.tf-error {
  color: #9a2323;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.tf-gate {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(56, 71, 254, 0.22);
  border-radius: 12px;
  background: rgba(56, 71, 254, 0.06);
}

.tf-gate strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.tf-gate span {
  display: block;
  margin-bottom: 12px;
  color: var(--ink-60);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

.result-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.result-topline h3 {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef8f3;
  color: #0c7f5b;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.local {
  background: #f4f4f4;
  color: var(--ink-60);
}

.status-pill.warn {
  background: #fff5df;
  color: #9a6500;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfc;
}

.metric span {
  display: block;
  color: var(--ink-45);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.18;
  font-weight: 900;
}

.creator-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.creator-table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
  background: #fff;
}

.creator-table th,
.creator-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.creator-table th {
  background: #fbfbfc;
  color: var(--ink-45);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.creator-table td {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.email-gate {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.email-gate span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.email-blur {
  display: inline-block;
  width: fit-content;
  filter: blur(3.4px);
  opacity: 0.82;
  user-select: none;
}

.email-gate a {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.email-gate.muted span {
  color: var(--ink-45);
}

.creator-cell {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 210px;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f1f2f5;
  color: var(--ink-45);
  font-size: 12px;
  font-weight: 900;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creator-cell strong,
.creator-cell span {
  display: block;
}

.creator-cell strong {
  color: var(--ink);
  font-size: 14px;
}

.creator-cell span {
  margin-top: 2px;
  color: var(--ink-45);
  font-size: 12px;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(56, 71, 254, 0.09);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.result-blocks {
  display: grid;
  gap: 10px;
}

.result-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.result-block h4 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.result-block p,
.result-block pre {
  color: var(--ink-60);
  font-size: 14px;
  line-height: 1.48;
  font-weight: 650;
}

.result-block pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Satoshi", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.locked-preview {
  display: grid;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(56, 71, 254, 0.2);
  border-radius: 12px;
  background: rgba(56, 71, 254, 0.055);
}

.locked-copy strong,
.locked-copy span {
  display: block;
}

.locked-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.locked-copy span {
  max-width: 620px;
  margin-top: 5px;
  color: var(--ink-60);
  font-size: 13px;
  line-height: 1.42;
  font-weight: 700;
}

.locked-lines {
  display: grid;
  gap: 8px;
  width: min(540px, 100%);
  pointer-events: none;
}

.locked-lines span {
  display: block;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(25, 28, 45, 0.18), rgba(56, 71, 254, 0.18));
  filter: blur(3.2px);
}

.locked-lines span:nth-child(2) {
  width: 88%;
}

.locked-lines span:nth-child(3) {
  width: 76%;
}

.locked-lines span:nth-child(4) {
  width: 62%;
}

.locked-preview .tool-button {
  width: fit-content;
}

.prompt-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(56, 71, 254, 0.18);
  border-radius: 12px;
  background: rgba(56, 71, 254, 0.045);
}

.prompt-box strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.prompt-box > span {
  display: block;
  max-width: 620px;
  margin-top: 6px;
  color: var(--ink-60);
  font-size: 13px;
  line-height: 1.42;
  font-weight: 700;
}

.prompt-preview {
  position: relative;
  max-height: 132px;
  margin-top: 10px;
  overflow: hidden;
}

.prompt-box pre {
  margin-top: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-60);
  font-family: "Satoshi", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

.prompt-box-locked pre {
  margin-top: 0;
}

.prompt-lock {
  position: absolute;
  inset: 38px 0 0;
  background: linear-gradient(180deg, rgba(247, 247, 248, 0.18), rgba(247, 247, 248, 0.96));
  backdrop-filter: blur(2.4px);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.tool-info-section {
  padding: 64px 0 0;
}

.tool-copy-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  gap: 42px;
  align-items: start;
}

.tool-copy-grid h2 {
  color: var(--ink);
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: 0;
}

.tool-copy-grid p {
  max-width: 520px;
  margin-top: 12px;
  color: var(--ink-60);
  font-size: 16px;
  line-height: 1.48;
  font-weight: 650;
}

.tool-list {
  display: grid;
  gap: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.tool-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.38;
  font-weight: 800;
}

.related-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.related-tool,
.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 158px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.tool-card-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid rgba(56, 71, 254, 0.14);
  border-radius: 10px;
  background: rgba(56, 71, 254, 0.06);
  color: var(--primary);
}

.tool-card-icon svg {
  width: 100%;
  height: 100%;
}

.related-tool:hover,
.related-tool:focus-visible,
.tool-card:hover,
.tool-card:focus-visible {
  border-color: rgba(56, 71, 254, 0.38);
  background: #fff;
  outline: none;
  transform: translateY(-2px);
}

.related-tool small,
.tool-card small {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.related-tool strong,
.tool-card strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.15;
  font-weight: 900;
}

.related-tool span,
.tool-card span {
  display: block;
  margin-top: 8px;
  color: var(--ink-60);
  font-size: 13px;
  line-height: 1.38;
  font-weight: 650;
}

.tool-card .card-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
}

.tool-card .card-platforms:empty {
  display: none;
}

.tool-card .card-platforms .platform-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-top: 0;
  padding: 0 8px;
  font-size: 11px;
}

.tools-hub {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-top: 12px;
}

.hub-filter {
  position: sticky;
  top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.hub-filter strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.hub-filter a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-60);
  font-size: 13px;
  font-weight: 800;
}

.hub-filter a:first-of-type {
  border-top: 0;
}

.hub-groups {
  display: grid;
  gap: 28px;
}

.hub-group {
  scroll-margin-top: 24px;
}

.hub-group h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.group-icon {
  width: 28px;
  height: 28px;
  padding: 6px;
  border: 1px solid rgba(56, 71, 254, 0.14);
  border-radius: 9px;
  background: rgba(56, 71, 254, 0.06);
}

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

@media (max-width: 1080px) {
  .tool-copy-grid,
  .tools-hub {
    grid-template-columns: 1fr;
  }

  .related-tools,
  .hub-grid,
  .hub-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-filter {
    position: static;
  }
}

@media (max-width: 720px) {
  .tools-shell {
    width: min(100% - 28px, 1160px);
  }

  .tools-page .nav {
    width: min(100% - 28px, 1160px);
    padding-left: 0;
    padding-right: 0;
  }

  .tool-page-head {
    grid-template-columns: 1fr;
    padding-top: 30px;
  }

  .tool-page-head h1 {
    font-size: 2.25rem;
  }

  .tf-body {
    min-height: 380px;
    padding: 34px 20px;
  }

  .tf-result {
    padding: 20px;
  }

  .metric-strip,
  .related-tools,
  .hub-grid,
  .hub-group-grid {
    grid-template-columns: 1fr;
  }

  .tf-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tf-actions .tool-button,
  .tf-actions .tool-button-secondary {
    width: 100%;
  }

  .locked-preview .tool-button,
  .result-actions .tool-button,
  .result-actions .tool-button-secondary,
  .tf-gate .tool-button {
    width: 100%;
  }
}
