/* =============================================================
   Social Toolkit — hoja de estilos única
   1. Tokens
   2. Reset & base
   3. Utilidades
   4. Tipografía
   5. Componentes: header, buscador, cards, botones, forms
   6. Tool card (dropzone, estados, resultado)
   7. Ad slots
   8. Secciones (home, categorías, faq, relacionadas, footer)
   9. Toasts
   10. Responsive
   11. Reduced motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --border: #e3e6ee;
  --text: #171923;
  --text-dim: #565c6d;
  --text-faint: #8a90a1;
  --accent: #5b5bf0;
  --accent-2: #ff5c8a;
  --accent-ink: #ffffff;
  --accent-soft: #edecff;
  --success: #16a34a;
  --success-soft: #e9f9ef;
  --danger: #e0393e;
  --danger-soft: #fdeaea;
  --warn: #b5790a;
  --warn-soft: #fff4e0;
  --shadow-sm: 0 1px 2px rgba(20, 20, 40, .06);
  --shadow-md: 0 6px 20px rgba(20, 20, 40, .08);
  --shadow-lg: 0 16px 40px rgba(20, 20, 40, .12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --gutter: 1.25rem;
  --max-w: 1180px;
  --header-h: 64px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.01em; font-weight: 700; }
ul, ol { padding-left: 1.15em; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
input, select, textarea { font: inherit; color: inherit; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--text); color: #fff;
  z-index: 9999; border-radius: 8px; font-weight: 600;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilidades
   ============================================================= */
.container { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.stack { display: flex; flex-direction: column; }
.main { flex: 1 0 auto; }
.badge {
  display: inline-flex; align-items: center; gap: .35em;
  font-size: .78rem; font-weight: 700; padding: .3em .7em;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  white-space: nowrap;
}
.badge--soon { background: var(--surface-2); color: var(--text-faint); }
.badge--new { background: var(--success-soft); color: var(--success); }
.badge--privacy { background: var(--success-soft); color: var(--success); }
.icon { width: 1em; height: 1em; flex: none; }

/* =============================================================
   4. Tipografía
   ============================================================= */
.eyebrow { font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.h1-page { font-size: clamp(1.7rem, 4.6vw, 2.5rem); max-width: 26ch; margin-inline: 0; }
.subtitle { color: var(--text-dim); font-size: clamp(1rem, 2vw, 1.15rem); max-width: 60ch; margin-top: .6rem; }
.section-title { font-size: clamp(1.35rem, 3vw, 1.8rem); margin-bottom: .3rem; }
.section-sub { color: var(--text-dim); margin-bottom: 1.5rem; max-width: 60ch; }
.prose { color: var(--text-dim); }
.prose p { margin-bottom: 1rem; }
.prose h2 { color: var(--text); font-size: 1.25rem; margin: 1.6rem 0 .6rem; }
.prose h3 { color: var(--text); font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
.prose ul { margin-bottom: 1rem; }
.prose li { margin-bottom: .35rem; }

/* =============================================================
   5. Componentes
   ============================================================= */

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247,248,251,.9);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--bg); }
}
.site-header__row {
  display: flex; align-items: center; gap: 1rem;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.08rem; flex: none; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 1rem;
}
.header-search { flex: 1 1 auto; max-width: 420px; display: none; }
.header-search__field {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: .5rem .9rem;
}
.header-search__field input {
  border: 0; background: none; flex: 1; min-width: 0; font-size: .92rem;
}
.header-search__field input:focus { outline: none; }
.header-nav { display: none; align-items: center; gap: 1.1rem; margin-left: auto; font-size: .92rem; font-weight: 600; }
.header-nav a { color: var(--text-dim); transition: color .15s var(--ease-out); }
.header-nav a:hover { color: var(--accent); }
.header-cta {
  margin-left: auto;
  font-size: .88rem; font-weight: 700; color: var(--accent);
}
@media (min-width: 720px) {
  .header-search { display: block; }
  .header-nav { display: flex; }
  .header-cta { display: none; }
}

