/* =============================================================================
   AllConvert — Design Layer
   Estilo coherente con hectorcito.com (tema nexus): verde #2dae43, light premium,
   radios 18px, sombras suaves, easing cubic-bezier(.2,.7,.2,1).
   ============================================================================= */

:root, [data-theme="light"] {
  --primary: #2dae43;
  --primary-2: #4cc863;
  --primary-dark: #1f8a32;
  --accent: #f4a261;
  --ink: #0b1220;
  --ink-soft: #1f2937;
  --muted: #6b7280;
  --line: rgba(11, 18, 32, .08);
  --line-strong: rgba(11, 18, 32, .14);
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-2: #fbfcf9;
  --danger: #ef4444;

  --radius-card: 22px;
  --radius-pill: 999px;
  --radius-sm: 10px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-fast: 180ms;
  --dur: 280ms;
  --dur-slow: 520ms;

  --shadow-xs: 0 1px 2px rgba(11,18,32,.04);
  --shadow-sm: 0 4px 14px rgba(11,18,32,.06);
  --shadow-md: 0 18px 40px -14px rgba(11,18,32,.18);
  --shadow-lg: 0 30px 70px -20px rgba(31,138,50,.25), 0 8px 24px -8px rgba(11,18,32,.12);
  --glow: 0 0 0 6px rgba(45,174,67,.12);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  font-size: 16px;
  overflow-x: hidden;
}

::selection { background: rgba(76,200,99,.28); color: var(--primary-dark); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =============================================================================
   Mesh background (WOW factor)
   ============================================================================= */
.mesh {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(76,200,99,.18), transparent 60%),
    var(--bg);
}
.mesh > div {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55;
  animation: drift 22s var(--ease) infinite alternate;
}
.mesh__a { width: 520px; height: 520px; top: -160px; left: -120px; background: rgba(45,174,67,.35); }
.mesh__b { width: 460px; height: 460px; top: 30%; right: -160px; background: rgba(244,162,97,.28); animation-delay: -7s; }
.mesh__c { width: 380px; height: 380px; bottom: -120px; left: 30%; background: rgba(76,200,99,.30); animation-delay: -14s; }

@keyframes drift {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(40px,30px) scale(1.08); }
  100% { transform: translate(-30px,40px) scale(.95); }
}

/* Noise overlay for premium feel */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: .5; mix-blend-mode: multiply;
}

/* =============================================================================
   Header
   ============================================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 40px);
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: inline-flex; align-items: center; gap: 12px; }
.nav__dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 0 4px rgba(45,174,67,.15);
  position: relative;
}
.nav__dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1px solid rgba(45,174,67,.35);
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.8); opacity: 1 } 100% { transform: scale(2); opacity: 0 } }

.nav__brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.nav__brand-text strong { font-family: var(--font-display); font-size: 17px; letter-spacing: -.01em; }
.nav__brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.nav__pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: var(--radius-pill);
  font-size: 12px; color: var(--ink-soft); font-weight: 500;
  box-shadow: var(--shadow-xs);
}
.nav__pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 0 0 rgba(45,174,67,.6);
  animation: pulse 1.8s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(45,174,67,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(45,174,67,0); }
  100% { box-shadow: 0 0 0 0 rgba(45,174,67,0); }
}

/* =============================================================================
   Hero
   ============================================================================= */
.hero {
  text-align: center; padding: clamp(48px, 9vw, 96px) 20px clamp(28px, 5vw, 56px);
  max-width: 820px; margin: 0 auto;
}
.hero__tag {
  display: inline-block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--primary-dark); font-weight: 600;
  background: rgba(76,200,99,.12); border: 1px solid rgba(45,174,67,.2);
  padding: 6px 14px; border-radius: var(--radius-pill);
  margin-bottom: 22px;
  animation: rise .8s var(--ease) both;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6.2vw, 4.6rem);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.02;
  margin: 0 0 18px;
  color: var(--ink);
  animation: rise .9s var(--ease) .1s both;
}
.hero__title em {
  font-style: normal; position: relative; display: inline-block;
  background: linear-gradient(120deg, var(--primary) 0%, var(--primary-2) 50%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__title em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .04em; height: .14em;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: .25; border-radius: 999px;
  transform: scaleX(0); transform-origin: left;
  animation: underline 1.2s var(--ease) .8s forwards;
}
@keyframes underline { to { transform: scaleX(1); } }
.hero__sub {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--muted); max-width: 560px; margin: 0 auto;
  animation: rise 1s var(--ease) .2s both;
}
.hero__sub strong { color: var(--ink-soft); font-weight: 600; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================================================
   Main app card
   ============================================================================= */
.app {
  max-width: 820px; margin: 0 auto; padding: 0 20px 80px;
  animation: rise 1.1s var(--ease) .25s both;
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .row { grid-template-columns: 1fr; } }

.settings {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 18px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
}
.field { display: block; }
.field__label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--muted); margin-bottom: 6px; letter-spacing: .04em; text-transform: uppercase;
}
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none; -webkit-appearance: none;
  width: 100%; padding: 12px 40px 12px 14px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.select-wrap select:hover { border-color: var(--line-strong); }
.select-wrap select:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow); }
.select-wrap__caret {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}

/* =============================================================================
   Stage (drop + viz + preview)
   ============================================================================= */
.stage {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 18px;
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
  position: relative; overflow: hidden;
}

.drop {
  position: relative; border: 2px dashed var(--line-strong);
  border-radius: var(--radius-card); padding: 44px 24px;
  text-align: center; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
  background: var(--surface-2);
  outline: none;
}
.drop:hover, .drop:focus-visible { border-color: var(--primary); background: rgba(76,200,99,.04); transform: translateY(-1px); }
.drop.is-hover {
  border-color: var(--primary); background: rgba(76,200,99,.08);
  box-shadow: var(--glow);
}
.drop__inner { pointer-events: none; }
.drop__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(45,174,67,.12), rgba(76,200,99,.18));
  color: var(--primary-dark); margin-bottom: 14px;
  transition: transform var(--dur) var(--ease);
}
.drop:hover .drop__icon { transform: translateY(-3px); }
.drop__icon svg { width: 26px; height: 26px; }
.drop__title { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); }
.drop__sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.drop__sub u { color: var(--primary-dark); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* Live visualizer */
.viz {
  display: none; align-items: center; gap: 14px;
  padding: 16px; background: var(--ink); color: #fff;
  border-radius: var(--radius-card); position: relative; overflow: hidden;
}
.viz.is-on { display: flex; animation: rise .4s var(--ease); }
.viz canvas { flex: 1; height: 72px; display: block; }
.viz__label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  background: rgba(255,255,255,.08); padding: 6px 12px; border-radius: var(--radius-pill);
  white-space: nowrap;
}
.viz__dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; animation: pulse 1s infinite; }

/* Loaded file preview */
.preview {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 14px 16px;
  animation: rise .4s var(--ease);
}
.preview__icon {
  width: 44px; height: 44px; flex: none;
  background: linear-gradient(135deg, rgba(45,174,67,.12), rgba(76,200,99,.18));
  border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary-dark);
}
.preview__icon svg { width: 22px; height: 22px; }
.preview__info { flex: 1; min-width: 0; }
.preview__name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.preview audio {
  flex: 1; height: 36px; min-width: 140px;
  filter: hue-rotate(85deg) saturate(.9);
}
@media (max-width: 600px) {
  .preview { flex-wrap: wrap; }
  .preview audio { order: 5; flex-basis: 100%; }
}

.iconbtn {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  transition: all var(--dur-fast) var(--ease);
}
.iconbtn:hover { color: var(--danger); border-color: var(--danger); background: rgba(239,68,68,.06); }
.iconbtn svg { width: 16px; height: 16px; }

