:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #201d1a;
  --muted: #6a635c;
  --line: #ded4c6;
  --soft: #eee7dc;
  --accent: #c7354a;
  --accent-dark: #9b263d;
  --green: #1f6a56;
  --blue: #2f5c99;
  --shadow: 0 18px 50px rgba(48, 39, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 270px),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(47, 92, 153, 0.35);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid rgba(222, 212, 198, 0.86);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(18px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.sidebar-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sidebar-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(199, 53, 74, 0.07);
  color: var(--accent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-icon,
.app-icon,
.related-card span {
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 950;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--ink);
  color: #fff;
  font-size: 0.78rem;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-actions a,
.top-actions button,
.site-footer a,
.site-footer button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 9px 13px;
}

.top-actions a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(199, 53, 74, 0.06);
}

.workspace {
  display: block;
  width: auto;
  margin-left: 68px;
  padding: clamp(18px, 4vw, 42px);
}

.app-drawer,
.tool-panel,
.ad-slot,
.trust-card,
.related-card,
.faq-item,
.popular-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-drawer {
  position: fixed;
  left: 0;
  top: 76px;
  height: calc(100vh - 76px);
  z-index: 15;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  /* colapsado: strip de icones */
  width: 68px;
  padding: 14px 0;
}

.app-drawer[data-open] {
  width: 300px;
  padding: 22px;
  overflow-y: auto;
  cursor: default;
  box-shadow: 4px 0 28px rgba(32, 29, 26, 0.13);
}

/* Strip colapsado: oculta texto, centraliza icones */
.app-drawer:not([data-open]) .drawer-heading,
.app-drawer:not([data-open]) .search-label,
.app-drawer:not([data-open]) .search-input,
.app-drawer:not([data-open]) .category-tabs,
.app-drawer:not([data-open]) .popular-box {
  display: none;
}

.app-drawer:not([data-open]) .app-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.app-drawer:not([data-open]) .app-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  min-height: unset;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
}

.app-drawer:not([data-open]) .app-card > span:last-child {
  display: none;
}

.app-drawer:not([data-open]) .app-card.is-active {
  border-color: var(--accent);
}

.app-drawer:not([data-open]) .app-icon {
  width: 36px;
  height: 36px;
  font-size: 0.72rem;
}

.drawer-heading h2,
.hero h1,
.section-heading h2 {
  margin: 0;
  line-height: 0.98;
  letter-spacing: 0;
}

.drawer-heading h2 {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-label,
.download-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 850;
}

.search-label {
  margin-top: 24px;
}

.search-input,
.input-row input,
.stack-form input,
.stack-form select,
.text-grid textarea {
  width: 100%;
  min-width: 0;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 15px;
  outline: none;
}

.text-grid textarea {
  min-height: 260px;
  resize: vertical;
  font: 0.95rem/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  padding: 14px;
}

.search-input:focus,
.input-row input:focus,
.stack-form input:focus,
.stack-form select:focus,
.text-grid textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 92, 153, 0.12);
}

.category-tabs,
.mini-card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tabs {
  margin: 16px 0 20px;
}

.category-tabs span,
.mini-card-grid a {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  padding: 8px 11px;
}

.app-list {
  display: grid;
  gap: 10px;
}

.app-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  padding: 13px;
  text-align: left;
  text-decoration: none;
}

.app-card:hover,
.app-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(199, 53, 74, 0.1);
}

.app-icon {
  width: 44px;
  height: 44px;
  background: #ffe6e9;
  color: var(--accent-dark);
  font-size: 0.82rem;
}

.app-name,
.app-summary,
.app-state {
  display: block;
}

.app-name {
  font-weight: 900;
}

.app-summary {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}

.app-state {
  margin-top: 9px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.popular-box {
  margin-top: 18px;
  padding: 16px;
  box-shadow: none;
}

.popular-box h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.popular-box a {
  display: block;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 7px 0;
}

.tool-stage {
  min-width: 0;
}

.hero {
  margin-bottom: 20px;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(2.6rem, 7vw, 5.7rem);
}

.hero-copy,
.trust-line {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.17rem);
  font-weight: 650;
  line-height: 1.6;
}

.trust-line {
  color: var(--green);
  font-weight: 850;
}

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

.benefits article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  padding: 14px;
}

.benefits strong,
.benefits span {
  display: block;
}

.benefits span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.4;
}

.ad-slot {
  min-height: 92px;
  margin: 18px 0;
  overflow: hidden;
  box-shadow: none;
}

.ad-placeholder {
  display: grid;
  min-height: 92px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  background: repeating-linear-gradient(
      135deg,
      rgba(222, 212, 198, 0.34) 0,
      rgba(222, 212, 198, 0.34) 1px,
      transparent 1px,
      transparent 18px
    ),
    rgba(255, 255, 255, 0.52);
}

.ad-placeholder span {
  font-weight: 900;
}