/* --- Buscador grande (home) --- */
.hero-search {
  padding: clamp(2.2rem, 6vw, 4rem) 0 clamp(1.6rem, 4vw, 2.4rem);
  text-align: center;
}
.hero-search h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  max-width: 20ch; margin-inline: auto;
}
.hero-search__sub { color: var(--text-dim); margin: .8rem auto 0; max-width: 46ch; font-size: clamp(1rem, 2vw, 1.15rem); }
.big-search {
  margin: 1.8rem auto 0; max-width: 640px;
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 999px; padding: .55rem .6rem .55rem 1.2rem;
  box-shadow: var(--shadow-md);
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.big-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.big-search svg { flex: none; color: var(--text-faint); }
.big-search input {
  flex: 1; min-width: 0; border: 0; background: none;
  font-size: clamp(1rem, 2vw, 1.1rem); padding: .5rem 0;
}
.big-search input:focus { outline: none; }
.big-search__clear { display: none; font-size: 1.3rem; color: var(--text-faint); padding: .2rem .5rem; border-radius: 50%; }
.big-search.has-value .big-search__clear { display: block; }
.big-search__count { font-size: .82rem; color: var(--text-faint); margin-top: .7rem; min-height: 1.2em; }

/* --- Chips de categoría --- */
.chip-row {
  display: flex; gap: .55rem; overflow-x: auto; padding: 1.4rem 0 .2rem;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: 999px; background: var(--surface);
  border: 1.5px solid var(--border); font-weight: 600; font-size: .9rem;
  color: var(--text-dim); transition: all .15s var(--ease-out); cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--text); border-color: var(--text); color: #fff; }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 700; font-size: .95rem; border-radius: 12px;
  padding: .85rem 1.4rem; transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { box-shadow: var(--shadow-md); }
.btn--primary:disabled { background: var(--text-faint); cursor: not-allowed; box-shadow: none; }
.btn--big { padding: 1.05rem 1.8rem; font-size: 1.05rem; border-radius: 14px; width: 100%; }
.btn--ghost { background: var(--surface-2); color: var(--text); }
.btn--ghost:hover { background: var(--border); }
.btn--outline { background: none; border: 1.5px solid var(--border); color: var(--text); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: .55rem .9rem; font-size: .85rem; border-radius: 9px; }
.btn--danger-text { color: var(--danger); background: var(--danger-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; }

/* --- Cards de herramientas --- */
.tools-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.tool-card-link {
  display: flex; flex-direction: column; gap: .7rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.15rem;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), border-color .18s var(--ease-out);
  position: relative;
}
a.tool-card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.tool-card-link__icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.tool-card-link__title { font-weight: 700; font-size: .98rem; line-height: 1.3; }
.tool-card-link__desc { font-size: .85rem; color: var(--text-dim); flex: 1; }
.tool-card-link__cat { font-size: .74rem; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.tool-card-link.is-soon { opacity: .62; cursor: default; }
.tool-card-link.is-soon:hover { transform: none; box-shadow: none; border-color: var(--border); }
.tool-card-link .badge--soon { position: absolute; top: .9rem; right: .9rem; }

/* --- Formularios / opciones de herramienta --- */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-size: .85rem; font-weight: 700; color: var(--text); }
.field select, .field input[type="text"], .field input[type="number"], .field input[type="url"], .field textarea {
  border: 1.5px solid var(--border); border-radius: 10px; padding: .7rem .85rem;
  background: var(--surface); font-size: .95rem; width: 100%;
}
.field select:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field-row { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.range-row { display: flex; align-items: center; gap: .8rem; }
.range-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.range-row output { font-weight: 700; font-size: .88rem; min-width: 3.4em; text-align: right; }
.preset-select { position: relative; }
.checkbox-row { display: flex; align-items: center; gap: .55rem; font-size: .9rem; font-weight: 600; }
.checkbox-row input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }

/* =============================================================
   6. Tool card — el componente central
   ============================================================= */
.tool-page-head { padding: 1.6rem 0 .6rem; }
.breadcrumb { font-size: .8rem; color: var(--text-faint); margin-bottom: .8rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--accent); }

.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(1.1rem, 3vw, 1.8rem);
  box-shadow: var(--shadow-sm); margin-top: 1.2rem;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius-md);
  padding: clamp(1.6rem, 5vw, 3rem) 1.2rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
  cursor: pointer; transition: border-color .15s var(--ease-out), background .15s var(--ease-out);
  background: var(--surface-2);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone__icon { width: 52px; height: 52px; color: var(--accent); }