/* =============================================================================
   Actions
   ============================================================================= */
.actions {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

.btn--ghost { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.btn--ghost:hover:not(:disabled) {
  border-color: var(--primary); color: var(--primary-dark); transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn--ghost.is-recording {
  border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,.06);
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: transparent;
  box-shadow: 0 12px 26px -10px rgba(31,138,50,.55), inset 0 1px 0 rgba(255,255,255,.18);
  flex: 1; min-width: 180px;
}
.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -12px rgba(31,138,50,.65), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn--primary:active:not(:disabled) { transform: translateY(0); }
.btn__glow {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120px 60px at var(--mx,50%) var(--my,50%), rgba(255,255,255,.35), transparent 60%);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.btn--primary:hover .btn__glow { opacity: 1; }

.btn--soft {
  background: var(--surface); border-color: var(--line);
  color: var(--ink-soft); padding: 10px 16px; font-size: 13px;
}
.btn--soft:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn--soft.btn--danger:hover { border-color: var(--danger); color: var(--danger); }

/* =============================================================================
   Progress
   ============================================================================= */
.progress {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 18px;
  box-shadow: var(--shadow-xs); margin-bottom: 18px;
  animation: rise .4s var(--ease);
}
.progress__ring {
  position: relative; width: 64px; height: 64px; flex: none;
}
.progress__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress__track {
  fill: none; stroke: var(--line-strong); stroke-width: 6;
}
.progress__fill {
  fill: none; stroke: url(#grad); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 175.93; stroke-dashoffset: 175.93;
  transition: stroke-dashoffset .3s var(--ease);
  stroke: var(--primary);
}
.progress__ring span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--primary-dark);
}
.progress__text {
  font-size: 14px; color: var(--ink-soft); font-weight: 500;
}
.progress__text small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 2px; }

/* =============================================================================
   Output
   ============================================================================= */
.output {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 22px;
  box-shadow: var(--shadow-md);
  animation: rise .5s var(--ease);
}
.output__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.output__title {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  color: var(--ink);
}
.output__title svg { width: 18px; height: 18px; color: var(--primary); }
.output__stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: var(--radius-pill); color: var(--ink-soft);
}
.stat--accent { background: rgba(76,200,99,.12); border-color: rgba(45,174,67,.2); color: var(--primary-dark); }

textarea#text {
  width: 100%; min-height: 220px;
  font-family: var(--font-body); font-size: 15px; line-height: 1.7;
  color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; resize: vertical;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
textarea#text:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow); }

.output__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* =============================================================================
   Toast
   ============================================================================= */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 24px);
  background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 100; max-width: calc(100vw - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }
.toast.is-success { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }

/* =============================================================================
   Footer
   ============================================================================= */
.foot {
  text-align: center; padding: 30px 20px 60px;
  color: var(--muted); font-size: 13px;
}
.foot a { color: var(--primary-dark); font-weight: 500; }
.foot a:hover { text-decoration: underline; }
.foot__heart { color: var(--danger); }
.foot__small { font-size: 11px; margin-top: 4px; opacity: .8; }
.foot__brand {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
  padding: 4px 12px 4px 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-soft); text-transform: uppercase;
  box-shadow: var(--shadow-xs);
  transition: all var(--dur-fast) var(--ease);
}
.foot__brand img {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover; flex: none;
  background: var(--surface-2);
}
.foot__brand:hover {
  border-color: var(--primary); color: var(--primary-dark);
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}

/* =============================================================================
   Typewriter cursor
   ============================================================================= */
textarea#text.is-streaming { caret-color: var(--primary); }

/* =============================================================================
   Nav back link
   ============================================================================= */
.nav__right { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface);
  transition: all var(--dur-fast) var(--ease);
}
.nav__back:hover { border-color: var(--primary); color: var(--primary-dark); transform: translateX(-2px); }
.nav__back svg { width: 14px; height: 14px; }

/* =============================================================================
   Hero search
   ============================================================================= */
.hero__search {
  margin: 28px auto 0; max-width: 480px; position: relative;
  animation: rise 1s var(--ease) .3s both;
}
.hero__search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.hero__search input {
  width: 100%; padding: 14px 18px 14px 46px;
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur) var(--ease);
}
.hero__search input:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow); transform: translateY(-1px); }

/* =============================================================================
   Hub (home grid)
   ============================================================================= */
.hub { max-width: 1100px; margin: 0 auto; padding: 0 20px 80px; }
.hub__cat { margin-bottom: 36px; animation: rise .8s var(--ease) both; }
.hub__cat-title {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px;
  display: flex; align-items: center; gap: 12px;
}
.hub__cat-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.tile {
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  padding: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  cursor: pointer; overflow: hidden;
}
.tile::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(76,200,99,.06), transparent 60%);
  opacity: 0; transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(45,174,67,.3);
}
.tile:hover::before { opacity: 1; }
.tile:hover .tile__arrow { transform: translateX(4px); color: var(--primary-dark); }
.tile:hover .tile__icon { transform: rotate(-4deg) scale(1.05); color: var(--primary-dark); }

.tile__icon {
  flex: none; width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(45,174,67,.10), rgba(76,200,99,.18));
  color: var(--primary-dark);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tile__icon svg { width: 24px; height: 24px; }
.tile__body { flex: 1; min-width: 0; }
.tile__title {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  color: var(--ink); display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 4px; line-height: 1.2;
}
.tile__badge {
  font-family: var(--font-body); font-size: 10px; font-weight: 700; letter-spacing: .08em;
  background: linear-gradient(135deg, var(--accent), #e76f51);
  color: #fff; padding: 2px 7px; border-radius: var(--radius-pill);
}
.tile__desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.tile__arrow {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
  opacity: .6;
}

/* =============================================================================
   Single view layout
   ============================================================================= */
.view { max-width: 820px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) 20px 80px; animation: rise .6s var(--ease) both; }
.view__head { display: flex; gap: 16px; align-items: center; margin-bottom: 28px; }
.view__icon {
  width: 52px; height: 52px; border-radius: 16px; flex: none;
  background: linear-gradient(135deg, rgba(45,174,67,.12), rgba(76,200,99,.22));
  color: var(--primary-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.view__icon svg { width: 26px; height: 26px; }
.view__title { font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; line-height: 1.1; }
.view__sub { color: var(--muted); margin: 0; font-size: 15px; }

/* Generic card used in views */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 20px;
  box-shadow: var(--shadow-xs); margin-bottom: 16px;
}
.card--error { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.25); color: var(--danger); }
.card h3 { font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }

textarea.field-area {
  width: 100%; min-height: 140px; resize: vertical;
  font-family: var(--font-body); font-size: 14px; line-height: 1.6;
  padding: 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
textarea.field-area:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow); }
textarea.field-area.is-mono { font-family: 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; }

input.field-input, select.field-input {
  width: 100%; padding: 11px 14px;
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
input.field-input:focus, select.field-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow); }

.range { width: 100%; accent-color: var(--primary); }
.kv { display: flex; gap: 8px; flex-wrap: wrap; }
.kv .stat { cursor: default; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  transition: all var(--dur-fast) var(--ease);
}
.tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab:not(.is-active):hover { border-color: var(--primary); color: var(--primary-dark); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .pair { grid-template-columns: 1fr; } }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 10px; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 3/4; cursor: pointer; transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.thumb:hover { transform: scale(1.02); border-color: var(--primary); }
.thumb img, .thumb canvas { width: 100%; height: 100%; object-fit: contain; }
.thumb__label { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px 8px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: 11px; font-weight: 600; }