.ad-placeholder small {
  display: block;
  margin-top: 4px;
  font-weight: 700;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 18px;
}

.tool-panel {
  padding: clamp(22px, 4vw, 38px);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-heading h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1.05;
}

.instagram-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0a733, #c7354a 48%, #4f62bd);
}

.instagram-mark span {
  width: 27px;
  height: 27px;
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 10px -10px 0 -8px #fff;
}

.tool-icon-badge {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 950;
  flex-shrink: 0;
}

.download-form {
  margin-top: 28px;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

#download-button,
.result-actions button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  padding: 0 22px;
}

#download-button:hover,
.result-actions button:hover {
  background: var(--accent-dark);
}

#download-button[disabled] {
  cursor: wait;
  opacity: 0.76;
}

.button-loading,
.is-loading .button-idle {
  display: none;
}

.is-loading .button-loading {
  display: inline;
}

.status {
  min-height: 26px;
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.status.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid rgba(31, 106, 86, 0.25);
  border-top-color: var(--green);
  border-radius: 999px;
  animation: spin 900ms linear infinite;
}

.status[data-state="error"] {
  color: var(--accent-dark);
}

.status[data-state="done"] {
  color: var(--green);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-panel {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 16px;
}

.result-empty {
  display: grid;
  gap: 5px;
  min-height: 110px;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.result-empty strong {
  color: var(--ink);
}

.result-content {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.result-content img {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.result-content h3 {
  margin: 0;
  font-size: 1.24rem;
}

.result-content p {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.45;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-actions button:not(:first-child) {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.internal-cta,
.trust-card {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.internal-cta h3,
.trust-card h3 {
  margin: 0 0 10px;
}

.inline-column {
  min-width: 0;
}

.inline-ad {
  margin-top: 0;
}

.trust-card {
  border-top: 0;
  padding: 16px;
  box-shadow: none;
}

.trust-card p {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.45;
}

.related-tools,
.faq {
  margin-top: 36px;
}

.section-heading {
  margin-bottom: 16px;
}

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

.related-card {
  display: grid;
  gap: 8px;
  min-height: 178px;
  padding: 16px;
}

.related-card:hover {
  border-color: var(--blue);
}

.related-card span {
  width: 42px;
  height: 42px;
  background: #e7eef9;
  color: var(--blue);
}

.related-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.45;
}

.muted-card span {
  background: var(--soft);
  color: var(--muted);
}

.faq {
  display: grid;
  gap: 10px;
}

.faq-item {
  box-shadow: none;
  padding: 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 900;
  padding: 16px;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.55;
  padding: 0 16px 16px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: auto;
  margin-left: 68px;
  padding: 28px clamp(18px, 4vw, 42px) 42px;
  color: var(--muted);
}

.site-footer p {
  margin: 6px 0 0;
  font-weight: 650;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.site-footer span {
  width: 100%;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: right;
}

.single-tool-page {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px);
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.panel-heading + .tool-tabs,
.panel-heading + .text-grid {
  margin-top: 22px;
}

.stack-form label,
.text-grid label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 850;
}

.form-grid,
.text-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.primary-action,
.tool-tabs button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  padding: 0 18px;
}

.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tool-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
}

.tool-tabs button.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.consent-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  width: min(640px, calc(100% - 36px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 18px 50px rgba(32, 29, 26, 0.2);
}

.consent-banner strong,
.consent-banner p {
  display: block;
}

.consent-banner p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.45;
}

.consent-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.consent-actions button {
  min-width: 92px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0 14px;
}

.consent-actions button[data-consent-action="accept"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

[hidden] {
  display: none !important;
}

html[data-variant="A"] .benefits {
  order: 2;
}

html[data-variant="B"] .benefits {
  margin-bottom: 8px;
}

html[data-variant="C"] .related-tools {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  padding: 18px;
}

@media (max-width: 980px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 700px) {
  .app-drawer {
    width: 0;
    padding: 0;
    border-right: 0;
  }

  .app-drawer[data-open] {
    width: 280px;
    padding: 22px;
    border-right: 1px solid var(--line);
  }

  .workspace,
  .site-footer {
    margin-left: 0;
  }

  .topbar,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-brand {
    width: 100%;
  }

  .top-actions,
  .site-footer nav {
    width: 100%;
  }

  .top-actions a,
  .top-actions button,
  .site-footer a,
  .site-footer button {
    flex: 1 1 auto;
    text-align: center;
  }

  .benefits,
  .related-grid,
  .result-content,
  .input-row,
  .form-grid,
  .text-grid {
    grid-template-columns: 1fr;
  }

  #download-button,
  .result-actions button {
    width: 100%;
  }

  .result-content img {
    width: 100%;
    max-height: 260px;
    aspect-ratio: 16 / 10;
  }

  .site-footer span {
    text-align: left;
  }

  .consent-banner {
    grid-template-columns: 1fr;
  }

  .consent-actions button {
    flex: 1;
  }
}