.dropzone__title { font-weight: 700; font-size: 1.05rem; }
.dropzone__hint { font-size: .85rem; color: var(--text-faint); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* Estados via data-state en .tool-card */
.tc-panel { display: none; }
.tool-card[data-state="idle"] .tc-panel--idle { display: block; }
.tool-card[data-state="loading-engine"] .tc-panel--loading { display: block; }
.tool-card[data-state="working"] .tc-panel--working { display: block; }
.tool-card[data-state="options"] .tc-panel--options { display: block; }
.tool-card[data-state="done"] .tc-panel--done { display: block; }
.tool-card[data-state="error"] .tc-panel--error { display: block; }

.tc-progress-wrap { text-align: center; padding: 2rem 1rem; }
.tc-progress-wrap p { margin-top: .9rem; font-weight: 600; font-size: .92rem; color: var(--text-dim); }
.tc-spinner {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto;
  border: 4px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tc-bar { width: 100%; max-width: 320px; margin: 1rem auto 0; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.tc-bar__fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width .2s var(--ease-out); }

.tc-error {
  text-align: center; padding: 1.6rem 1rem;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
}
.tc-error__icon { width: 40px; height: 40px; color: var(--danger); }
.tc-error__msg { font-weight: 700; color: var(--danger); }
.tc-error__hint { color: var(--text-dim); font-size: .88rem; max-width: 42ch; }

.tc-result {
  display: flex; flex-direction: column; gap: 1.1rem;
}
.tc-result__preview {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border-radius: var(--radius-md);
  padding: .8rem; max-height: 420px; overflow: auto;
}
.tc-result__preview img, .tc-result__preview video, .tc-result__preview canvas { max-height: 380px; border-radius: 8px; }
.tc-sizecompare {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  flex-wrap: wrap; font-size: .9rem; background: var(--surface-2);
  border-radius: var(--radius-md); padding: .9rem 1.1rem;
}
.tc-sizecompare b { font-size: 1.05rem; }
.tc-sizecompare .arrow { color: var(--text-faint); }
.tc-sizecompare .saved { color: var(--success); font-weight: 800; }
.tc-download-name { font-size: .82rem; color: var(--text-faint); text-align: center; }
.tc-reset-link { text-align: center; font-size: .88rem; font-weight: 700; color: var(--accent); }
.tc-reset-link:hover { text-decoration: underline; }

.tc-batch-list { display: flex; flex-direction: column; gap: .6rem; }
.tc-batch-item {
  display: flex; align-items: center; gap: .8rem;
  background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem;
}
.tc-batch-item__thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; background: var(--border); }
.tc-batch-item__name { font-size: .85rem; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-batch-item__bar { width: 70px; height: 5px; border-radius: 99px; background: var(--border); overflow: hidden; flex: none; }
.tc-batch-item__bar span { display: block; height: 100%; width: 0; background: var(--accent); }
.tc-batch-item__status { font-size: .78rem; color: var(--text-faint); flex: none; min-width: 3.5em; text-align: right; }

.privacy-badge {
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .84rem; color: var(--text-dim);
  background: var(--success-soft); border-radius: 10px; padding: .75rem .9rem;
  margin-top: 1rem;
}
.privacy-badge svg { flex: none; color: var(--success); margin-top: .1em; }
.tool-limit-note { font-size: .8rem; color: var(--text-faint); margin-top: .5rem; text-align: center; }

/* =============================================================
   7. Ad slots (placeholders)
   ============================================================= */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--border); border-radius: var(--radius-md);
  color: var(--text-faint); font-size: .78rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px);
  margin: 1.6rem 0;
}
.ad-slot--leaderboard { min-height: 90px; }
.ad-slot--incontent { min-height: 100px; }
.ad-slot--footer { min-height: 90px; }
.ad-slot--sidebar { min-height: 250px; display: none; }
.ad-corner {
  position: fixed; bottom: 1rem; right: 1rem; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  border-radius: 12px; padding: .8rem 1rem; font-size: .78rem; color: var(--text-faint);
  display: none; align-items: center; gap: .6rem; max-width: 220px;
}
.ad-corner.is-visible { display: flex; }
.ad-corner__close { font-size: 1rem; color: var(--text-faint); padding: .1rem .3rem; }
.ad-dialog { border: 0; border-radius: var(--radius-lg); padding: 0; max-width: 420px; width: calc(100% - 2rem); box-shadow: var(--shadow-lg); }
.ad-dialog::backdrop { background: rgba(15,15,25,.55); }
.ad-dialog__inner { padding: 1.3rem; }
.ad-dialog__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.ad-dialog__close { font-size: 1.3rem; color: var(--text-faint); padding: .2rem .5rem; border-radius: 8px; }
.ad-dialog__close:hover { background: var(--surface-2); }