.image-stage { position: relative; background: repeating-conic-gradient(#f2f4ee 0% 25%, #e8ecdf 0% 50%) 50% / 20px 20px; border-radius: 14px; overflow: hidden; min-height: 220px; display: flex; align-items: center; justify-content: center; padding: 12px; }
.image-stage img { max-width: 100%; max-height: 480px; display: block; }

/* =============================================================================
   Confetti pop (success)
   ============================================================================= */
.confetti {
  position: fixed; pointer-events: none; z-index: 200;
  width: 8px; height: 12px; opacity: 0;
}
.confetti.is-on { animation: confetti 1.2s var(--ease) forwards; }
@keyframes confetti {
  0%   { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(220px) rotate(720deg); }
}

/* =============================================================================
   DARK MODE
   ============================================================================= */
[data-theme="dark"] {
  --primary: #4cc863;
  --primary-2: #6fde85;
  --primary-dark: #2dae43;
  --accent: #f4a261;
  --ink: #e8ecf1;
  --ink-soft: #d1d5db;
  --muted: #9ca3af;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --bg: #0b1220;
  --surface: #161a22;
  --surface-2: #1c212c;
  --danger: #f87171;
}
[data-theme="dark"] body::before { opacity: .3; mix-blend-mode: screen; }
[data-theme="dark"] .mesh__a { background: rgba(45,174,67,.20); }
[data-theme="dark"] .mesh__b { background: rgba(244,162,97,.16); }
[data-theme="dark"] .mesh__c { background: rgba(76,200,99,.18); }
[data-theme="dark"] .nav { background: rgba(11, 18, 32, .72); }
[data-theme="dark"] .nav__pill { background: var(--surface); }
[data-theme="dark"] .toast { background: var(--surface); border: 1px solid var(--line); }
[data-theme="dark"] .image-stage { background: repeating-conic-gradient(#1c212c 0% 25%, #161a22 0% 50%) 50% / 20px 20px; }
[data-theme="dark"] textarea, [data-theme="dark"] input, [data-theme="dark"] select { color-scheme: dark; }
[data-theme="dark"] .md-preview pre, [data-theme="dark"] .md-preview code { background: #0a0e16; }

/* =============================================================================
   NAV BUTTONS (theme, cmdk, install, share, fav)
   ============================================================================= */
.nav__icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); padding: 8px 12px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.nav__icon-btn:hover { border-color: var(--primary); color: var(--primary-dark); transform: translateY(-1px); }
.nav__icon-btn svg { width: 16px; height: 16px; }
.nav__icon-btn.is-on { color: var(--accent); border-color: var(--accent); }
.nav__kbd {
  font-family: 'SFMono-Regular', monospace; font-size: 11px;
  color: var(--muted); padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px;
}
.install-btn { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-color: transparent; }
.install-btn svg { color: #fff; }
.install-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* =============================================================================
   COMMAND PALETTE (Cmd+K)
   ============================================================================= */
.cmdk[hidden], .drag-overlay[hidden], #skeleton[hidden] { display: none !important; }
.cmdk {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
  animation: cmdkIn var(--dur) var(--ease);
}
@keyframes cmdkIn { from { opacity: 0; } to { opacity: 1; } }
.cmdk__backdrop {
  position: absolute; inset: 0;
  background: rgba(11, 18, 32, .55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.cmdk__panel {
  position: relative; width: 100%; max-width: 640px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 30px 80px -10px rgba(0,0,0,.4);
  overflow: hidden; animation: cmdkPanelIn .3s var(--ease);
}
@keyframes cmdkPanelIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cmdk__input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.cmdk__input-wrap svg { width: 18px; height: 18px; color: var(--muted); }
.cmdk__input-wrap input {
  flex: 1; border: 0; background: transparent; font-size: 15px;
  color: var(--ink); outline: none; font-family: inherit;
}
.cmdk__esc {
  font-family: 'SFMono-Regular', monospace; font-size: 11px;
  color: var(--muted); padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px;
}
.cmdk__results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  text-decoration: none; color: var(--ink);
  transition: background var(--dur-fast) var(--ease);
}
.cmdk__item.is-active, .cmdk__item:hover { background: var(--surface-2); }
.cmdk__icon {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: linear-gradient(135deg, rgba(45,174,67,.12), rgba(76,200,99,.18));
  color: var(--primary-dark); display: inline-flex; align-items: center; justify-content: center;
}
.cmdk__icon svg { width: 18px; height: 18px; }
.cmdk__title { font-weight: 600; font-size: 14px; }
.cmdk__desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cmdk__hints {
  display: flex; gap: 14px; padding: 10px 16px;
  border-top: 1px solid var(--line); background: var(--surface-2);
  font-size: 11px; color: var(--muted); flex-wrap: wrap;
}
.cmdk__hints kbd {
  font-family: 'SFMono-Regular', monospace;
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); margin-right: 4px;
}

/* God-tier palette upgrades */
.cmdk__panel { max-width: 680px; box-shadow: 0 40px 100px -10px rgba(0,0,0,.5), 0 0 0 1px rgba(45,174,67,.08); }
.cmdk__input-wrap { padding: 18px 22px; }
.cmdk__input-wrap svg { width: 20px; height: 20px; color: var(--primary); }
.cmdk__input-wrap input { font-size: 16px; font-weight: 500; }
.cmdk__results { padding: 8px; max-height: 56vh; }
.cmdk__group-label {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 12px 14px 6px; margin: 0;
}
.cmdk__group-label:first-child { padding-top: 4px; }
.cmdk__item {
  padding: 10px 12px; border-radius: 12px; gap: 12px;
  border: 1px solid transparent;
  position: relative;
}
.cmdk__item.is-active {
  background: color-mix(in srgb, var(--cat-accent, var(--primary)) 8%, var(--surface-2));
  border-color: color-mix(in srgb, var(--cat-accent, var(--primary)) 25%, transparent);
}
.cmdk__item:hover { background: var(--surface-2); }
.cmdk__cat {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.cmdk__enter {
  width: 18px; height: 18px; color: var(--muted); opacity: 0;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  flex: none;
}
.cmdk__item.is-active .cmdk__enter, .cmdk__item:hover .cmdk__enter {
  opacity: 1; color: var(--cat-accent, var(--primary));
}
.cmdk__item.is-active .cmdk__enter { transform: translateY(2px); }

/* =============================================================================
   COLLECTIONS — curated bundles for navigation
   ============================================================================= */
.collections {
  max-width: 1100px; margin: 0 auto;
  padding: 30px clamp(16px, 4vw, 40px);
  animation: rise .9s var(--ease) .3s both;
}
.collections__title {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  margin: 0 0 4px; letter-spacing: -.01em;
}
.collections__sub {
  font-size: 13px; color: var(--muted); margin: 0 0 18px;
}
.collections__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.collection {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-align: left;
  --coll-color: var(--primary);
}
.collection:hover {
  border-color: var(--coll-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px var(--coll-color);
}
.collection__icon {
  flex: none; width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.collection__body { flex: 1; min-width: 0; }
.collection__name {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--ink); line-height: 1.2;
}
.collection__count {
  font-size: 11px; color: var(--muted); margin-top: 3px;
}

@media (max-width: 760px) {
  .collections { padding: 20px 14px; }
  .collections__grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .collection { padding: 10px; gap: 8px; }
  .collection__icon { width: 36px; height: 36px; font-size: 18px; }
  .collection__name { font-size: 12px; }
  .collection__count { font-size: 10px; }
}

/* =============================================================================
   GOD-TIER UPGRADES v3 — accessibility + mobile + tour overlay
   ============================================================================= */

/* Skip link */
.skip-link:focus {
  left: 12px !important; top: 12px !important;
  outline: 3px solid #fff;
}

/* Focus visible everywhere */
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* High contrast for very small text */
@media (prefers-contrast: more) {
  :root { --line: rgba(11,18,32,.2); --muted: #4b5563; }
}

/* Mobile breakpoints for complex editors */
@media (max-width: 760px) {
  .pair { grid-template-columns: 1fr !important; gap: 12px; }
  .filterbar__inner { padding: 10px 14px; gap: 8px; }
  .chips { gap: 4px; }
  .chip { padding: 4px 10px; font-size: 11px; }
  .chip em { padding: 0 4px; }
  .filterbar__right { width: 100%; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
  .hub__cat-title { font-size: 17px; gap: 8px; }
  .hub__cat-icon { width: 28px; height: 28px; }
  .grid { grid-template-columns: 1fr !important; gap: 10px; }
  .tile { padding: 14px; }
  .tile__icon { width: 40px; height: 40px; }
  .view { padding: 18px 14px 60px; }
  .view__head { gap: 12px; margin-bottom: 18px; }
  .actions { gap: 8px; }
  .btn { padding: 10px 16px; font-size: 13px; }
  .btn--primary { min-width: 0; flex: 1; }
  .card { padding: 14px; }
  .nav { padding: 12px 14px; }
  .hero { padding: 30px 14px 24px; }
  .hero__title { font-size: clamp(2rem, 9vw, 3.2rem); }
  .stage { padding: 14px; }
  .drop { padding: 28px 16px; }
}

/* Touch targets ≥44px (WCAG) */
@media (pointer: coarse) {
  .btn, .iconbtn, .chip, .tab, .tile__fav { min-height: 40px; }
  input[type="range"] { height: 30px; }
  .field-input { padding: 12px 14px; font-size: 16px; }
}

/* Tour spotlight pulse */
#tourSpot::before {
  content: ""; position: absolute; inset: -4px;
  border: 2px solid var(--primary-2); border-radius: 16px;
  animation: tourPulse 1.6s ease-out infinite;
}
@keyframes tourPulse {
  0% { opacity: .8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.12); }
}

/* Language switcher */
#langSwitch {
  font-size: 12px; cursor: pointer;
}

/* Offline badge */
#offlineBadge { animation: rise .3s var(--ease); }

/* =============================================================================
   ADMIN DASHBOARD — refined KPI cards (in-line with existing visual language)
   ============================================================================= */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.kpi-card {
  --kpi-accent: var(--primary);
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 16px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  overflow: hidden;
}
.kpi-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--kpi-accent); opacity: .85;
}
.kpi-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--kpi-accent) 30%, var(--line));
}
.kpi-card--hi {
  background: linear-gradient(135deg, color-mix(in srgb, var(--kpi-accent) 6%, var(--surface)) 0%, var(--surface) 70%);
  border-color: color-mix(in srgb, var(--kpi-accent) 22%, var(--line));
}
.kpi-card__head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.kpi-card__icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.kpi-card__icon svg { width: 18px; height: 18px; }
.kpi-card__label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  line-height: 1.3;
}
.kpi-card__value-row {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.kpi-card__value {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700;
  letter-spacing: -.02em; line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi-card__delta {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 700; padding: 3px 7px;
  border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
}
.kpi-card__delta svg { width: 11px; height: 11px; }
.kpi-card__delta.is-up { color: #16a34a; background: rgba(22,163,74,.12); }
.kpi-card__delta.is-down { color: var(--danger); background: rgba(239,68,68,.12); }
.kpi-card__sub {
  font-size: 12px; color: var(--muted); margin-top: 4px;
}
.kpi-card__bar {
  height: 5px; background: var(--surface-2); border-radius: 3px;
  margin-top: 10px; overflow: hidden;
}
.kpi-card__bar-fill {
  height: 100%; border-radius: 3px;
  transition: width .6s var(--ease);
}

/* Hero search visually communicates it opens a popup */
.hero__search input { cursor: pointer; caret-color: transparent; }
.hero__search input:focus { cursor: text; }
.hero__search::after {
  content: "⌘K";
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-family: 'SFMono-Regular', monospace; font-size: 11px; font-weight: 600;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 6px; pointer-events: none;
}
.hero__search:has(input:not(:placeholder-shown))::after { display: none; }

/* =============================================================================
   HOME — favorito icon + hint + special categories
   ============================================================================= */
.tile { position: relative; padding-right: 56px; }
.tile__fav {
  position: absolute; top: 12px; right: 40px;
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; border: 0; cursor: pointer;
  color: var(--muted); opacity: 0;
  transition: all var(--dur-fast) var(--ease);
  display: inline-flex; align-items: center; justify-content: center;
}
.tile__fav svg { width: 16px; height: 16px; }
.tile:hover .tile__fav { opacity: 1; }
.tile__fav:hover { color: var(--accent); transform: scale(1.15); }
.tile__fav.is-on { opacity: 1; color: var(--accent); }
.hub__cat--special { animation: rise .6s var(--ease) both; }
.hub__cat--special .hub__cat-title { color: var(--ink); }
.hub__cat--special .hub__cat-title::after { background: var(--accent); height: 2px; opacity: .4; }
.hero__hint {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 12px; color: var(--muted);
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  animation: rise 1s var(--ease) .5s both;
}

/* =============================================================================
   DRAG OVERLAY
   ============================================================================= */
.drag-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(45, 174, 67, .85);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  animation: cmdkIn .2s var(--ease);
  pointer-events: none;
}
.drag-overlay__inner {
  text-align: center; padding: 40px;
  border: 3px dashed rgba(255,255,255,.6); border-radius: 24px;
  background: rgba(255,255,255,.05);
}
.drag-overlay__inner svg { width: 64px; height: 64px; margin-bottom: 20px; }
.drag-overlay__title { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.drag-overlay__sub { font-size: 14px; opacity: .85; margin-top: 6px; }

/* =============================================================================
   SKELETON
   ============================================================================= */
.skeleton {
  max-width: 820px; margin: 0 auto; padding: 28px 20px;
}
.skeleton__row {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; border-radius: 10px;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* =============================================================================
   CHANGELOG
   ============================================================================= */
.changelog { display: flex; flex-direction: column; gap: 14px; }
.changelog__entry {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 22px;
  position: relative;
}
.changelog__date {
  font-family: 'SFMono-Regular', monospace; font-size: 11px;
  color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px;
}
.changelog__entry h3 {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  margin: 0 0 10px; color: var(--ink); letter-spacing: -.01em; text-transform: none;
}
.changelog__entry ul { margin: 0; padding-left: 22px; }
.changelog__entry li { margin-bottom: 4px; font-size: 14px; color: var(--ink-soft); line-height: 1.55; }

/* =============================================================================
   USER CHIP (header)
   ============================================================================= */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all var(--dur-fast) var(--ease);
  max-width: 180px;
}
.user-chip:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.user-chip__avatar {
  width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.user-chip__name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-chip__badge {
  font-size: 9px; font-weight: 700; letter-spacing: .08em;
  background: linear-gradient(135deg, var(--accent), #e76f51);
  color: #fff; padding: 2px 6px; border-radius: var(--radius-pill);
  text-transform: uppercase;
}

/* =============================================================================
   Field helper
   ============================================================================= */
.field-input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* =============================================================================
   GOD-TIER UPGRADES — filter chips, search highlight, results, list view
   ============================================================================= */

/* Hero search clear */
.hero__search { position: relative; }
.hero__search input { padding-right: 48px; }
.hero__search-clear {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: var(--surface-2); color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}
.hero__search-clear:hover { background: var(--danger); color: #fff; }

/* Sticky filter bar */
.filterbar {
  position: sticky; top: 64px; z-index: 40;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  margin: 0 0 24px;
  animation: rise .9s var(--ease) .4s both;
}
[data-theme="dark"] .filterbar { background: rgba(11,18,32,.82); }
.filterbar__inner {
  max-width: 1100px; margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 40px);
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.filterbar__right {
  margin-left: auto; display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.filterbar__count {
  font-size: 12px; color: var(--muted); font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.filterbar__sort { display: inline-flex; align-items: center; gap: 4px; }
.filterbar__select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 12px; font-weight: 500;
  padding: 6px 24px 6px 12px; border-radius: var(--radius-pill);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 12px;
  cursor: pointer; transition: border-color var(--dur-fast) var(--ease);
}
.filterbar__select:hover { border-color: var(--primary); }
.filterbar__view {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 3px; gap: 0;
}
.view-btn {
  background: transparent; border: 0; padding: 6px 10px; border-radius: 999px;
  color: var(--muted); cursor: pointer; transition: all var(--dur-fast) var(--ease);
  display: inline-flex; align-items: center; justify-content: center;
}
.view-btn svg { width: 14px; height: 14px; }
.view-btn.is-on { background: var(--ink); color: #fff; }
.view-btn:not(.is-on):hover { color: var(--primary-dark); }

/* Filter chips */
.chips {
  display: flex; gap: 6px; flex-wrap: wrap;
  flex: 1; min-width: 0;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
  --cat-accent: var(--primary);
}
.chip__icon {
  display: inline-flex; width: 14px; height: 14px; color: var(--cat-accent);
}
.chip__icon svg { width: 100%; height: 100%; }
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cat-accent); }
.chip em {
  font-style: normal; font-size: 11px; font-weight: 700;
  padding: 1px 6px; background: var(--surface-2); border-radius: 999px;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.chip:hover {
  border-color: var(--cat-accent); color: var(--cat-accent);
  transform: translateY(-1px);
}
.chip:hover em { background: var(--cat-accent); color: #fff; }
.chip.is-on {
  background: var(--cat-accent); border-color: var(--cat-accent); color: #fff;
  box-shadow: 0 4px 14px -4px var(--cat-accent);
}
.chip.is-on em { background: rgba(255,255,255,.25); color: #fff; }
.chip.is-on .chip__icon, .chip.is-on .chip__dot { color: #fff; background: rgba(255,255,255,.9); }
.chip--sm { padding: 4px 10px; font-size: 11px; }

/* Category header with icon + count */
.hub__cat-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; letter-spacing: -.01em;
  color: var(--ink); text-transform: none;
  margin: 0 0 18px;
  display: flex; align-items: center; gap: 12px;
}
.hub__cat-title::after { display: none; }
.hub__cat-icon {
  flex: none; width: 36px; height: 36px; border-radius: 12px;
  background: color-mix(in srgb, var(--cat-accent, var(--primary)) 12%, transparent);
  color: var(--cat-accent, var(--primary-dark));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.hub__cat-icon svg { width: 20px; height: 20px; }
.hub__cat-count {
  font-style: normal; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); margin-left: 4px;
}

/* Tile category badge */
.tile__cat {
  display: inline-block; margin-top: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cat-accent, var(--primary-dark));
  opacity: .8;
}
.tile {
  border-left: 3px solid transparent;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease), border-left-color var(--dur) var(--ease);
}
.tile:hover { border-left-color: var(--cat-accent, var(--primary)); }
.tile:hover .tile__icon {
  background: color-mix(in srgb, var(--cat-accent, var(--primary)) 18%, transparent);
  color: var(--cat-accent, var(--primary-dark));
}

/* Highlight match in search results */
mark {
  background: linear-gradient(180deg, transparent 55%, rgba(45,174,67,.35) 55%);
  color: inherit; padding: 0 2px; border-radius: 2px;
  font-weight: 700;
}

/* Search results head */
.results-head {
  margin: 10px 0 18px;
  font-size: 14px; color: var(--ink-soft);
}
.results-head strong { color: var(--primary-dark); font-size: 18px; font-family: var(--font-display); }
.results-head em { font-style: normal; color: var(--ink); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px;
  animation: rise .5s var(--ease);
}
.empty-state__icon { font-size: 56px; margin-bottom: 16px; opacity: .7; }
.empty-state h3 { font-family: var(--font-display); font-size: 22px; margin: 0 0 8px; }
.empty-state h3 em { font-style: normal; color: var(--primary-dark); background: var(--surface-2); padding: 2px 10px; border-radius: 8px; }
.empty-state p { color: var(--muted); margin: 0; }
.empty-state a { color: var(--primary-dark); font-weight: 600; }

/* List view (compact rows) */
.grid--list {
  grid-template-columns: 1fr !important; gap: 6px !important;
}
.grid--list .tile {
  padding: 12px 16px 12px 14px;
  border-radius: 12px;
  border-left-width: 3px;
}
.grid--list .tile__icon { width: 36px; height: 36px; border-radius: 10px; }
.grid--list .tile__icon svg { width: 18px; height: 18px; }
.grid--list .tile__title { font-size: 14px; margin-bottom: 2px; }
.grid--list .tile__desc { font-size: 12px; line-height: 1.4; }
.grid--list .tile__cat { display: inline-block; margin-top: 4px; }
.grid--list .tile__arrow { right: 14px; }

/* Make hub padding 0 (filterbar takes its place) */
#hub { padding-top: 0 !important; }

#searchResults {
  max-width: 1100px; margin: 0 auto; padding: 0 20px 80px;
}

/* =============================================================================
   DESIGN REFRESH v4 — tiles, hero, chips, animations
   ============================================================================= */

/* Hero: bigger, more dramatic, animated gradient title */
.hero__title em {
  background: linear-gradient(110deg, var(--primary) 0%, var(--primary-2) 35%, var(--accent) 70%, var(--primary) 100%);
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: heroShine 6s linear infinite;
}
@keyframes heroShine { to { background-position: 250% center; } }

/* Counter pill in hero */
.hero__count {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; color: var(--primary-dark);
  margin-top: 8px; box-shadow: var(--shadow-xs);
}

/* Tiles: richer hover, gradient sheen, accent glow */
.tile {
  transition: transform .35s var(--ease), box-shadow .35s var(--ease),
              border-color .35s var(--ease), border-left-color .35s var(--ease);
  will-change: transform;
}
.tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--cat-accent, var(--primary)) 10%, transparent), transparent 65%);
  opacity: 0; transition: opacity .35s var(--ease); pointer-events: none;
}
.tile:hover::after { opacity: 1; }
.tile:hover {
  transform: translateY(-5px) scale(1.012);
  box-shadow: 0 22px 48px -18px color-mix(in srgb, var(--cat-accent, var(--primary)) 40%, rgba(11,18,32,.25));
  border-color: color-mix(in srgb, var(--cat-accent, var(--primary)) 35%, var(--line));
}
.tile:active { transform: translateY(-2px) scale(.998); }
.tile__icon {
  transition: transform .35s var(--ease), background .35s var(--ease), color .35s var(--ease);
}
.tile:hover .tile__icon { transform: scale(1.12) rotate(-5deg); }
.tile__badge {
  background: linear-gradient(135deg, var(--accent), #e76f51);
  box-shadow: 0 2px 8px -2px rgba(244,162,97,.5);
}
.tile__badge:not(:empty) { animation: badgePop .4s var(--ease) both; }
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

/* "Nuevo" badge in green, "Hot" in red-orange, "IA" in purple */
.tile__badge { text-transform: uppercase; }

/* Category headers: gradient accent bar instead of flat icon */
.hub__cat-icon {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--cat-accent, var(--primary)) 22%, transparent),
    color-mix(in srgb, var(--cat-accent, var(--primary)) 8%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat-accent, var(--primary)) 20%, transparent);
}
.hub__cat { animation: rise .7s var(--ease) both; }
.hub__cat-title { position: relative; }

