/* Fancy Text Generator. Builds on the shared .ffvt tokens in font-tools.css. */
.ffvx-tool {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 20px;
}

.ffvx-input-panel {
  background: #fff;
  border: 1px solid var(--ffvt-line);
  border-radius: var(--ffvt-radius);
  box-shadow: 0 10px 30px rgba(24, 24, 40, .06);
  padding: 18px;
  position: sticky;
  top: var(--ffvx-top, 8px);
  z-index: 5;
}

.admin-bar .ffvx-input-panel {
  top: calc(var(--ffvx-top, 8px) + 32px);
}

.ffvx-input-panel label {
  margin-bottom: 8px;
}

.ffvt .ffvx-input-panel textarea {
  font-size: 18px;
  line-height: 1.4;
  min-height: 76px;
}

.ffvx-input-meta {
  align-items: center;
  color: var(--ffvt-muted);
  display: flex;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  margin-top: 8px;
}

.ffvx-clear {
  background: none;
  border: 0;
  color: var(--ffvt-brand);
  cursor: pointer;
  font-weight: 700;
  min-height: 32px;
  padding: 4px 6px;
}

.ffvx-clear:hover {
  color: var(--ffvt-brand-dark);
  text-decoration: underline;
}

.ffvx-chips {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.ffvx-chip {
  background: var(--ffvt-soft);
  border: 1px solid var(--ffvt-line);
  border-radius: 999px;
  color: var(--ffvt-ink);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 14px;
  white-space: nowrap;
}

.ffvx-chip:hover {
  border-color: var(--ffvt-brand);
}

.ffvx-chip.is-active {
  background: var(--ffvt-brand);
  border-color: var(--ffvt-brand);
  color: #fff;
}

.ffvx-list {
  display: grid;
  gap: 10px;
  min-height: 640px;
}

.ffvx-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--ffvt-line);
  border-radius: 14px;
  display: grid;
  gap: 4px 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.ffvx-row:hover,
.ffvx-row:focus-within {
  border-color: var(--ffvt-brand);
  box-shadow: 0 6px 18px rgba(34, 49, 209, .08);
}

.ffvx-row.is-copied {
  border-color: var(--ffvt-good);
  box-shadow: 0 0 0 2px rgba(21, 115, 71, .15);
}

.ffvx-row-name {
  color: var(--ffvt-muted);
  font-size: 12px;
  font-weight: 700;
  grid-column: 1 / -1;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ffvx-row-output {
  background: none;
  border: 0;
  color: var(--ffvt-ink);
  cursor: copy;
  font-family: inherit;
  font-size: 22px;
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 2px 0;
  text-align: left;
  white-space: pre-wrap;
}

.ffvx-row[data-style^="glitch"] .ffvx-row-output {
  line-height: 2.2;
  overflow: hidden;
  padding: 10px 0;
}

.is-sample .ffvx-row-output {
  color: #55556a;
}

.ffvx-row-actions {
  display: flex;
  gap: 8px;
}

.ffvx-copy,
.ffvx-shuffle {
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  min-width: 78px;
  padding: 8px 14px;
}

.ffvx-copy {
  background: var(--ffvt-brand);
  border: 1px solid var(--ffvt-brand);
  color: #fff;
}

.ffvx-copy:hover {
  background: var(--ffvt-brand-dark);
}

.is-copied .ffvx-copy {
  background: var(--ffvt-good);
  border-color: var(--ffvt-good);
}

.ffvx-shuffle {
  background: #fff;
  border: 1px solid #c9cad5;
  color: var(--ffvt-ink);
}

.ffvx-shuffle:hover {
  border-color: var(--ffvt-brand);
  color: var(--ffvt-brand);
}

.ffvx-empty,
.ffvx-noscript {
  background: var(--ffvt-soft);
  border-radius: 14px;
  color: var(--ffvt-muted);
  padding: 18px;
}

.ffvx-copy-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 36px;
}

.ffvx-copy-grid > section {
  background: var(--ffvt-soft);
  border-radius: var(--ffvt-radius);
  padding: 24px;
}

.ffvx-copy-grid h2 {
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 0 0 12px;
}

.ffvx-copy-grid p,
.ffvx-copy-grid li {
  color: #3d3d4a;
  line-height: 1.65;
}

.ffvx-copy-grid ol,
.ffvx-copy-grid ul {
  margin: 0 0 0 1.2em;
  padding: 0;
}

.ffvx-copy-grid li + li {
  margin-top: 6px;
}

.ffvx-copy-grid p:last-child {
  margin-bottom: 0;
}

.ffvx-copy-grid a {
  color: var(--ffvt-brand);
  font-weight: 600;
}

.ffvx-wide {
  grid-column: 1 / -1;
}

.ffvx-style-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 14px 0 0 !important;
}

.ffvx-style-links li {
  margin: 0 !important;
}

.ffvx-style-links a {
  background: #fff;
  border: 1px solid var(--ffvt-line);
  border-radius: 999px;
  display: inline-block;
  font-size: 14px;
  padding: 8px 14px;
  text-decoration: none;
}

.ffvx-style-links a:hover {
  border-color: var(--ffvt-brand);
}

@media (max-width: 680px) {
  .ffvx-input-panel {
    border-radius: 16px;
    padding: 12px;
  }

  .ffvt .ffvx-input-panel textarea {
    font-size: 16px;
    min-height: 58px;
  }

  .ffvx-row-output {
    font-size: 19px;
  }

  .ffvx-copy,
  .ffvx-shuffle {
    min-width: 68px;
    padding: 8px 10px;
  }

  .ffvx-row[data-style^="glitch"] {
    grid-template-columns: 1fr;
  }

  .ffvx-copy-grid {
    grid-template-columns: 1fr;
  }

  .ffvx-copy-grid > section {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ffvx-row {
    transition: none;
  }
}