@media (min-width: 1280px) {
  .with-sidebar { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 2rem; align-items: start; }
  .ad-slot--sidebar { display: flex; position: sticky; top: calc(var(--header-h) + 1rem); }
}

/* =============================================================
   8. Secciones
   ============================================================= */
.section { padding: clamp(2rem, 5vw, 3.2rem) 0; }
.section--tight { padding-top: .5rem; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.section-head .btn { flex: none; }

.category-block { margin-bottom: 2.4rem; }
.category-block__title { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; margin-bottom: .9rem; }
.category-block__title .icon-chip {
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}

.faq-list { display: flex; flex-direction: column; gap: .6rem; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.faq-item summary {
  cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; font-size: .95rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--text-faint); flex: none; transition: transform .18s var(--ease-out); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item__a { padding: 0 1.2rem 1.1rem; color: var(--text-dim); font-size: .9rem; }

.steps-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.2rem; }
.step-card__num {
  width: 34px; height: 34px; border-radius: 10px; background: var(--text); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: .8rem;
}
.step-card__title { font-weight: 700; margin-bottom: .3rem; font-size: .96rem; }
.step-card__desc { font-size: .86rem; color: var(--text-dim); }

.related-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 3rem; padding: 2.4rem 0 1.6rem; }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: 1fr; margin-bottom: 1.6rem; }
.site-footer__brand { max-width: 34ch; }
.site-footer__brand p { color: var(--text-dim); font-size: .88rem; margin-top: .6rem; }
.site-footer__cols { display: grid; gap: 1.6rem; grid-template-columns: repeat(2, 1fr); }
.site-footer__col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: .7rem; }
.site-footer__col a { display: block; font-size: .88rem; color: var(--text-dim); padding: .28rem 0; }
.site-footer__col a:hover { color: var(--accent); }
.site-footer__bottom { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 1.4rem; font-size: .8rem; color: var(--text-faint); }
.site-footer__legal { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer__credits { font-size: .74rem; color: var(--text-faint); margin-top: .8rem; }

@media (min-width: 720px) {
  .site-footer__grid { grid-template-columns: 1.2fr 2fr; }
  .site-footer__cols { grid-template-columns: repeat(4, 1fr); }
}

/* =============================================================
   9. Toasts
   ============================================================= */
.toast-region { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: .5rem; width: calc(100% - 2rem); max-width: 380px; pointer-events: none; }
.toast {
  background: var(--text); color: #fff; padding: .8rem 1.1rem; border-radius: 12px;
  font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: .6rem;
  opacity: 0; transform: translateY(10px); transition: all .25s var(--ease-out);
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast--success { background: #16a34a; }
.toast--error { background: var(--danger); }

/* =============================================================
   10. Responsive base helpers
   ============================================================= */
@media (min-width: 540px) { .tools-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
@media (min-width: 960px) { .container { padding-inline: 1.6rem; } }

/* =============================================================
   11. Reduced motion — solo lo intrusivo
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .tc-spinner { animation-duration: 1.6s; }
}

/* Home category nav pills active state helper */
[data-tool-item][hidden] { display: none !important; }

/* Crop stage (resizer / profile picture) */
.crop-stage {
  position: relative; width: 100%; max-width: 360px; margin: 0 auto;
  aspect-ratio: 1 / 1; overflow: hidden; border-radius: 12px;
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 20px 20px;
  touch-action: none; cursor: grab; border: 1.5px solid var(--border);
}
.crop-stage:active { cursor: grabbing; }
.crop-stage--circle { border-radius: 50%; }
.crop-stage img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; pointer-events: none; will-change: transform; }
.crop-stage__frame { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(91,91,240,.5); border-radius: inherit; }

/* Video preview box */
[data-video-preview] video { width: 100%; border-radius: 10px; background: #000; }
[data-result-preview] video { width: 100%; max-width: 420px; border-radius: 10px; }
[data-result-preview] audio { width: 100%; max-width: 420px; }
[data-result-preview] img { max-width: 100%; border-radius: 10px; }

/* Fancy-text tool textarea */
.output-box {
  width: 100%; min-height: 110px; border: 1.5px solid var(--border); border-radius: 10px;
  padding: .8rem; font-size: .95rem; resize: vertical; background: var(--surface-2);
}
.copy-row { display: flex; justify-content: flex-end; margin-top: .5rem; }
.hashtag-output { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.hashtag-pill { background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 600; padding: .35rem .7rem; border-radius: 999px; }