/* Chips: glassy, smoother active state */
.chip { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.chip.is-on { transform: translateY(-1px) scale(1.03); }
.chip__icon svg, .chip__dot { transition: transform .2s var(--ease); }
.chip:hover .chip__icon { transform: scale(1.15); }

/* Filterbar: subtle gradient bottom border */
.filterbar { border-bottom: 1px solid transparent;
  background-image: linear-gradient(var(--surface-translucent, rgba(255,255,255,.85)), var(--surface-translucent, rgba(255,255,255,.85))),
    linear-gradient(90deg, var(--primary), var(--accent));
  background-origin: border-box; background-clip: padding-box, border-box;
}

/* Mesh background: richer, more layers */
.mesh__a { animation-duration: 26s; }
.mesh__b { animation-duration: 30s; }
.mesh__c { animation-duration: 22s; }

/* Smooth fade-in for view content */
.view, #searchResults > * { animation: fadeUp .5s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Card hover lift in tool views */
.card { transition: box-shadow .3s var(--ease); }

/* Better buttons: shine sweep on primary */
.btn--primary::before {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transition: left .6s var(--ease); pointer-events: none;
}
.btn--primary:hover::before { left: 140%; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 25%, var(--line)); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--primary) 45%, var(--line)); }

[data-theme="dark"] .filterbar {
  background-image: linear-gradient(rgba(11,18,32,.85), rgba(11,18,32,.85)), linear-gradient(90deg, var(--primary), var(--accent));
}

