/* Fancy Text Generator 1.3
   Light/dark palettes, six accent presets (data-theme) and an "auto" mode that adopts the site's own colours.
   Component selectors are generated with a double .ftg prefix so theme CSS cannot override them easily. */
.ftg {
  --a-l: #4338ca;
  --a-d: #a5a8ff;
  --ft-bg: #f4f5fa;
  --ft-surface: #ffffff;
  --ft-ink: #14172e;
  --ft-muted: #5f6684;
  --ft-line: #dde0ee;
  --ft-accent: var(--a-l);
  --ft-on-accent: #ffffff;
  --ft-heart: #e11d48;
  --ft-accent-soft: rgba(128, 128, 160, .14);
  --ft-shadow: 0 1px 2px rgba(20, 23, 46, .06), 0 4px 14px rgba(20, 23, 46, .05);
  --ft-size: 20px;
  --ft-pad: clamp(1rem, 4.5vw, 3rem);
  --ft-sticky-top: 0px;

  box-sizing: border-box;
  max-width: 100%;
  margin: 2em 0;
  padding: var(--ft-pad);
  color: var(--ft-ink);
  background: var(--ft-bg);
  border: 1px solid var(--ft-line);
  border-radius: 20px;
  font: 400 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-align: left;
}
.ftg:not(.is-ready) { min-height: 520px; }
.ftg[data-theme="auto"] { font-family: inherit; }
.ftg[data-padding="none"] { --ft-pad: 0px; }
.ftg[data-padding="compact"] { --ft-pad: clamp(.75rem, 2.5vw, 1.25rem); }
.ftg[data-padding="normal"] { --ft-pad: clamp(1rem, 3vw, 1.75rem); }
.ftg[data-padding="roomy"] { --ft-pad: clamp(1rem, 4.5vw, 3rem); }
.ftg[data-width="full"] {
  width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  border-radius: 0; border-left: 0; border-right: 0;
  padding-left: max(var(--ft-pad), clamp(1rem, 6vw, 5rem)); padding-right: max(var(--ft-pad), clamp(1rem, 6vw, 5rem));
}
.ftg[data-theme="emerald"] { --a-l: #047857; --a-d: #4ade80; }
.ftg[data-theme="rose"] { --a-l: #be123c; --a-d: #fda4af; }
.ftg[data-theme="ocean"] { --a-l: #0369a1; --a-d: #7dd3fc; }
.ftg[data-theme="amber"] { --a-l: #b45309; --a-d: #fcd34d; }
.ftg[data-theme="graphite"] { --a-l: #374151; --a-d: #d1d5db; }

@media (prefers-color-scheme: dark) {
  .ftg:not([data-mode="light"]):not([data-theme="auto"]) {
    --ft-bg: #0f1226; --ft-surface: #171b36; --ft-ink: #eceefb; --ft-muted: #9aa2c6; --ft-line: #2b3160;
    --ft-accent: var(--a-d); --ft-on-accent: #0c0f26; --ft-heart: #fb7185; --ft-shadow: none;
  }
}
.ftg[data-mode="dark"]:not([data-theme="auto"]) {
  --ft-bg: #0f1226; --ft-surface: #171b36; --ft-ink: #eceefb; --ft-muted: #9aa2c6; --ft-line: #2b3160;
  --ft-accent: var(--a-d); --ft-on-accent: #0c0f26; --ft-heart: #fb7185; --ft-shadow: none;
}
@supports (color: color-mix(in srgb, red, blue)) {
  .ftg { --ft-accent-soft: color-mix(in srgb, var(--ft-accent) 12%, var(--ft-surface)); }
}

/* ---- isolation from theme CSS ---- */
.ftg *,
.ftg *::before,
.ftg *::after { box-sizing: border-box; }
.ftg.ftg button,
.ftg.ftg textarea,
.ftg.ftg input:where(:not([type="checkbox"])) {
  all: unset; box-sizing: border-box; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent;
}
.ftg.ftg ul,
.ftg.ftg li { margin: 0; padding: 0; list-style: none; background: none; }
.ftg.ftg li::before,
.ftg.ftg li::after { content: none; }
.ftg.ftg p,
.ftg.ftg label,
.ftg.ftg output { margin: 0; padding: 0; text-transform: none; letter-spacing: normal; }

.ftg.ftg .ftg-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ftg.ftg .ftg-sentinel { display: block; height: 1px; margin-bottom: -1px; pointer-events: none; }

/* ---- composer (sticky while scrolling) ---- */
.ftg.ftg .ftg-compose {
  position: sticky; top: var(--ft-sticky-top, 0px); z-index: 30;
  margin: -.5rem 0 0; padding: .5rem 0;
  transition: box-shadow .15s;
}
.ftg.ftg .ftg-compose.is-stuck {
  background: var(--ft-bg);
  box-shadow: 0 12px 14px -12px rgba(0, 0, 0, .35);
}
.ftg.ftg .ftg-input {
  display: block; width: 100%; min-height: 3.3em; max-height: 8.5em; margin: 0; padding: .8em 1.05em;
  font-size: 18px; line-height: 1.4; color: var(--ft-ink); background: var(--ft-surface);
  border: 1.5px solid var(--ft-line); border-radius: 14px; resize: none; overflow: auto;
  box-shadow: var(--ft-shadow);
}
.ftg.ftg .ftg-input::placeholder { color: var(--ft-muted); opacity: .8; }
.ftg.ftg .ftg-input:focus { border-color: var(--ft-accent); box-shadow: 0 0 0 3px var(--ft-accent-soft), var(--ft-shadow); }

/* ---- font size control ---- */
.ftg.ftg .ftg-tools { display: flex; flex-wrap: wrap; gap: .7rem 1.4rem; align-items: center; margin: .6rem 0 0; }
.ftg.ftg .ftg-size { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: .45rem; max-width: 100%; }
.ftg.ftg .ftg-size-label { margin-right: .1rem; font-size: 13px; color: var(--ft-muted); }
.ftg.ftg .ftg-step,
.ftg.ftg .ftg-reset {
  display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 .55em;
  line-height: 1; color: var(--ft-ink); cursor: pointer; background: var(--ft-surface);
  border: 1px solid var(--ft-line); border-radius: 9px;
}
.ftg.ftg .ftg-step:hover,
.ftg.ftg .ftg-reset:hover { border-color: var(--ft-accent); color: var(--ft-accent); }
.ftg.ftg .ftg-step .ftg-a-s { font-size: 12px; font-weight: 600; }
.ftg.ftg .ftg-step .ftg-a-l { font-size: 19px; font-weight: 600; }
.ftg.ftg .ftg-range {
  -webkit-appearance: none; appearance: none; display: block; width: clamp(90px, 22vw, 150px); height: 28px; margin: 0 .1rem;
  background: transparent; cursor: pointer;
}
.ftg.ftg .ftg-range::-webkit-slider-runnable-track { height: 6px; background: var(--ft-line); border-radius: 99px; }
.ftg.ftg .ftg-range::-moz-range-track { height: 6px; background: var(--ft-line); border-radius: 99px; }
.ftg.ftg .ftg-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; background: var(--ft-accent);
  border: 3px solid var(--ft-surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--ft-line), 0 1px 3px rgba(0, 0, 0, .25);
}
.ftg.ftg .ftg-range::-moz-range-thumb {
  width: 16px; height: 16px; background: var(--ft-accent);
  border: 3px solid var(--ft-surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--ft-line), 0 1px 3px rgba(0, 0, 0, .25);
}
.ftg.ftg .ftg-size-val { min-width: 3.1em; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ft-muted); }
.ftg.ftg .ftg-check { display: block; margin: .8rem 0 0; font-size: 13px; font-weight: 400; color: var(--ft-muted); cursor: pointer; }
.ftg.ftg .ftg-check input { -webkit-appearance: checkbox !important; appearance: auto !important; width: 15px; height: 15px; margin: 0 .4rem 0 0; vertical-align: -2px; accent-color: var(--ft-accent); }

/* ---- categories ---- */
.ftg.ftg .ftg-tabs {
  display: flex; gap: .45rem; margin: .9rem 0 0; padding: .15rem 0 .55rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.ftg.ftg .ftg-tab {
  display: inline-flex; flex: 0 0 auto; gap: .45em; align-items: center; padding: .42em 1em; font-size: 14px; line-height: 1.3;
  color: var(--ft-ink); white-space: nowrap; cursor: pointer; background: var(--ft-surface);
  border: 1px solid var(--ft-line); border-radius: 999px;
}
.ftg.ftg .ftg-tab:hover { border-color: var(--ft-accent); }
.ftg.ftg .ftg-tab[aria-pressed="true"] { color: var(--ft-on-accent); background: var(--ft-accent); border-color: var(--ft-accent); font-weight: 600; }
.ftg.ftg .ftg-tab svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.ftg.ftg .ftg-badge {
  min-width: 1.6em; padding: .05em .5em; font-size: 12px; font-weight: 600; line-height: 1.5; text-align: center;
  color: var(--ft-accent); background: var(--ft-accent-soft); border-radius: 999px;
}
.ftg.ftg .ftg-tab[aria-pressed="true"] .ftg-badge { color: var(--ft-on-accent); background: rgba(255, 255, 255, .22); }
.ftg.ftg .ftg-badge[hidden] { display: none; }

.ftg.ftg .ftg-status { margin: .35rem 0 .8rem; font-size: 13px; color: var(--ft-muted); }
.ftg.ftg .ftg-status.is-empty {
  padding: 1.6rem 1rem; text-align: center; font-size: 14px;
  background: var(--ft-surface); border: 1px dashed var(--ft-line); border-radius: 14px;
}
.ftg.ftg .ftg-favbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .9rem; }
.ftg.ftg .ftg-favbar[hidden] { display: none; }
.ftg.ftg .ftg-ghost {
  display: inline-flex; align-items: center; padding: .45em 1em; font-size: 13px; color: var(--ft-ink); cursor: pointer;
  background: var(--ft-surface); border: 1px solid var(--ft-line); border-radius: 9px;
}
.ftg.ftg .ftg-ghost:hover { border-color: var(--ft-accent); color: var(--ft-accent); }

/* ---- results ---- */
.ftg.ftg .ftg-grid {
  display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(var(--ft-size) * 17)), 1fr));
}
.ftg.ftg .ftg-card {
  display: flex; align-items: stretch; margin: 0; padding: 0; overflow: hidden;
  background: var(--ft-surface); border: 1px solid var(--ft-line); border-radius: 14px;
  box-shadow: var(--ft-shadow); transition: border-color .15s, background-color .15s;
}
.ftg.ftg .ftg-card:hover { border-color: var(--ft-accent); }
.ftg.ftg .ftg-card.is-copied { background: var(--ft-accent-soft); border-color: var(--ft-accent); }
.ftg.ftg .ftg-card-mix { background: var(--ft-accent-soft); border-style: dashed; border-color: var(--ft-accent); }

