/* TextBases Global Continue-with-Text Section V1
   Locked visual contract: compact workflow tiles matching the accepted Word Counter treatment. */

.tbv2-tool-workflow-section {
  padding: 14px 0 0;
}

.tbv2-tool-workflow-card,
.tbv2-word-counter-v2 .wc-workflow-card.tbv2-tool-workflow-card {
  padding: 12px 13px 13px;
  border: 1px solid #d9e4f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
}

.tbv2-tool-workflow-head,
.tbv2-word-counter-v2 .wc-card-head.tbv2-tool-workflow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.tbv2-tool-workflow-head h2,
.tbv2-tool-workflow-head h3,
.tbv2-word-counter-v2 .wc-card-head.tbv2-tool-workflow-head h2,
.tbv2-word-counter-v2 .wc-card-head.tbv2-tool-workflow-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 780;
  letter-spacing: -.02em;
}

.tbv2-tool-workflow-head p,
.tbv2-word-counter-v2 .wc-card-head.tbv2-tool-workflow-head p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.tbv2-tool-workflow-grid,
.tbv2-word-counter-v2 .wc-workflow-grid.tbv2-tool-workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.tbv2-tool-workflow-link,
.tbv2-word-counter-v2 .wc-workflow-link.tbv2-tool-workflow-link {
  --tbv2-workflow-icon: none;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #dfe7f2;
  border-radius: 11px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.tbv2-tool-workflow-link::before,
.tbv2-word-counter-v2 .wc-workflow-link.tbv2-tool-workflow-link::before {
  content: '';
  display: block;
  width: 28px;
  height: 28px;
  border: 1px solid #e2dcfb;
  border-radius: 8px;
  background-color: #f5f3ff;
  background-image: var(--tbv2-workflow-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 17px 17px;
}

.tbv2-tool-workflow-link:hover,
.tbv2-word-counter-v2 .wc-workflow-link.tbv2-tool-workflow-link:hover {
  transform: translateY(-1px);
  border-color: #c9bdf6;
  background: #fdfcff;
  box-shadow: 0 5px 14px rgba(74, 47, 140, .06);
}

.tbv2-tool-workflow-link strong,
.tbv2-word-counter-v2 .wc-workflow-link.tbv2-tool-workflow-link strong {
  min-width: 0;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 760;
  white-space: normal;
}

.tbv2-tool-workflow-link span,
.tbv2-tool-workflow-link em,
.tbv2-word-counter-v2 .wc-workflow-link.tbv2-tool-workflow-link span,
.tbv2-word-counter-v2 .wc-workflow-link.tbv2-tool-workflow-link em {
  display: none;
}

.tbv2-tool-workflow-link[data-handoff="character-counter"] { --tbv2-workflow-icon: url('../icons/tools/character-counter.svg'); }
.tbv2-tool-workflow-link[data-handoff="word-frequency-counter"] { --tbv2-workflow-icon: url('../icons/tools/word-frequency-counter.svg'); }
.tbv2-tool-workflow-link[data-handoff="sentence-counter"] { --tbv2-workflow-icon: url('../icons/tools/sentence-counter.svg'); }
.tbv2-tool-workflow-link[data-handoff="reading-time-calculator"] { --tbv2-workflow-icon: url('../icons/tools/reading-time-calculator.svg'); }
.tbv2-tool-workflow-link[data-handoff="case-converter"] { --tbv2-workflow-icon: url('../icons/tools/case-converter.svg'); }
.tbv2-tool-workflow-link[data-handoff="find-and-replace"] { --tbv2-workflow-icon: url('../icons/tools/find-and-replace.svg'); }
.tbv2-tool-workflow-link[data-handoff="text-cleaner"] { --tbv2-workflow-icon: url('../icons/tools/text-cleaner.svg'); }
.tbv2-tool-workflow-link[data-handoff="remove-line-breaks"] { --tbv2-workflow-icon: url('../icons/tools/remove-line-breaks.svg'); }
.tbv2-tool-workflow-link[data-handoff="remove-empty-lines"] { --tbv2-workflow-icon: url('../icons/tools/remove-empty-lines.svg'); }
.tbv2-tool-workflow-link[data-handoff="sort-text"] { --tbv2-workflow-icon: url('../icons/tools/sort-text.svg'); }
.tbv2-tool-workflow-link[data-handoff="text-to-list"] { --tbv2-workflow-icon: url('../icons/tools/text-to-list.svg'); }

@media (max-width: 900px) {
  .tbv2-tool-workflow-grid,
  .tbv2-word-counter-v2 .wc-workflow-grid.tbv2-tool-workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .tbv2-tool-workflow-grid,
  .tbv2-word-counter-v2 .wc-workflow-grid.tbv2-tool-workflow-grid {
    grid-template-columns: 1fr;
  }

  .tbv2-tool-workflow-head,
  .tbv2-word-counter-v2 .wc-card-head.tbv2-tool-workflow-head {
    flex-direction: column;
  }
}