/* =============================================================================
   STRUCTURAL REDESIGN v5 — mobile-first, bottom nav, category sheet
   ============================================================================= */

/* ---- Mobile bottom navigation (hidden on desktop) ---- */
.botnav { display: none; }
@media (max-width: 820px) {
  .botnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: stretch;
  }
  [data-theme="dark"] .botnav { background: rgba(11,18,32,.92); }
  .botnav__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: 0; cursor: pointer; padding: 6px 2px;
    color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .01em;
    text-decoration: none; min-height: 52px; border-radius: 12px;
    transition: color var(--dur-fast) var(--ease);
    -webkit-tap-highlight-color: transparent;
  }
  .botnav__item svg { width: 23px; height: 23px; }
  .botnav__item.is-active { color: var(--primary-dark); }
  .botnav__item:active { background: var(--surface-2); }
  .botnav__fab span { color: inherit; }
  .botnav__fab svg { width: 24px; height: 24px; }
  /* Add bottom padding so content isn't hidden behind bottom nav */
  body { padding-bottom: 68px; }
  .foot { padding-bottom: 90px; }
  .toast { bottom: 84px; }
  #offlineBadge { bottom: 140px; }
}

/* ---- Category bottom sheet ---- */
.sheet[hidden] { display: none !important; }
.sheet { position: fixed; inset: 0; z-index: 1100; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(11,18,32,.5); backdrop-filter: blur(4px); animation: cmdkIn .25s var(--ease); }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,.25);
  animation: sheetUp .35s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet__handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 14px; }