.ftg.ftg .ftg-use {
  display: block; flex: 1 1 auto; min-width: 0; max-height: 7.5em; margin: 0; padding: 14px 16px; overflow: hidden;
  font-family: system-ui, "Segoe UI Symbol", "Noto Sans Math", "Noto Sans Symbols", "Noto Sans Symbols 2", "Apple Symbols", sans-serif;
  font-size: var(--ft-size); line-height: 1.4; color: var(--ft-ink); text-align: left;
  overflow-wrap: anywhere; text-wrap: balance; cursor: pointer; background: transparent;
}
.ftg.ftg .ftg-side {
  display: flex; flex: 0 0 96px; width: 96px; flex-direction: column; justify-content: center;
  gap: .4rem; padding: .5rem; border-left: 1px solid var(--ft-line);
}
.ftg.ftg .ftg-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: .42em .85em; font-size: 13px; font-weight: 600; line-height: 1.3;
  color: var(--ft-on-accent); white-space: nowrap; cursor: pointer; background: var(--ft-accent);
  border: 1px solid var(--ft-accent); border-radius: 8px;
}
.ftg.ftg .ftg-btn:hover { filter: brightness(1.08); }
.ftg.ftg .ftg-side .ftg-btn { width: 100%; padding-left: .4em; padding-right: .4em; }
.ftg.ftg .ftg-btn-alt { color: var(--ft-ink); background: var(--ft-surface); border-color: var(--ft-line); font-weight: 500; }
.ftg.ftg .ftg-btn-alt:hover { color: var(--ft-accent); border-color: var(--ft-accent); filter: none; }
.ftg.ftg .ftg-heart {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 32px; padding: 0;
  color: var(--ft-muted); cursor: pointer; background: var(--ft-surface);
  border: 1px solid var(--ft-line); border-radius: 8px;
}
.ftg.ftg .ftg-heart svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.ftg.ftg .ftg-heart:hover { color: var(--ft-heart); border-color: var(--ft-heart); }
.ftg.ftg .ftg-heart[aria-pressed="true"] { color: var(--ft-heart); border-color: var(--ft-heart); }
.ftg.ftg .ftg-heart[aria-pressed="true"] svg { fill: currentColor; }