.sheet__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet__head strong { font-family: var(--font-display); font-size: 18px; }
.sheet__close { background: var(--surface-2); border: 0; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 16px; color: var(--muted); }
.sheet__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sheet__cat {
  display: flex; align-items: center; gap: 10px; padding: 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
  cursor: pointer; text-align: left; transition: all var(--dur-fast) var(--ease);
  --cat-accent: var(--primary);
}
.sheet__cat:active { transform: scale(.97); border-color: var(--cat-accent); }
.sheet__cat-icon {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--cat-accent) 14%, transparent); color: var(--cat-accent);
}
.sheet__cat-icon svg { width: 22px; height: 22px; }
.sheet__cat-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.sheet__cat-count { font-size: 11px; color: var(--muted); }

/* ---- Mobile-perfect grid + tiles ---- */
@media (max-width: 820px) {
  .nav { padding: 10px 14px; }
  .nav__pill { display: none; }
  .nav__brand-sub { display: none; }
  /* Filterbar becomes a clean horizontal scroller */
  .filterbar { top: 56px; margin-bottom: 14px; }
  .filterbar__inner { padding: 10px 14px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .filterbar__inner::-webkit-scrollbar { display: none; }
  .filterbar__right { display: none; } /* hide sort/view on mobile — bottom nav handles it */
  .chips { flex-wrap: nowrap; }
  .chip { flex: none; }
  .hub { padding: 0 14px 40px; }
  .hub__cat { margin-bottom: 26px; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  /* Compact comfortable tiles for mobile */
  .tile { padding: 14px 16px 14px 14px; border-radius: 16px; gap: 12px; align-items: center; min-height: 64px; }
  .tile:hover { transform: none; } /* no hover lift on touch */
  .tile:active { transform: scale(.98); }
  .tile__icon { width: 44px; height: 44px; border-radius: 12px; }
  .tile__icon svg { width: 22px; height: 22px; }
  .tile__title { font-size: 15px; }
  .tile__desc { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tile__cat { display: none; }
  .tile__fav { opacity: 1; top: 50%; right: 36px; transform: translateY(-50%); width: 36px; height: 36px; } /* always visible + tappable */
  .tile__arrow { display: none; }
  .hero { padding: 26px 16px 18px; }
  .hero__title { font-size: clamp(1.8rem, 8vw, 2.6rem); }
  .hero__sub { font-size: 14px; }
  .hero__count { font-size: 11px; }
  .hero__hint { display: none; }
}

/* ---- Two-col grid on small tablets ---- */
@media (min-width: 540px) and (max-width: 820px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .sheet__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Quick category jump rail on home (desktop too) ---- */
.cat-jump {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cat-jump::-webkit-scrollbar { display: none; }

/* =============================================================================
   PREMIUM REFRESH v6 — calidad nivel Dios
   Eleva tipografía, espaciado, sombras, microinteracciones sin romper estructura
   ============================================================================= */

:root, [data-theme="light"] {
  /* Neutros refinados (mejor jerarquía y contraste) */
  --bg: #fafbf8;
  --surface: #ffffff;
  --surface-2: #f4f6f1;
  --surface-3: #eef1ea;
  --ink: #0a0f1a;
  --ink-soft: #1f2937;
  --muted: #5b6471;
  --line: rgba(10,15,26,.06);
  --line-strong: rgba(10,15,26,.10);
  /* Sombras premium (estilo Apple/Stripe) */
  --shadow-xs: 0 1px 2px rgba(10,15,26,.04), 0 1px 1px rgba(10,15,26,.02);
  --shadow-sm: 0 2px 6px rgba(10,15,26,.05), 0 4px 14px rgba(10,15,26,.04);
  --shadow-md: 0 8px 28px -8px rgba(10,15,26,.14), 0 4px 12px -4px rgba(10,15,26,.06);
  --shadow-lg: 0 24px 60px -18px rgba(31,138,50,.22), 0 8px 24px -8px rgba(10,15,26,.10);
  --shadow-focus: 0 0 0 4px rgba(45,174,67,.18);
  /* Radios escalados */
  --radius-xs: 8px; --radius-sm: 10px; --radius-md: 14px;
  --radius-card: 18px; --radius-lg: 22px; --radius-pill: 999px;
  /* Animaciones más elegantes */
  --ease: cubic-bezier(.16,.84,.3,1);
  --ease-out: cubic-bezier(.22,1,.36,1);
  --dur-fast: 160ms; --dur: 260ms; --dur-slow: 520ms;
}

[data-theme="dark"] {
  --bg: #07090e;
  --surface: #10141c;
  --surface-2: #161b25;
  --surface-3: #1d242f;
  --ink: #e9ecf2;
  --ink-soft: #c4cad4;
  --muted: #8b95a4;
  --line: rgba(255,255,255,.07);
  --line-strong: rgba(255,255,255,.13);
  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.4);
  --shadow-md: 0 12px 32px -10px rgba(0,0,0,.55), 0 4px 12px -4px rgba(0,0,0,.4);
  --shadow-lg: 0 28px 60px -20px rgba(31,138,50,.35), 0 8px 24px -8px rgba(0,0,0,.55);
  --shadow-focus: 0 0 0 4px rgba(76,200,99,.28);
}

/* ---- Tipografía elevada ---- */
body { font-feature-settings: 'cv11','ss01','ss03'; letter-spacing: -0.005em; }
h1, h2, h3, .hub__cat-title, .hero__title, .view__title {
  letter-spacing: -0.025em;
  font-feature-settings: 'ss01','cv11';
}
.hero__title { font-weight: 800; letter-spacing: -0.045em; }
.hub__cat-title { letter-spacing: -0.015em; }

/* ---- Hero más limpio y premium ---- */
.hero { padding-top: clamp(56px, 10vw, 120px); padding-bottom: clamp(20px, 4vw, 40px); }
.hero__tag {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--primary-dark);
  letter-spacing: .14em;
  box-shadow: var(--shadow-xs);
}
.hero__tag::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  background: var(--primary); border-radius: 50%; margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 0 4px rgba(45,174,67,.18);
  animation: pulse 2s var(--ease) infinite;
}
.hero__sub { font-size: clamp(15px, 1.5vw, 17px); color: var(--muted); line-height: 1.6; }
.hero__sub strong { color: var(--ink); font-weight: 600; }

.hero__search input {
  height: 56px; padding-left: 52px; padding-right: 110px;
  font-size: 16px; font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.hero__search input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus), var(--shadow-sm);
  transform: none;
}
.hero__search svg { left: 22px; width: 20px; height: 20px; color: var(--muted); }

.hero__count {
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--ink-soft); padding: 6px 14px;
  box-shadow: var(--shadow-xs);
}
.hero__count::first-letter { color: var(--primary); }

/* ---- Filterbar premium ---- */
.filterbar {
  background: rgba(250, 251, 248, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background-image: none;
}
[data-theme="dark"] .filterbar { background: rgba(7, 9, 14, 0.78); background-image: none; }

.chip {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
  height: 36px;
  padding: 0 14px;
}
.chip em { background: transparent; border: 1px solid var(--line); padding: 1px 7px; }
.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--cat-accent, var(--primary)); }
.chip.is-on { box-shadow: var(--shadow-md), 0 0 0 3px color-mix(in srgb, var(--cat-accent, var(--primary)) 18%, transparent); }

/* ---- Tiles premium (la pieza más visible) ---- */
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs);
  padding: 18px 20px;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out),
              border-color .25s var(--ease), background .25s var(--ease);
}
.tile::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--cat-accent, var(--primary)); border-radius: var(--radius-card) var(--radius-card) 0 0;
  opacity: 0; transition: opacity .25s var(--ease);
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--cat-accent, var(--primary)) 22%, var(--line-strong));
}
.tile:hover::before { opacity: 1; }
.tile:hover .tile__icon {
  background: color-mix(in srgb, var(--cat-accent, var(--primary)) 16%, transparent);
  color: var(--cat-accent, var(--primary-dark));
  transform: scale(1.08);
}
.tile__icon {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  width: 44px; height: 44px;
  border-radius: 12px;
  flex: none;
}
.tile__icon svg { width: 22px; height: 22px; stroke-width: 1.7; }
.tile__title {
  font-size: 15.5px; font-weight: 650;
  color: var(--ink); margin-bottom: 4px;
  letter-spacing: -0.015em;
  font-family: var(--font-body);
}
.tile__desc {
  font-size: 13px; color: var(--muted); line-height: 1.5;
}
.tile__badge {
  font-size: 9.5px; padding: 2px 7px; border-radius: 4px;
  font-weight: 700; letter-spacing: .06em;
  background: var(--primary); color: #fff;
  box-shadow: none; animation: none;
  vertical-align: middle;
}
.tile__cat {
  font-size: 9.5px; letter-spacing: .12em;
  color: var(--cat-accent, var(--primary-dark));
  opacity: .85; margin-top: 6px; font-weight: 700;
}
.tile__arrow {
  width: 16px; height: 16px; opacity: 0;
  transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.tile:hover .tile__arrow { opacity: .6; transform: translate(2px, -50%); }
.tile__fav {
  width: 30px; height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  top: 14px; right: 14px;
  opacity: 0;
}
.tile__fav svg { width: 15px; height: 15px; }
.tile:hover .tile__fav { opacity: 1; }
.tile__fav.is-on { opacity: 1; background: color-mix(in srgb, var(--accent) 15%, var(--surface-2)); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }

/* ---- Category headers premium ---- */
.hub__cat { margin-bottom: 40px; }
.hub__cat-title {
  font-size: 20px; font-weight: 700;
  color: var(--ink); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.hub__cat-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: color-mix(in srgb, var(--cat-accent, var(--primary)) 12%, transparent);
  color: var(--cat-accent, var(--primary-dark));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat-accent, var(--primary)) 18%, transparent);
}
.hub__cat-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.hub__cat-count {
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11px; padding: 2px 9px;
  color: var(--muted);
  font-weight: 700;
}

/* ---- Buttons premium ---- */
.btn--primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 6px 18px -6px rgba(31,138,50,.45),
              inset 0 1px 0 rgba(255,255,255,.18),
              inset 0 -1px 0 rgba(0,0,0,.08);
  font-weight: 600;
  letter-spacing: -0.005em;
  font-size: 14px;
  height: 42px;
  padding: 0 22px;
}
.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(31,138,50,.55),
              inset 0 1px 0 rgba(255,255,255,.22);
}
.btn--soft, .btn--ghost {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
  height: 38px;
}
.btn--soft:hover:not(:disabled), .btn--ghost:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line-strong));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* ---- Cards refinadas ---- */
.card {
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.card h3 {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: -0.015em;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}

/* ---- Inputs refinados ---- */
.field-input, textarea.field-input, select.field-input {
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 14px;
  height: 42px;
  border-radius: var(--radius-sm);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.field-input:focus, textarea.field-input:focus, select.field-input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}
textarea.field-input { height: auto; padding: 12px 14px; line-height: 1.6; }

/* ---- Top nav refinada ---- */
.nav {
  background: rgba(250, 251, 248, 0.82);
  border-bottom: 1px solid var(--line);
  padding: 14px clamp(16px, 4vw, 40px);
}
[data-theme="dark"] .nav { background: rgba(7, 9, 14, 0.82); }
.nav__brand strong { font-size: 18px; letter-spacing: -0.025em; }
.nav__icon-btn {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  height: 40px;
  padding: 0 14px;
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}
.nav__icon-btn:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.nav__pill {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-xs);
  height: 32px;
  font-weight: 600;
}

/* ---- Mejor scroll suave + selection ---- */
html { scroll-behavior: smooth; }
::selection { background: rgba(45,174,67,.22); color: var(--ink); }

/* ---- Foco accesible visible y elegante ---- */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- Bottom nav móvil más premium ---- */
@media (max-width: 820px) {
  .botnav {
    background: rgba(255,255,255,.94);
    box-shadow: 0 -1px 0 var(--line), 0 -8px 20px rgba(10,15,26,.04);
  }
  [data-theme="dark"] .botnav { background: rgba(7,9,14,.95); }
  .botnav__item { font-weight: 600; }
  .botnav__item.is-active {
    color: var(--primary-dark);
    position: relative;
  }
  .botnav__item.is-active::before {
    content: ""; position: absolute; top: 2px;
    width: 28px; height: 3px; border-radius: 2px;
    background: var(--primary);
  }
  /* Hero más compacto en móvil */
  .hero__title { font-weight: 800; }
  .tile { padding: 16px; }
  .tile__icon { width: 40px; height: 40px; border-radius: 11px; }
}