.ftg.ftg .ftg-more {
  display: block; margin: 1.3rem auto 0; padding: .72em 2em; font-size: 15px; font-weight: 600; text-align: center;
  color: var(--ft-on-accent); cursor: pointer; background: var(--ft-accent); border-radius: 999px;
}
.ftg.ftg .ftg-more:hover { filter: brightness(1.08); }
.ftg.ftg .ftg-more[hidden] { display: none; }

.ftg.ftg .ftg-tab:focus-visible,
.ftg.ftg .ftg-btn:focus-visible,
.ftg.ftg .ftg-use:focus-visible,
.ftg.ftg .ftg-more:focus-visible,
.ftg.ftg .ftg-step:focus-visible,
.ftg.ftg .ftg-reset:focus-visible,
.ftg.ftg .ftg-heart:focus-visible,
.ftg.ftg .ftg-ghost:focus-visible,
.ftg.ftg .ftg-range:focus-visible {
  outline: 2px solid var(--ft-accent); outline-offset: 2px;
}

.ftg.ftg .ftg-toast {
  position: fixed; left: 50%; bottom: 1.5em; z-index: 99999; padding: .6em 1.3em;
  font-size: 14px; font-weight: 600; color: var(--ft-bg); pointer-events: none; background: var(--ft-ink);
  border-radius: 999px; opacity: 0; transform: translate(-50%, .6em); transition: opacity .15s, transform .15s;
}
.ftg.ftg .ftg-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* phones: text gets the full card width, actions sit in a row underneath */
@media (max-width: 520px) {
  .ftg { border-radius: 16px; }
  .ftg.ftg .ftg-card { flex-direction: column; }
  .ftg.ftg .ftg-use { padding: 12px 14px; }
  .ftg.ftg .ftg-side { flex: none; width: auto; flex-direction: row; padding: .4rem; border-left: 0; border-top: 1px solid var(--ft-line); }
  .ftg.ftg .ftg-side .ftg-btn { flex: 1 1 0; width: auto; }
  .ftg.ftg .ftg-side .ftg-heart { flex: 0 0 44px; width: 44px; }
  .ftg.ftg .ftg-size { display: flex; width: 100%; }
  .ftg.ftg .ftg-size-label { display: none; }
  .ftg.ftg .ftg-range { flex: 1 1 60px; width: auto; min-width: 60px; }
  .ftg.ftg .ftg-size-val { min-width: 2.7em; }
}
@media (max-width: 360px) {
  .ftg.ftg .ftg-size { gap: .3rem; }
  .ftg.ftg .ftg-range { min-width: 36px; }
  .ftg.ftg .ftg-size-val { min-width: 2.3em; }
  .ftg.ftg .ftg-step,
.ftg.ftg .ftg-reset { min-width: 40px; height: 40px; }
}
/* touch screens: comfortable tap targets */
@media (pointer: coarse) {
  .ftg.ftg .ftg-tab { min-height: 42px; padding: .5em 1.1em; }
  .ftg.ftg .ftg-step,
.ftg.ftg .ftg-reset { min-width: 44px; height: 44px; }
  .ftg.ftg .ftg-btn { min-height: 40px; }
  .ftg.ftg .ftg-heart { height: 40px; }
  .ftg.ftg .ftg-ghost { min-height: 42px; }
  .ftg.ftg .ftg-more { min-height: 48px; }
  .ftg.ftg .ftg-check { padding: .3rem 0; }
  .ftg.ftg .ftg-check input { width: 20px; height: 20px; }
}
@media (pointer: coarse) and (max-width: 360px) { .ftg.ftg .ftg-step,
.ftg.ftg .ftg-reset { min-width: 40px; height: 44px; } }
@media (prefers-reduced-motion: reduce) {
  .ftg.ftg .ftg-card,
.ftg.ftg .ftg-toast,
.ftg.ftg .ftg-compose { transition: none; }
}

/* ---- FAQ and link blocks (plain, inherit the theme's look) ---- */
.ftgx-faq { margin: 2rem 0; }
.ftgx-faq details { margin: 0 0 .6rem; background: rgba(128, 128, 128, .05); border: 1px solid rgba(128, 128, 128, .3); border-radius: 12px; }
.ftgx-faq summary { padding: .9em 1.1em; font-weight: 600; cursor: pointer; list-style: none; }
.ftgx-faq summary::-webkit-details-marker { display: none; }
.ftgx-faq summary::after { content: "+"; float: right; font-weight: 400; opacity: .7; }
.ftgx-faq details[open] summary::after { content: "\2013"; }
.ftgx-faq .ftgx-a { padding: 0 1.1em 1em; }
.ftgx-links { margin: 2rem 0; }
.ftgx-links ul { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.ftgx-links li { margin: 0; padding: 0; }
.ftgx-links a { display: inline-block; padding: .45em 1em; text-decoration: none; border: 1px solid rgba(128, 128, 128, .35); border-radius: 999px; }
.ftgx-links a:hover { border-color: currentColor; }