/* ---- Toast elegante ---- */
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 500;
  font-size: 13.5px;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255,255,255,.06);
}
.toast.is-success {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

/* ---- Mesh background sutil ---- */
.mesh > div { opacity: 0.35; }
[data-theme="dark"] .mesh > div { opacity: 0.25; }

/* ---- Command palette más premium ---- */
.cmdk__panel {
  border-radius: 18px;
  box-shadow: 0 32px 80px -16px rgba(10,15,26,.35),
              0 0 0 1px rgba(255,255,255,.04);
}
.cmdk__input-wrap input { font-size: 16px; }
.cmdk__item { border-radius: 10px; padding: 10px 12px; }

/* ---- Sheet móvil más premium ---- */
.sheet__panel {
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -16px 50px rgba(10,15,26,.28);
}
.sheet__cat { padding: 16px; border-radius: 14px; }
.sheet__cat-name { font-size: 14.5px; font-weight: 650; }

/* ---- Reduced motion: desactiva todo ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Responsive */
@media (max-width: 700px) {
  .filterbar { top: 60px; }
  .filterbar__inner { padding: 10px 16px; gap: 10px; }
  .filterbar__right { width: 100%; justify-content: space-between; }
  .chips { gap: 5px; }
  .chip { padding: 5px 10px; font-size: 11px; }
  .chip em { font-size: 10px; padding: 0 5px; }
  .hub__cat-title { font-size: 18px; }
  .hub__cat-icon { width: 30px; height: 30px; }
}

/* ─────────── Redesign v7 · Hero v2 + Use-case paths + Featured ─────────── */

.hero--v2 {
  padding: 56px 24px 40px;
  text-align: center;
  max-width: 920px;
  margin: 0 auto;
}
.hero--v2 .hero__pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, rgba(45,174,67,.12), rgba(76,200,99,.04));
  border: 1px solid rgba(45,174,67,.25);
  padding: 7px 16px; border-radius: 100px;
  font-size: 13px; color: var(--primary-dark); text-decoration: none;
  font-weight: 500; margin-bottom: 24px;
  transition: all .15s ease;
}
.hero--v2 .hero__pill:hover { transform: translateY(-1px); border-color: rgba(45,174,67,.45); }
.hero--v2 .hero__pill strong { font-weight: 700; }

.hero--v2 .hero__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--ink);
}
.hero--v2 .hero__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero--v2 .hero__title em::after { display: none; }

.hero--v2 .hero__sub {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 32px;
}
.hero--v2 .hero__sub strong { font-weight: 600; color: var(--ink); }

.hero--v2 .hero__search {
  max-width: 620px;
  margin: 0 auto 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  transition: all .15s ease;
}
.hero--v2 .hero__search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(45,174,67,.15), 0 0 0 4px rgba(45,174,67,.08);
}
.hero--v2 .hero__search input { font-size: 16px; padding: 18px 50px 18px 50px; }

.hero__quick {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 0 auto 28px; max-width: 700px;
}
.quick-chip {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.quick-chip:hover {
  background: var(--surface-1);
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.hero__trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  font-size: 12px; color: var(--muted);
}
.hero__trust span:not([style]) { display: inline-flex; align-items: center; }

/* Section heads — shared by paths/featured/catalog */
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 28px;
  padding: 0 20px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
.section-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Paths — "¿Qué quieres hacer?" 6 big tiles */
.paths {
  padding: 50px 20px 40px;
  max-width: 1240px;
  margin: 0 auto;
}
.paths__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.path {
  display: grid;
  grid-template-columns: 72px 1fr 28px;
  gap: 18px;
  align-items: center;
  background: var(--surface-1);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  text-align: left;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.path::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--p-color); opacity: 0; transition: opacity .2s;
}
.path:hover {
  border-color: var(--p-color);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
}
.path:hover::before { opacity: 1; }
.path__icon {
  width: 72px; height: 72px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  background: color-mix(in srgb, var(--p-color) 12%, transparent);
}
.path__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 4px;
}
.path__desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 6px;
}
.path__count {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--p-color);
  background: color-mix(in srgb, var(--p-color) 10%, transparent);
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.02em;
}
.path__arrow {
  width: 22px; height: 22px;
  color: var(--muted);
  transition: transform .2s, color .2s;
}
.path:hover .path__arrow { color: var(--p-color); transform: translateX(4px); }

/* Featured section */
.featured {
  padding: 30px 20px 20px;
  max-width: 1240px;
  margin: 0 auto;
}

/* Catalog head — separator before filterbar */
.catalog-head {
  padding: 50px 20px 10px;
}

/* Mobile tweaks */
@media (max-width: 720px) {
  .hero--v2 { padding: 32px 16px 24px; }
  .hero--v2 .hero__title { font-size: 36px; }
  .hero--v2 .hero__sub { font-size: 15px; margin-bottom: 22px; }
  .paths { padding: 30px 16px; }
  .paths__grid { grid-template-columns: 1fr; gap: 12px; }
  .path { grid-template-columns: 56px 1fr 22px; padding: 16px; gap: 14px; }
  .path__icon { width: 56px; height: 56px; font-size: 28px; }
  .path__title { font-size: 17px; }
  .section-title { font-size: 24px; }
  .hero__trust { font-size: 11px; gap: 8px; }
}

/* ─────────── Onboarding start-guide (new users) ─────────── */
.start-guide {
  max-width: 1100px; margin: 0 auto 10px; padding: 0 20px;
}
.start-guide__inner {
  position: relative;
  background: linear-gradient(135deg, rgba(45,174,67,.08), rgba(76,200,99,.03));
  border: 1.5px solid rgba(45,174,67,.22);
  border-radius: 18px; padding: 24px 28px;
}
.start-guide__close {
  position: absolute; top: 14px; right: 16px;
  background: var(--surface-2); border: 1px solid var(--line);
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.start-guide__close:hover { background: var(--surface-1); color: var(--ink); }
.start-guide__title {
  font-family: var(--font-display); font-size: 19px; font-weight: 700;
  margin: 0 0 18px; color: var(--ink); padding-right: 30px;
}
.start-guide__steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.start-guide__step { display: flex; gap: 12px; align-items: flex-start; }
.start-guide__num {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.start-guide__step strong { display: block; font-size: 15px; margin-bottom: 3px; }
.start-guide__step p { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 8px; }
.start-guide__step em { color: var(--primary-dark); font-style: normal; font-weight: 600; }
.start-guide__cta { font-size: 12px; padding: 5px 12px; }

@media (max-width: 720px) {
  .start-guide__steps { grid-template-columns: 1fr; gap: 14px; }
  .start-guide__title { font-size: 16px; }
  .start-guide__inner { padding: 20px; }
}

/* Filter label in filterbar */
.filterbar__label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  flex-shrink: 0; align-self: center; margin-right: 4px;
}
@media (max-width: 720px) { .filterbar__label { display: none; } }

/* Active filter button in scan tools */
.filt.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 500 milestone hero pill */
.hero__pill--milestone {
  background: linear-gradient(135deg, rgba(45,174,67,.18), rgba(245,158,11,.12)) !important;
  border-color: rgba(45,174,67,.4) !important;
  animation: milestonePulse 3s ease-in-out infinite;
}
@keyframes milestonePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45,174,67,.25); }
  50% { box-shadow: 0 0 0 6px rgba(45,174,67,0); }
}
